AMDY BLOG · ENGINEERING

Voicemail detection for AI voice agents: why your agent talks to machines, and the fix

AI voice agent voicemail detection: why outbound bots talk to greetings and screening assistants, what it costs, and how to hold the first line for a verdict.

In short: Voice agents answer whatever speaks first, including voicemail; an audio verdict before the agent’s first line lets you route people, machines and screening assistants differently.

If you have shipped an outbound AI agent, you have probably heard this recording: the agent opens with a friendly line, the other end says “Hi, you’ve reached Dana, I can’t get to the phone right now”, and the agent replies to it. Then it keeps going, politely pitching a greeting until the beep cuts it off mid-sentence. AI voice agent voicemail detection is the step that prevents this: a decision, made in the first seconds after the call is answered, about whether a person or a machine is on the line, so the agent knows whether to speak at all.

This guide is for teams building outbound agents on Twilio, Telnyx, LiveKit, Pipecat, Vapi, Retell or their own SIP stack. It covers why agents end up talking to machines, what that really costs, the three common ways to detect voicemail, and a call flow that keeps the agent quiet until it knows who answered.

Why your agent keeps talking to machines

A voice agent is built to take turns. Voice activity detection hears speech, speech-to-text turns it into words, the language model writes a reply and text-to-speech says it. That loop is exactly what you want with a person. The trouble is that a voicemail greeting is also speech, and the loop has no idea it is listening to a recording.

Many pipelines also start the agent’s first line either the moment the call is answered or the moment the first speech is detected. Neither event tells you anything about who answered. On a typical outbound list, a large share of answered calls are not people at all:

Personal greetings are the hardest case for a language-driven agent. The first words of “Hi, it’s Sam…” are the same words Sam would say live, in the same voice. The clue — “…leave a message after the tone” — arrives several seconds later, long after the agent has started talking.

Screening assistants are worse in a different way. They ask a short question and then wait in silence for an answer, which is the perfect turn for an LLM. The agent answers the question with its full opener, and the person reads a transcript of a sales pitch on their lock screen.

What talking to machines costs you

It is tempting to treat voicemail as harmless: the call ends, nobody was hurt. In practice it costs money, data quality and goodwill.

A rough sense of scale helps. The figures below are an illustration with assumed inputs, not measurements — put in your own volumes and per-minute costs.

That number leaves out the transcripts you have to filter, the callbacks your team handles and the numbers that pick up spam labels. We cover the reputation side in dead air, silent calls and “Spam Likely”.

Three ways to detect voicemail

1. The carrier’s or CPaaS platform’s AMD

If your calls are placed through a CPaaS API, the platform probably offers answering machine detection as a call option. Here is how two of them describe it in their own documentation, as of November 2026 — check their current docs before you build on these details.

Twilio. Outbound calls take a MachineDetection parameter. With Enable, Twilio reports who answered as soon as it decides, with AnsweredBy values such as human, machine_start, fax or unknown. With DetectMessageEnd, a machine result waits for the end of the greeting (usually the beep), which is meant for leaving a message. MachineDetectionTimeout defaults to 30 seconds. Asynchronous AMD lets the call carry on while detection runs; Twilio notes it uses one of the forked audio streams allowed per call, a limit shared with Media Streams, which matters if your agent already streams audio out. Twilio’s US price list shows answering machine detection at $0.0075 per call.

Telnyx. Calls placed through its Voice API take an answering_machine_detection setting with modes including detect, detect_beep, greeting_end and premium, which Telnyx describes as using speech recognition and machine learning, plus a premium mode with iPhone call screening support. Premium results include human_residence, human_business, machine, silence, fax_detected and not_sure, with a default analysis time limit of 30 seconds. Telnyx’s December 2022 price notice set standard AMD at $0.0020 and premium at $0.0065 per invocation, and its Voice API pricing page still lists both rates (per call) in November 2026.

The appeal is obvious: one parameter, no extra service. The limits are just as clear. Detection only exists on calls that platform carries, so an agent on LiveKit or Pipecat with its own SIP trunk can’t use it, and switching carriers means rebuilding the logic. The result usually arrives as a webhook, separate from your agent pipeline, so you have to wire the two together yourself. Neither vendor publishes a typical decision time; measure it on your own calls (Twilio reports a MachineDetectionDuration you can log).

2. Asking the LLM to work it out from the transcript

The quickest fix most teams try is a line in the system prompt: “If you reach voicemail, call the end_call tool.” It catches some greetings, and it costs nothing to add. As the main detector, though, it has structural problems:

Keep it anyway, as a second line of defence. If a greeting ever slips past your main detector, an end-of-call instruction lets the agent stop politely instead of finishing its script.

3. A dedicated audio verdict before the agent speaks

