[asterisk-users] answer machine detection

Michael Collins mcollins at fcnetwork.com
Mon Jan 8 11:07:02 MST 2007


> One thing that is really confusing me at this point: if I want to
leave
> an automated answer machine message, and amd tells me it's a machine,
> how do I know when to start leaving the message ? Some "intros" are
long
> (thanks for calling, me and mine are not here right now, please leave
a
> message after the beep) and some are short "Leave a message".
> 
> Is there a way of waiting in the dialplan for a beep or something like
> that ?

Excellent question.  I've been experimenting with the 'WaitForSilence'
app.  I've not tried to detect a beep since answering machines and
voicemail systems will not be uniform in their beep sounds.

I've used this with reasonably good success:
[lmtc]
; if detect ans machine, come here and leave a msg to call back
exten => s,1,Answer
exten => s,n,Wait(5)
exten => s,n,WaitForSilence(1000,2)
exten => s,n,Playback(Not-right-party-live-Eng)
exten => s,n,Wait(.3)
exten => s,n,SayDigits(${dnum})     ; Supplied by Originate action
exten => s,n,Wait(1)
exten => s,n,Playback(Not-right-party-live-Eng)
exten => s,n,Wait(.3)
exten => s,n,SayDigits(${dnum})     ; Supplied by Originate action
exten => s,n,Wait(1)
exten => s,n,AppendCDRUserField(${cdrdelim}Y)
exten => s,n,Hangup

As soon as I detect AMD, I goto lmtc,s,1.  I wait 5 seconds, then do
wait for silence.  I've experimented with various settings, and I
settled on "wait for two occurrences of 1000ms of silence."  This is a
reasonable balance between having a two second pause at the very
beginning of the message that I leave and accidentally starting my
message playback too early because of silence detected during the target
machine's outbound message.  Sometimes you have a message like, "High
this is so-and-so. <pause> Please leave me a message."  That <pause> can
sometimes trip up your WaitForSilence app if you don't wait long enough
for silence.

In my case, I'm leaving a message that says, "Please call us at <phone
number> and provide reference number <dnum>".  I repeat the message just
in case I started playing it too soon the first time.  Thus far I've had
pretty good success.  YMMV, so tinker with the WaitForSilence settings.
If you're okay with a two second pause at the beginning of the message
that you leave on the target answering machine then these settings will
probably work for you.

Let us know how it goes.

-MC


More information about the asterisk-users mailing list