[asterisk-users] WaitForSilence doesn't work unless Background is called?

Devin Jacobs dbuttonz at gmail.com
Wed Oct 14 14:53:12 CDT 2009


I'be been having problems with the WaitForSilence application in my
dialplan.  The behavior I've noticed, and hope to demonstrated with
the fallowing examples, is that WaitForSilence (WFS for short) does
not work until Background is called.  Note that the lenghts of the
sounds are approximately 5 seconds for bring, and 10 for presses.

[Testing]
exten => s,1,Answer()
exten => s,n,Wait(10)
exten => s,n,WaitForSilence(5000)
exten => s,n,Background(arstandard/bring)
exten => s,n,WaitForSilence(5000)
exten => s,n,Background(arstandard/presses)

I am making constant noise during this dialplan.  "bring" plays,
despite the constant noise, indicating that the first WaitForSilence
call doesn't work, but the second does work because "presses" never
plays.  The Asterisk CLI output can be found here
http://pastebin.com/m202fc48e , for this particular dial plan.  Other
dialplans demonstrate similar behavior.

[Testing]
;exten => s,1,Answer()
;exten => s,n,Wait(10)
;exten => s,n,WaitForSilence(5000)
exten => s,1,Background(arstandard/bring)
exten => s,n,WaitForSilence(5000)
exten => s,n,Background(arstandard/presses)

I am making constant noise during this dialplan.  "bring" plays
instantly, and I can clearly hear the beginning of the message; the
dialplan begins at the correct time, and answer detection is working
properly.  "presses" never plays, due to the constant noise.  WFS
works after a call to background but not before.

I believe this is related to the "lines" we are using.  By "lines" I
mean the fallowing: g711 codec, SIP protocol, over DSL lines, with
Qwest IPLD as the provider.  Regular voice conversations are possible
over the Qwest lines, and DTMF detection works well.  We have tested
multiple phones including a couple of our cell phones with various
carriers.  Any phone we call using the Qwest lines demonstrates the
same behavior.

When I call locally, thus taking the Qwest lines out of the picture,
WFS works as expected.  By "call locally", I mean that I call from
Asterisk, located in the office, to another phone in the office.

I'm wondering what possible sources there may be for this behavior?

The big picture is, we are making out bound calls using AMI Originate
commands.  I have a script that does the originations using an AMI
connection.  Everything appears to be working well with this.  It's
clear that the Originate commands work, because the phones ring, and
the dialplan/contexts work (except for WFS).  We call over the Qwest
lines using Originate, and we called locally (within the same office)
using Originate.  The only difference was that Qwest lines were not
used in the latter.



More information about the asterisk-users mailing list