[Asterisk-Users] The sounds of silence: silent soundfiles available

John Todd jtodd at loligo.com
Thu Sep 4 23:40:30 MST 2003


>On Fri, 2003-09-05 at 00:05, John Todd wrote:
>>  As has been noted before on this list, the Wait() application does
>>  not listen for keystrokes from users.  Many of you, like me, have
>>  looping Background(), Wait(), and Goto() application priority chains
>>  that prompt users to enter some data, and then repeat the
>>  instructions if no keys are pressed.  The problem of course is if the
>>  user doesn't start pressing keys during the Background() call and
>>  delays until the Wait() application is called, those keys are lost.
>>
>>  I had solved this some time back by creating a few random length
>>  files of silence, that would replace Wait() routines in some
>>  circumstances.  I have finally created a formal measured group of
>>  files, each with 1-10 seconds of silence, and put them in my sounds
>>  directory for public consumption.  Not a big deal for most of you to
>>  create these files yourselves, but perhaps a minor pain that
>>  hopefully I've removed for some people who don't have sound tools
>>  handy.
>>
>>  http://www.loligo.com/asterisk/sounds/silence/
>
>And you missed the right way to deal with this. You may have to break
>your extensions into more contexts, but you let the timeout function do
>it's work.
>
>[learning_the_way]
>exten => s,1,DigitTimeout,5
>exten => s,2,ResponseTimeout,10
>exten => s,3,background(instructions)
>exten => s,4,background(more_instructions)
>
>exten => t,1,Goto(s|3)
>
>
>This will let the call progress through the backgound apps, and if it
>falls out of these rules, then it waits 10 seconds and falls into the t
>extension where you can do whatever you like even going back and
>repeating the instructions.
>
>--
>Steven Critchfield <critch at basesys.com>

No, I didn't quite miss that method, but your example is useful in 
certain circumstances.

There are instances where you have pauses in between voice prompts 
that are not necessarily looped; I did not include in my message all 
possible iterations of why these silent gaps might be required, but 
since that is non-obvious, I include an instance below.  It could be 
done with multiple contexts or meta-extensions, but I feel that is 
inelegant and confusing when it need not be.  There are multiple ways 
to do things with Asterisk; not all of them fall into definitions of 
the "right" way for all administrators.


[nonpedanticexample]
exten => s,1,DigitTimeout(5)
exten => s,2,ResponseTimeout(20)
exten => s,3,Background(type-your-selection)
exten => s,4,Background(silence/3)
exten => s,5,Background(type-your-selection)
exten => s,6,Background(silence/3)
exten => s,7,Background(if-you-need-help-press-pound-for-instructions)

exten => t,1,Goto(s,3)




More information about the asterisk-users mailing list