The third option listens to how the answer sounds, not what it says. A live pickup has breath, room noise and the uneven start of someone who just lifted a phone; a recording has the even level and clean edges of audio played back. Fixed tones and silence can be recognised directly. Because it works on the audio itself, it doesn’t depend on which carrier delivered the call or which framework runs the agent.

That is what AMDY does. You stream the first seconds of the answered call over a WebSocket and get one verdict back, usually about 2 seconds after answer and up to 3.2 seconds for unclear calls. On 400 hand-labelled calls, AMDY sent 94.9% of live people through, and 88% of the calls it passed on were people. Call screening assistants come back as their own SCREENING verdict instead of being folded into human or machine.

The design: hold the agent’s first line until the verdict

The idea is simple. Start everything at answer, but let nothing play until you know who answered.

In pseudo-code, using the request and reply shape from our API docs — the key in an X-API-Key header, one JSON config frame, then binary audio until a JSON verdict arrives:

pseudo-code
# Pseudo-code: gate the agent's first line on the AMD verdict
on_call_answered(call):
    agent = start_agent(call, muted=True)      # STT, LLM context and TTS opener warm, nothing plays
    ws = websocket_connect(AMDY_ENDPOINT, headers={"X-API-Key": API_KEY})
    ws.send_text(json({"call_id": call.id, "sample_rate": 8000}))

    status = None
    deadline = now() + 4.0                     # a little above the 3.2 s maximum
    for frame in call.inbound_pcm_8k():        # 8 kHz, 16-bit, mono PCM frames
        ws.send_bytes(frame)
        reply = ws.receive()                   # empty while the server is still listening
        if reply:
            status = parse_json(reply)["status"]
            break
        if now() > deadline:
            break
    ws.close()
    route(call, agent, status)
pseudo-code
route(call, agent, status):
    if status == "HUMAN":
        agent.unmute()
        agent.play_opener()                    # pre-rendered, so no extra delay
    elif status == "SCREENING":
        agent.say("Hi, this is Alex from Northwind Dental about your appointment.")
        agent.listen()                         # the person may pick up
    elif status == "MACHINE":
        voicemail_policy(call)                 # hang up, or a short message after the beep
    elif status in ("TONE", "SILENCE"):
        call.hangup()
        log_and_schedule_retry(call)
    else:                                      # FALLBACK, or no verdict before the deadline
        fallback_policy(call, agent)           # your platform's AMD, or a short opener + LLM guard

What each verdict should trigger

Making the wait feel natural

Two seconds of quiet after someone says “hello” is noticeable, so design around it. A person who hears nothing will usually say “hello?” again, which is fine — the agent can start straight over it if the opener is already rendered. What you must avoid is adding more delay on top: no LLM round trip before the first word, no TTS request after the verdict, no long opener.

Keep the first line short and specific, ideally one that confirms who you reached: “Hi, is this Dana? It’s Alex from Northwind Dental.” If your calls are telemarketing, check how the wait fits abandoned-call rules such as the two-second window in the US Telemarketing Sales Rule; we summarise them in abandoned-call rules and AMD.

If you do leave a voicemail

When your policy is to leave a message, wait for the beep instead of talking over the greeting. The verdict tells you a machine answered, not when the greeting ends, so use beep detection from your platform where it exists or a tone check of your own. Then keep it to two sentences: who is calling, why, and how to call back. Skip the pitch.

Remember that a message in an AI voice is an artificial-voice message in the eyes of US regulators, so the consent and identification rules for prerecorded messages apply. Other countries have their own rules. Check them with your counsel before you switch voicemail drops on.

Measuring whether it works

FAQ

Can’t the LLM just detect voicemail on its own?

Sometimes, but late. It can only judge words it has already heard, and personal greetings sound like people until their last few words. Use it as a backup, not as the gate.

How long does the agent wait before it speaks?

With AMDY, about 2 seconds after answer for most calls and up to 3.2 seconds for unclear ones. Pre-render the opener so it plays the moment the verdict arrives.

Does this work if my calls don’t go through Twilio or Telnyx?

Yes. An audio verdict only needs the caller’s side of the call as 8 kHz PCM, so it works with LiveKit, Pipecat, a hosted agent platform that lets you fork audio, or your own SIP stack.

What should the agent say to a call screening assistant?

One sentence with its name, company and the reason for the call, then silence. The person reads it as a transcript and decides whether to pick up. Read more in call screening assistants and AMD.

What happens if the detector can’t be reached?

You get a FALLBACK verdict before any audio is used, and the call isn’t billed. Decide in advance what the agent does then: use your platform’s own AMD, or play a short opener and let the LLM guard end the call if it hears a greeting.

Next steps

Every AMDY account includes 30,000 free trial detections — enough to gate one agent campaign and compare it with your current setup. Start with the API docs, or see how AMDY compares with Twilio AMD and Telnyx AMD.

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