[Home]

Summary:ASTERISK-12935: [patch] Event processing sometimes hangs when using res_timing_pthread
Reporter:Matthias Urlichs (smurfix)Labels:
Date Opened:2008-10-18 15:12:15Date Closed:2008-12-11 15:21:46.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Resources/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) res.patch
( 1) res.patch.fixed
Description:There's a bug in the pthread timing code which sometimes blocks event processing.

Triggered thus:
* queue event to channel (DTMF for instance).
 pthread_timer_enable_continuous() gets called.
* Set an explicit rate (play dial tone). State switches to TIMER_STATE_TICKING.
* Drop the rate (stop playing). State switches to TIMER_STATE_IDLE.
* Since the continuous timeout has thus been disabled, even though
 pthread_timer_disable_continuous() has never been called, the unprocessed
 events (digits for overlap dialing) languish in the channel.

Fix:
* Setting an explicit rate just remembers the intended rate when the
 timer state is TIMER_STATE_CONTINUOUS.
* pthread_timer_disable_continuous() restores that rate.


Patch attached, probably applicable to 1.6.0 and trunk.

****** ADDITIONAL INFORMATION ******

I'm rewriting the interface between Asterisk and LCR (Linux Call Router, which interfaces with the new socket-based mISDN driver in recent kernels) to be compatible with Asterisk 1.6

Some of the ISDN phones I'm testing with send the dialled digits immediately after connecting. The driver generates a heap of DTMF events from these. My dialplan turns on dial tone, then sees the first digits and turns the tone off again. That caused digit processing to stop, the unprocessed digits sat in the event queue doing nothing.

Needless to say, this is not optimal.
Comments:By: Matthias Urlichs (smurfix) 2008-10-18 15:24:13

Update: fixed the patch line numbers (I removed a few debug statements manually)

By: Digium Subversion (svnbot) 2008-12-11 15:21:46.000-0600

Repository: asterisk
Revision: 163241

U   trunk/res/res_timing_pthread.c

------------------------------------------------------------------------
r163241 | russell | 2008-12-11 15:21:45 -0600 (Thu, 11 Dec 2008) | 8 lines

Fix a problem where continuous mode will get inadvertently get turned off if set_rate()
is used while continuous mode was already turned on.

(closes issue ASTERISK-12935)
Reported by: smurfix
Patches:
     res.patch.fixed uploaded by smurfix (license 547)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=163241