Summary:ASTERISK-12859: WAITSTATUS will never get set for digitally muted channels
Reporter:Frank Waller (explidous)Labels:
Date Opened:2008-10-09 15:46:04Date Closed:2008-10-14 14:58:45
Versions:Frequency of
Description:Basically line 110 in app_waitforsilence.c should be:

if (res < 0) {

and line 116 should be :

if (res == 0) {

On line 110 it is checking to see if the result from ast_waitfor is less than or equal to 0 if so it exits assuming the channel has hungup. If not on line 116 it checks to see if the result is not true if so it assumes it is a digitally muted channel and the wait lasted the appropriate period of time. It then goes on to set the channel variable WAITSTATUS equal to SILENCE. WAITSTATUS can never be set to SILENCE for a digitally muted channel though because line 110 will caused the application to exit. The interesting way that line 116 current checks to see if the result was 0 probably led to this in the first place.
Comments:By: Leif Madsen (lmadsen) 2008-10-14 11:40:42

Reporter does a good job of explaining what the issue is, and why it appears to be an issue. Also in the description is a suggested change. Assigning to Corydon76 in the hopes this issue can be resolved quickly. Thanks!

By: Digium Subversion (svnbot) 2008-10-14 14:58:43

Repository: asterisk
Revision: 149061

U   branches/1.4/apps/app_waitforsilence.c

r149061 | tilghman | 2008-10-14 14:58:43 -0500 (Tue, 14 Oct 2008) | 6 lines

Check correct values in the return of ast_waitfor(); also, get rid of a
possible memory leak.
(closes issue ASTERISK-12859)
Reported by: explidous
Patch by: me