Following this guide you will be able to set up an effective answering-machine detection (AMD) system, using WombatDialer predictive dialer for Asterisk PBX.

In this tutorial we want to run a simple outbound campaign, in which we plan to play a file and wait for the receiver’s acknowledgment by pressing 1. We also want to make sure that in case the receiver has an Answering Machine, we play a specific audio message that will be recorded by the machine.


Setting up AMD

The first thing we need is to set up the Answering Machine Detector in Asterisk; this can be done using the embedded application AMD or a number of external tools. In this tutorial we cover the embedded AMD application.
The first thing we do is to configure the file amd.conf so that it resembles the following:

 initial_silence     =  2500
 greeting     =  1500
 after_greeting_silence   =  300
 total_analysis_time   =  5000
 min_word_length    =  120
 between_words_silence   =  50
 maximum_number_of_words  =  4
 silence_threshold   =  384


These are the default parameters used to detect a machine and they may need some tweaking for your local market and spoken language.

Configuring the extension

We then need to create a special dialplan extension:

 exten => 1,n,Answer
 exten => 1,n,Background(beep)
 exten => 1,n,AMD(${AMD_EXTRA})
 exten => 1,n,NoOp("AMD: ${AMDSTATUS} - ${AMDCAUSE}")
 exten => 1,n,GotoIf($["${AMDSTATUS}" = "MACHINE"]?machine)
 exten => 1,n,Set(TIMEOUT(response)=5)
 exten => 1,n,Playback(/var/lib/asterisk/sounds/custom/${HUMANMSG})
 exten => 1,n,Read(ack,,1)
 exten => 1,n,GotoIf($["${ack}" = "1"]?confirmed)
 exten => 1,n,Hangup
 exten => 1,n(confirmed),UserEvent(CALLSTATUS,Uniqueid:${UNIQUEID},V:OK)
 exten => 1,n,Wait(1)
 exten => 1,n,Hangup
 exten => 1,n(machine),UserEvent(CALLSTATUS,Uniqueid:${UNIQUEID},V:AMD)
 exten => 1,n,WaitForSilence(2500)
 exten => 1,n,Playback(/var/lib/asterisk/sounds/custom/${MACHINEMSG})
 exten => 1,n,UserEvent(CALLSTATUS,Uniqueid:${UNIQUEID},V:AMDALL)
 exten => 1,n,Wait(1)
 exten => 1,n,Hangup


Setting up the End-Point

This extension will be considered an end-point of type PHONE that points to 1@amddetect.


How does it work?

When we answer the call, we play a short beep to make sure that the channel is up, and then we start AMD detection. The call will be blocked until AMD detection is complete; so there is a definite tradeoff between quick and accurate detection.

To make things easier during testing, we print the result of the detection and its cause on the Asterisk console. On the campaign itself, we define two campaign variables that will hold the names of audio files to be played back in either case:

  • HUMANMSG: is the audio file to be played back to humans

  • MACHINEMSG: is the audio file to be played to answering machines Though this is not strictly needed, you can tweak the parameters of the AMD detector by editing the Extra AMD settings on the campaigns; these are passed as parameters to the AMD detector; if blank, defaults are used.

The final status for answered calls will be:

  • TERMINATED: a call that went to a human that did not acknowledge it

  • TERMINATED/OK: a call that went to a human that acknowledged it

  • TERMINATED/AMD: a call that went to AMD but was hung up before the message was played completely

  • TERMINATED/AMDALL: a call that went to AMD and the message was played completely. You can use these call statuses to decide how to reschedule those calls, and to crete new lists or blacklist some specific numbers.

Fax detection works in a very similar way, but it kicks in automatically when enabled on a channel.


Nice work, isn’t it?

Be sure to check out the resources we’ve prepared to help you get the best from WombatDialer, including our weekly updated blog and social media channels.

WombatDialer References:

For more technical information about WombatDialer call center solution please refer to the User Manual.

Visit for a 30 days full featured trial.

Attend our Free Webinars for a live demonstration of WombatDialer.

Permalink - Back to home