Integration

FreeSWITCH AMD that understands the greeting, not just the beep

FreeSWITCH answering machine detection with VM Hunter: a Lua script forks the callee's audio to a speech-based detector and sets AMDSTATUS and AMDCAUSE on the channel, with a drop-in dialplan that routes people, machines and call screening.

FreeSWITCH has no equivalent of Asterisk's app_amd. What it offers is mod_avmd, which detects the voicemail beep, and the older mod_vmd, which does the same with a different method. Both answer the question "has the beep played yet", which is useful for timing a message drop and useless for the question a dialer asks at answer: is this a person?

VM Hunter answers that question from the words. It transcribes the first two seconds, recognises voicemail wording, carrier prompts, IVRs and call screening, and runs tone analysis for beeps, SIT tones and silence. The FreeSWITCH integration is a Lua script and an XML dialplan include.

FreeSWITCH AMD options compared

mod_avmd / mod_vmdVM Hunter
Question answeredHas a voicemail beep played?Is a person on the line right now?
Decides atWhenever the beep arrives, often 10 to 30 s inAbout 2 s after answer
Live personNo verdict; the call simply never beepsHUMAN, usually within 2 s
Voicemail greetingDetected only when the beep playsMACHINE from the wording, before the beep
Carrier prompts, IVR, call screeningNot detectedRecognised and labelled
AuditEvent log onlyTranscript, reason and audio for every call

How the integration works

  • Originate the customer leg to the vmhunter_amd extension, so the script runs the moment the callee answers.
  • The script starts uuid_audio_fork (or uuid_audio_stream) to VM Hunter with the config frame as metadata, and waits for the verdict event.
  • It sets AMDSTATUS, AMDSTATUS_RAW and AMDCAUSE, then the dialplan transfers to vmhunter_route.
  • vmhunter_route sends screened calls to an intro and an agent, people to vmhunter_HUMAN (your queue or bridge) and machines to vmhunter_MACHINE.

Install steps and the originate string are in the FreeSWITCH guide. The script and dialplan are on GitHub under the MIT licence.

Fail-safe behaviour

The script sets a fail-safe verdict before it does anything else, so a call always has a routable AMDSTATUS even if the module is missing, the key is wrong or the server cannot be reached. The default treats a failure as MACHINE; set FAILED_AS to HUMAN if you would rather connect the call than drop it.

FAQ

Questions

Which FreeSWITCH modules does VM Hunter need?

mod_lua, plus either mod_audio_fork (from drachtio) or mod_audio_stream to send the call audio to the WebSocket. The script detects which of the two is loaded.

Can I keep mod_avmd for beep detection?

Yes. VM Hunter already detects beeps, but nothing stops you running mod_avmd alongside it, for example to time a voicemail drop after VM Hunter has said MACHINE.

Which leg does the audio come from?

The script forks the far-end (callee) audio of the leg it runs on. Originate the customer leg to the vmhunter_amd extension so the fork starts at answer and never hears your agent.

How is call screening handled?

The bundled dialplan sends calls labelled CALLGUARD_PHRASE to a short recorded intro and then to your agent queue, so the person behind the screening prompt hears who is calling. Remove that condition if you would rather drop them.

Does it work with a FreeSWITCH-based dialer product?

If the dialer lets you run a Lua script or a dialplan extension on the outbound leg at answer, yes. The script sets channel variables that the rest of the dialplan can read.

Try it on one campaign

The free plan includes 5,000 calls a month, enough to run VM Hunter next to your current AMD for a day and compare the dispositions. No card needed.