I am trying to use my dialplan to play recordings with WaitForSilence to make sure it wait until the person is done speaking or the message is left on voicemail. However, it doesn't seem to wait for 5 seconds of silence. Even if I'm talking it will still detect silence.
My AEL dialplan is this:
100 => {
Answer();
WaitForSilence(5000,2,60);
AGI(agi://127.0.0.1/playmessage,${CALLID});
AGI(agi://127.0.0.1/saytext,"Goodbye.");
Hangup();
}
Outputs
== Using SIP RTP CoS mark 5
> Channel SIP/twilio-0000006e was answered
-- Executing [100@makeCall:1] Answer("SIP/twilio-0000006e", "") in new stack
-- Executing [100@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@makeCall:3] AGI("SIP/twilio-0000006e", "agi://127.0.0.1/playmessage,45") in new stack
-- Playing '/var/nam/data/outgoing/60' (escape_digits=#) (sample_offset 0)
> 0x7f2179cf7990 -- Probation passed - setting RTP source address to 54.172.61.251:18920
-- Playing '/var/nam/data/tts/9eccb3f2ed77972157becdfbbac7232c' (escape_digits=1#) (sample_offset 0)
-- <SIP/twilio-0000006e>AGI Script agi://127.0.0.1/playmessage completed, returning 4
== Spawn extension (makeCall, 100, 3) exited non-zero on 'SIP/twilio-0000006e'
Even if I add in the AMD() it will always detect everything as a machine, and still won't really listen for silence. Is there something wrong in my configuration that Asterisk doesn't know what silence is?
Or am I misunderstanding how to be waiting for silence to start playing a message?