[asterisk-users] WaitForSilence NEVER detects silence,,Post

Mike A. Leonetti mikealeonetti at gmail.com
Mon Mar 30 12:11:10 CDT 2015

I have a call server that runs on a few custom AGI scripts initiating 
calls and then managing the calls. I'm getting stuck on the detecting 
silence functions. I wanted to use the silence detecting as a quick 
method of substituting Answering Machine Detection.

However, whenever WaitForSilence is supposed to be detecting silence, it 
always just ends the interval whether or not there is actual silence. If 
I'm still talking, it will consider that as silence also.

My AEL dialplan associated with the calling is:
>         100 => {
>                 Answer();
>                 WaitForSilence(5000,2,60);
>                 AGI(agi://,${CALLID});
>                 AGI(agi://,"Goodbye.");
>                 Hangup();
>         }

And the CLI just outputs:
>     == Using SIP RTP CoS mark 5
>     > Channel SIP/twilio-0000006e was answered
>     -- Executing [100 at makeCall:1] Answer("SIP/twilio-0000006e", "") in 
> new stack
>     -- Executing [100 at makeCall:2] 
> WaitForSilence("SIP/twilio-0000006e", "5000,2,60") in new stack
>     -- Waiting 2 time(s) for 5000 ms silence with 60 timeout
>     -- Exiting with 5000ms silence >= 5000ms required
>     -- Exiting with 5000ms silence >= 5000ms required
>     -- Executing [100 at makeCall:3] AGI("SIP/twilio-0000006e", 
> "agi://,45") in new stack
>     -- Playing '/var/nam/data/outgoing/60' (escape_digits=#) 
> (sample_offset 0)
>     > 0x7f2179cf7990 -- Probation passed - setting RTP source address 
> to
>     -- Playing '/var/nam/data/tts/9eccb3f2ed77972157becdfbbac7232c' 
> (escape_digits=1#) (sample_offset 0)
>     -- <SIP/twilio-0000006e>AGI Script agi:// 
> completed, returning 4
>     == Spawn extension (makeCall, 100, 3) exited non-zero on 
> 'SIP/twilio-0000006e'

In my test above, it waits for 5 seconds of silence twice, but even if 
I'm talking for the 5 seconds it will still just figure that I'm being 
silent when I'm not.

I also tried using AMD to see if that would do a good job of detecting 
an answering machine, but it thinks that everything is a MACHINE.

I know Asterisk is knowledgeable abut detecting silence because I have 
another AGI script that uses the RECORD FILE command that will 
successfully record somebody's voice and stop recording when there is 5 
seconds of silence (which is what I set).

Is there a setting somewhere that I'm missing somewhere for a silence 
threshold for WaitForSilence or am I misunderstanding its use?

The Asterisk version is
> Asterisk 11.7.0~dfsg-1ubuntu1

And it's Asterisk installed from an Ubuntu package.

Thanks so much!

Mike A. Leonetti
As warm as green tea

More information about the asterisk-users mailing list