WaitForSilence([silencerequired,iterations,timeout])
Full arguments reference
silencerequired- If not specified, defaults to1000milliseconds.iterations- If not specified, defaults to1.timeout- Is specified only to avoid an infinite loop in cases where silence is never achieved.
Waits for up to silencerequired milliseconds of silence, iterations times. An optional timeout specified the number of seconds to return after, even if we do not receive the specified amount of silence. Use timeout with caution, as it may defeat the purpose of this application, which is to wait indefinitely until silence is detected on the line. This is particularly useful for reverse-911-type call broadcast applications where you need to wait for an answering machine to complete its spiel before playing a message.
Typically you will want to include two or more calls to WaitForSilence when dealing with an answering machine; first waiting for the spiel to finish, then waiting for the beep, etc.
same => n,WaitForSilence(500,2)
same => n,WaitForSilence(1000)
same => n,WaitForSilence(300,3,10)
Sets the channel variable WAITSTATUS to one of these values:
- WAITSTATUS
SILENCE- if exited with silence detected.TIMEOUT- if exited without silence detected after timeout.
silencerequired- If not specified, defaults to1000milliseconds.iterations- If not specified, defaults to1.timeout- Is specified only to avoid an infinite loop in cases where silence is never achieved.
User Notes
Know a tip or gotcha for this topic? Share it below and help others.
Contribute a note
Share a tip, gotcha, or practical example. Keep it under 2000 characters. No questions (use the Asterisk community forums for support). Wrap code in backticks.