Skip to main content
Voicemail detection lets an agent recognize when an outbound call reaches an answering machine instead of a person, and decide whether to hang up or leave a message. It combines two signals: a beep model that listens for the answering-machine beep, and an LLM tool the model invokes when it hears a voicemail greeting. Voicemail detection runs on outbound telephone calls only. The voicemail tool is added to the agent when the channel is TELEPHONE, the direction is OUTBOUND, and voicemail_detection is set on the agent config. It is never added for inbound calls or for web chat.

How it works

Two independent detectors race to fire a single voicemail action:
Outbound call connects

        ├── Beep model (beep-bot)         listens to call audio on a rolling
        │   anyreach-ai/beep-detector-v2  buffer, scoring recent audio for a beep

        └── LLM voicemail tool            the model calls voicemail_detected
            (voicemail_detected)          when it hears a voicemail greeting


First detector to fire → voicemail action

        ├── play_message set?  → speak the message, then hang up
        └── no play_message    → hang up immediately
The beep model is an ONNX model (anyreach-ai/beep-detector-v2, file beep_detector.onnx) that analyzes the call audio as a mel-spectrogram over a rolling buffer of recent audio. When the model’s confidence for a beep exceeds beep_detection_threshold, the voicemail action fires. The LLM tool path fires independently when the model decides the greeting it hears matches the tool’s description. Whichever path fires first wins. The action only runs once per call.

Configuration

Set voicemail_detection on the agent config with a VoicemailDetectionConfig.
FieldTypeDefaultDescription
beep_detection_thresholdnumberrequiredConfidence threshold (0.01.0) for the background beep model. Values above 0.95 give better results.
beep_detection_timeoutintegerrequiredMaximum seconds to run background beep detection. Must be greater than 0.
tool_call_overridesobjectnullOverrides for the LLM voicemail tool. See below.
play_messageobjectnullMessage to leave when voicemail is detected. Omit to hang up instead.
Setting voicemail_detection only takes effect on outbound telephone calls. On other channels and directions the config is ignored.

Tool call overrides

tool_call_overrides customizes the LLM tool the model calls when it hears a voicemail greeting. When omitted, the defaults below apply.
FieldTypeDefaultDescription
namestringvoicemail_detectedFunction name the LLM invokes.
descriptionstringwhenever you hear 'you have reached a voicemail'When the model should call the tool.
beep_detection_thresholdnumber0.9Confidence threshold for the beep that follows the voicemail voice prompt.
beep_detection_timeoutinteger10Maximum seconds to wait for the beep after the voicemail voice prompt.
The voicemail tool itself takes no arguments. The model calls it purely as a signal that it has heard a voicemail greeting.

Play message

play_message controls what the agent says before hanging up. Hanging up is implicit: with no play_message, the call ends as soon as voicemail is detected.
FieldTypeDefaultDescription
messagestringrequiredThe message text or instructions. Supports template variables.
generatebooleanfalseWhether to generate the message with the LLM instead of speaking it verbatim.
When generate is false, the agent speaks message verbatim. When generate is true, message is treated as instructions and the LLM generates the spoken reply from them. In both cases the agent hangs up once the message finishes playing.

Leave a message vs hang up

GoalConfiguration
Hang up silently on voicemailOmit play_message
Leave a fixed scripted messageSet play_message.message, leave generate as false
Leave a contextual, LLM-generated messageSet play_message.message to instructions, set generate to true

Example

{
  "voicemail_detection": {
    "beep_detection_threshold": 0.97,
    "beep_detection_timeout": 15,
    "play_message": {
      "message": "Hi, this is Anyreach calling about your recent inquiry. Please call us back at your convenience. Thank you.",
      "generate": false
    }
  }
}
This agent listens for a beep with a confidence threshold of 0.97, runs the background beep model for up to 15 seconds, and leaves a fixed message before hanging up when voicemail is detected.

Tuning

Raise beep_detection_threshold toward 1.0. The config description recommends keeping it above 0.95. A higher threshold makes the beep model more conservative, so it is less likely to mistake other sounds for a voicemail beep.
Increase beep_detection_timeout so the beep model keeps listening long enough for systems with a longer greeting before the beep.
Adjust tool_call_overrides.description to match the greeting phrasing you expect, so the model calls the voicemail tool at the right moment.

Abilities and actions

How actions like play-message and hang-up are grouped into tools the model calls.

Outbound and caller ID

Place outbound calls and set the caller ID voicemail detection runs on.

Campaigns overview

Run outbound calls at scale, where voicemail detection matters most.