Skip to content
ViciDial AI ViciDial AI ViciDial AI

The VICIdial Community Blog

ViciDial AI ViciDial AI ViciDial AI

The VICIdial Community Blog

  • Home
  • Vicidial Hosting
  • Home
  • Vicidial Hosting
Close

Search

  • Home
  • Vicidial Hosting
Subscribe
AI IntegrationVICIdial

AI Answering Machine Detection for VICIdial: Integrating VM Hunter

By watanabe
June 17, 2025 6 Min Read
0

Ask a room of Vicidial operators what they would fix first and answering machine detection comes up before anything else. It is the part of the stack that has aged worst, and unlike most complaints about Vicidial, this one is not a configuration problem you can tune your way out of.

What amd.conf Actually Measures

Asterisk’s app_amd measures silence and speech duration. That is the entire mechanism.

[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

It listens for a few seconds, counts utterances separated by silence, and applies a rule: a short utterance followed by silence is a human saying “hello”; a longer continuous one is a voicemail greeting.

That rule made sense when voicemail greetings were uniformly long and people answered uniformly briefly. Neither holds now.

  • Someone who answers “Hello? Hello, who’s calling please?” blows past maximum_number_of_words and is classified as a machine. You just dropped a live prospect.
  • Modern carrier voicemail greetings can be under two seconds. They pass as human, and an agent gets connected to a beep.
  • Mobile network greetings, ringback variations and IVR menus all confuse it.
  • Background noise shifts the silence threshold readings.

Real-world accuracy sits around 70–80%. Every false positive is a lead you paid for and threw away. Every false negative burns 20 seconds of agent time.

Tuning trades one error for the other. Tighten greeting and you catch more machines while dropping more humans. There is no setting that fixes both, because the signal being measured does not contain enough information to separate the cases.

What Changes With a Speech Model

A speech model transcribes and classifies the content, not the timing.

“Hi, you’ve reached the voicemail of” is unambiguous as language. So is “please leave a message after the tone.” A model also learns the acoustic fingerprints of carrier voicemail systems, which are highly consistent per network, and can recognise a beep tone or a special information tone directly.

The constraint is latency. You need a decision within a fraction of a second of answer, or the pause becomes obvious to a live human and you have solved one problem by creating another.

VM Hunter

VM Hunter is a hosted AI answering machine detection service built for outbound dialers, and it integrates with Vicidial directly rather than requiring you to build a pipeline yourself.

It runs on their SpeechLLM model and streams call audio over a WebSocket for real-time classification. Their published figures are 99.7% detection accuracy, sub-50ms response time, 10,000+ concurrent calls and coverage across 50+ languages, with SOC 2 Type II compliance on the infrastructure side.

Treat those as vendor figures until you have measured them on your own traffic — that applies to any AMD vendor, and I will come back to how to measure properly. But the architecture is sound and the Vicidial integration is genuinely straightforward.

There is a free tier for evaluation, which is the sensible way to start. Details are on their pricing page.

Integration

The integration uses EAGI — AGI with the channel audio available on file descriptor 3 — so the script reads live audio rather than waiting for a recording.

Install the dependencies

On a ViciBox server:

zypper in -y python3-pip
pip install --upgrade pip
pip install websocket-client

On a CentOS, AlmaLinux or Rocky scratch install, substitute dnf install -y python3-pip.

Install the AGI script

Download the bundle from your VM Hunter dashboard and extract it into the Asterisk AGI directory:

wget -N -O vmhunter.tar.gz https://app.vmhunter.com/vmhunter.tar.gz
tar zxvf vmhunter.tar.gz --directory /var/lib/asterisk/agi-bin
chmod +x /var/lib/asterisk/agi-bin/vmhunter.agi.py
chown asterisk:asterisk /var/lib/asterisk/agi-bin/vmhunter.agi.py

Set ownership as well as the executable bit. An AGI script Asterisk cannot read fails silently in a way that looks like a network problem.

Set the API key

The script reads your key from the environment:

echo 'AMD_WS_API_KEY="your_api_key_here"' >> /etc/environment

Asterisk must be restarted, not just reloaded, to pick up a new environment variable:

systemctl restart asterisk

Verify it is visible to the running process:

tr '\0' '\n' < /proc/$(pgrep -o asterisk)/environ | grep AMD_WS

If nothing comes back, the variable is not in Asterisk’s environment and every call will return FAILED. On systemd installs you may need to set it in the unit file instead, via a drop-in with Environment= or EnvironmentFile=.

Dialplan

Add the routing extension:

exten => 8370,1,AGI(agi://127.0.0.1:4577/call_log)
exten => 8370,n,Playback(sip-silence)
exten => 8370,n,EAGI(/var/lib/asterisk/agi-bin/vmhunter.agi.py,${VID})
exten => 8370,n,NoOp(AMDSTATUS=${AMDSTATUS} AMDCAUSE=${AMDCAUSE})
exten => 8370,n,AGI(VD_amd.agi,${EXTEN})
exten => 8370,n,AGI(agi-VDAD_ALL_outbound.agi,NORMAL-----LB-----${CONNECTEDLINE(name)})
exten => 8370,n,Hangup()

Put this in /etc/asterisk/extensions.conf, not extensions-vicidial.conf — the keepalive script rewrites the latter and your changes will vanish within the minute.

asterisk -rx "dialplan reload"
asterisk -rx "dialplan show 8370@default"

Campaign settings

In Admin → Campaigns → Detail:

SettingValue
AMD Routing Extension8370
AMD TypeAMD
AMD MethodEAGI

Answered calls now route through 8370 and get classified before the agent is connected.

Full details are in the VM Hunter integration docs.

Reading the Results

The script sets two channel variables. AMDSTATUS carries the decision:

StatusMeaning
HUMANLive person — route to an agent
MACHINEVoicemail, answering machine, beep or disconnected number — drop or disposition
CALLGUARDCall screening or spam filter detected. Treated as live by default
FAILEDDetection could not run — authentication, subscription or server error

AMDCAUSE tells you why, which is what makes tuning possible: MACHINE_BEEP, DISCONNECT for a special information tone, MACHINE_STATIC, INITIALSILENCE, MAXWORD, and CALLGUARD_PHRASE.

That DISCONNECT value is quietly useful. A special information tone means the number is dead, and you can disposition it out of the list rather than recycling it for another three attempts.

CALLGUARD is the one worth understanding. Google Call Screen and similar spam filters answer with a synthetic voice asking who is calling. Classical AMD reads that as a voicemail greeting and drops it, so the call is lost. Treating it as a live person gives you the chance to respond.

Handle FAILED Deliberately

Do not let a detection failure decide policy by accident:

exten => 8370,n,NoOp(AMDSTATUS=${AMDSTATUS} AMDCAUSE=${AMDCAUSE})
exten => 8370,n,ExecIf($["${AMDSTATUS}" = "FAILED"]?Set(AMDSTATUS=HUMAN))

The default fail-safe is MACHINE. For most campaigns I would override it to HUMAN. If the classifier is unreachable, connecting to an agent costs 20 seconds when it is wrong; dropping costs the lead. Which you prefer depends on your economics, but make it a decision rather than an inherited default.

Monitor the rate. A rising FAILED count means an expired subscription, an exhausted quota or a connectivity problem, and it will not announce itself.

grep AMDSTATUS=FAILED /var/log/asterisk/messages | wc -l

Measure It On Your Own Traffic

Run both systems in parallel for a week before switching. Keep app_amd making the decision and log what VM Hunter would have decided, then sample recordings and label them by hand.

SELECT amd_status, ai_status, COUNT(*) AS calls
FROM amd_comparison
WHERE call_date > NOW() - INTERVAL 7 DAY
GROUP BY amd_status, ai_status;

The number that matters is the false positive rate — live humans classified as machines. That is the expensive error and the one heuristic AMD gets wrong most often. Compare on that, not on headline accuracy.

Compliance

AMD accuracy has a regulatory dimension. Under US predictive dialling rules, a call dropped because AMD misfired counts toward your abandonment rate. Better detection lowers it directly.

Routing call audio to a third-party service also creates a processor relationship over call content. Check your customer agreements and privacy policy cover it before you go live — VM Hunter’s SOC 2 Type II position helps that conversation, but the obligation to disclose is yours.

Worth Trying

If you are running Vicidial at any volume, the gap between 75% and high-nineties AMD accuracy is the difference between agents talking to people and agents listening to beeps. The free tier makes it cheap to find out what the real number is on your traffic.

Start at vmhunter.com.

Tags:

ai amdamdanswering machine detectionasteriskeagispeechllmvicidialvmhuntervoicemail detection
Author

watanabe

Follow Me
Other Articles
An audio waveform resolving into a grid of text lines, representing speech-to-text conversion.
Previous

Piping VICIdial Call Recordings Into a Speech-to-Text Workflow

No Comment! Be the first one.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

About This Site

Vicidial, Asterisk, GoAutoDial and FreePBX tutorials — with practical guides to AI answering machine detection and AI agent integration.

Search

Recent Posts

  • AI Answering Machine Detection for VICIdial: Integrating VM Hunter
  • Piping VICIdial Call Recordings Into a Speech-to-Text Workflow
  • Fixing ‘Extension s Rejected Because Extension Not Found’ on Inbound Calls
  • Connecting FreePBX to VICIdial Over a SIP Trunk
  • Asterisk Variable Manipulation: Substrings, Math and Caller ID Rewriting

ViciDial AI

Vicidial, Asterisk, GoAutoDial and FreePBX tutorials — with practical guides to AI answering machine detection and AI agent integration.

Recent Posts

  • AI Answering Machine Detection for VICIdial: Integrating VM Hunter
  • Piping VICIdial Call Recordings Into a Speech-to-Text Workflow
  • Fixing ‘Extension s Rejected Because Extension Not Found’ on Inbound Calls
  • Connecting FreePBX to VICIdial Over a SIP Trunk
  • Asterisk Variable Manipulation: Substrings, Math and Caller ID Rewriting

Archives

  • June 2025 (1)
  • April 2024 (1)
  • January 2024 (1)
  • December 2023 (1)
  • October 2023 (1)
  • September 2023 (1)
  • August 2023 (1)
  • June 2023 (1)
  • May 2023 (1)
  • March 2023 (1)
  • February 2023 (1)
  • December 2022 (1)
  • November 2022 (1)
  • October 2022 (1)
  • September 2022 (1)
  • August 2022 (1)
  • July 2022 (1)
  • June 2022 (1)
  • April 2022 (1)
  • March 2022 (1)

Find Us

Contact Us:

email: info@vicidialai.com

Copyright 2026 — ViciDial AI. All rights reserved. | Privacy Policy