AMDY BLOG · ENGINEERING

Tuning Asterisk AMD: what every amd.conf setting really does

A field guide to the nine AMD() settings in amd.conf: what each one measures, which error it trades against which, and why tuning moves mistakes around instead of removing them.

In short: Each amd.conf setting is a threshold on timing; changing one always trades fewer of one error for more of the other.

If your dialer runs on Asterisk — and ViciDial, GoAutoDial and many custom dialers do — your answering machine detection is probably the AMD() application, configured in amd.conf or by arguments passed in the dialplan. It’s free, it’s already installed, and it can be tuned. Before you replace it, it’s worth understanding exactly what it measures.

This guide goes through every setting, what it does in plain terms, and which way each change pushes your results.

How AMD() thinks about a call

AMD() listens to the first few seconds after answer and splits the audio into two states: silence and voice. It doesn’t recognise words. A “word”, to AMD(), is simply a stretch of voice that is long enough to count, separated from the next stretch by a short silence.

From those stretches it builds a picture: how long before anyone spoke, how long they spoke for, how many words it heard, and how long the silence after the greeting lasted. Each setting below is a threshold on one of those measurements. Cross a threshold and AMD() stops listening and returns a verdict.

When it finishes it sets two channel variables. AMDSTATUS is HUMAN, MACHINE, NOTSURE or HANGUP. AMDCAUSE says which rule fired — for example MAXWORDS-3-3 or INITIALSILENCE-2500-2500 — which is the most useful debugging information you have.

The nine settings, one by one

Default values come from the sample amd.conf shipped with Asterisk. They can differ between Asterisk versions and distributions, so check the file on your own server before relying on them.

A working example

Here is what the settings look like in amd.conf, and the equivalent arguments passed directly to AMD() in a dialplan. Arguments in the dialplan override the file, which is how many ViciDial installs set per-campaign behaviour.

amd.conf
[general]
initial_silence = 2500
greeting = 1500
after_greeting_silence = 800
total_analysis_time = 5000
min_word_length = 100
between_words_silence = 50
maximum_number_of_words = 3
silence_threshold = 256
maximum_word_length = 5000
extensions.conf
; same values, in argument order:
; initialSilence, greeting, afterGreetingSilence, totalAnalysisTime,
; minimumWordLength, betweenWordsSilence, maximumNumberOfWords,
; silenceThreshold, maximumWordLength
exten => 8369,n,AMD(2500,1500,800,5000,100,50,3,256,5000)
exten => 8369,n,NoOp(AMD: ${AMDSTATUS} / ${AMDCAUSE})

Why tuning moves errors instead of removing them

Look at the table again: almost every row has a cost in both columns. That isn’t a quirk of the defaults — it’s the nature of timing rules. A person who says “Hello? … Hello, who is this?” and a voicemail that says “Hi, it’s Jo, leave a message” can produce almost identical timing. Any threshold that separates them on one call will mix them up on another.

So tuning is really a choice of which mistake you would rather make. Sales floors that pay per lead often loosen the rules to protect live answers and accept more greetings at agents. High-volume floors with tight agent capacity often tighten them and accept that some people will be dropped. Neither setting is wrong; both are trade-offs.

If you tune, change one setting at a time and look at AMDCAUSE before and after. A change that “fixes” MAXWORDS drops can quietly increase LONGGREETING passes.

A tuning routine that actually works

The method in how to test AMD on your own calls applies here too: label a few hundred calls by ear and measure both errors, not a single rate.

When it’s time to stop tuning

If your errors keep swapping places — every fix for dropped people sends more greetings to agents — you’ve reached the limit of what timing can do. That’s the point where an acoustic approach makes sense, because it uses information timing rules never see.

AMDY is designed to sit in front of your existing AMD(), not replace it outright. The AMDY step runs first; if it can’t judge a call, it sets FALLBACK and your tuned AMD() line takes over, so the work you’ve put into amd.conf still has a job.

Next steps

See how the AMDY step fits into an Asterisk dialplan on the Asterisk integration page, or follow the ViciDial setup guide to add it to a copy of your AMD extension.

Back to all articles
READY FOR A BETTER FIRST HELLO?

Better detection starts with one campaign.

Install on ViciDial, Asterisk or FreeSWITCH and compare against your current AMD.

Talk to AMDY