Answering Machine Detection (AMD) - Carrier Routing Setup
This method routes your outbound calls through our AMD-enabled SIP trunk so machine/voicemail detection happens on our infrastructure. Everything is configured through Admin > Carriers and Admin > Campaigns - no SSH or server access needed.
If we host your Vicidial server, see Advanced Answer Machine Detection (AMD) instead - it connects to the same detection service through a more direct setup available on servers we manage.
Before you start
You’ll need one prefix you already dial through us today - whatever your
existing outbound route uses. Reuse it below; please don’t create a new one,
since we only recognize prefixes already set up for your account. The steps
below refer to it as <YOUR_PREFIX> - substitute your actual prefix
wherever you see that.
You’ll also need a new, unused extension tag for this route. This guide uses
8380 throughout - if you use a different tag, swap it in consistently
everywhere below, including ${EXTEN:4} (the number must match your tag’s
digit count).
Step 1 - Add our AMD server as a carrier peer
In Admin > Carriers, open the carrier record you use for outbound dialing through us, and add this to Account Entry:
[AMD]
context=trunkinbound
type=friend
host=216.128.159.184
insecure=port,invite
disallow=all
allow=ulaw
allow=alaw
nat=force_rport,comedia
qualify=yes
canreinvite=no
sendrpid=yes
dtmfmode=auto
trustrpid=yesStep 2 - Add the dialplan routes
On the same carrier record, add this to Dialplan Entry (replace
<YOUR_PREFIX> with your prefix from above):
exten => _8380.,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _8380.,n,Dial(SIP/AMD/<YOUR_PREFIX>${EXTEN:4},60,tTor)
exten => _8380.,n,Hangup
exten => 8380,1,AGI(agi://127.0.0.1:4577/call_log)
exten => 8380,n,Set(CURLOPT(conntimeout)=1)
exten => 8380,n,Set(CURLOPT(httptimeout)=1)
exten => 8380,n,Set(AMDSTATUS=${CURL(https://s5a5f22ucufciuffkravxbyfwi0yoacw.lambda-url.us-east-1.on.aws/?call_id=${URIENCODE(${SIPCALLID})}&key=<key>)})
exten => 8380,n,GotoIf($["${AMDSTATUS}" = "MACHINE"]?ismachine:continue)
exten => 8380,n(ismachine),Set(AMDCAUSE=${AMDSTATUS})
exten => 8380,n,Set(CALLERID(name)=${CONNECTEDLINE(name)})
exten => 8380,n,AGI(VD_amd.agi,${EXTEN})
exten => 8380,n(continue),AGI(agi-VDAD_ALL_outbound.agi,NORMAL-----LB-----${CONNECTEDLINE(name)})
exten => 8380,n,Hangup()Save the carrier record - Vicidial regenerates its dialplan automatically, usually within a minute.
Step 3 - Point a campaign at it
Open the campaign under Dialing Options and set both of the following
to 8380:
- The dial prefix field (places the outbound call)
- Routing Extension (handles the call once answered)
These are two separate settings that happen to share a value here - exact field naming can vary slightly by Vicidial version. Start with one test campaign before rolling this out broadly.
Step 4 - Test it
Place a test call you know will reach a voicemail/machine, then check
Reports > Call Detail Report. It should disposition as AA (Answering
Machine) rather than NA.
If it comes back NA or blank, that’s usually a timing issue, not a
dialplan problem - detection and disposition happen as a round trip across
our infrastructure. Send us the approximate call time and we’ll check on
our end.
Notes
- Please don’t modify the dialplan lines above - if something looks wrong, send us the call time and we’ll investigate.
CALLERID(name)is deliberately overwritten right before the machine-detection step - that’s required for correct lead lookup, not a bug.