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: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
Setvoicemail_detection on the agent config with a VoicemailDetectionConfig.
| Field | Type | Default | Description |
|---|---|---|---|
beep_detection_threshold | number | required | Confidence threshold (0.0–1.0) for the background beep model. Values above 0.95 give better results. |
beep_detection_timeout | integer | required | Maximum seconds to run background beep detection. Must be greater than 0. |
tool_call_overrides | object | null | Overrides for the LLM voicemail tool. See below. |
play_message | object | null | Message 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.
| Field | Type | Default | Description |
|---|---|---|---|
name | string | voicemail_detected | Function name the LLM invokes. |
description | string | whenever you hear 'you have reached a voicemail' | When the model should call the tool. |
beep_detection_threshold | number | 0.9 | Confidence threshold for the beep that follows the voicemail voice prompt. |
beep_detection_timeout | integer | 10 | Maximum seconds to wait for the beep after the voicemail voice prompt. |
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.
| Field | Type | Default | Description |
|---|---|---|---|
message | string | required | The message text or instructions. Supports template variables. |
generate | boolean | false | Whether to generate the message with the LLM instead of speaking it verbatim. |
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
| Goal | Configuration |
|---|---|
| Hang up silently on voicemail | Omit play_message |
| Leave a fixed scripted message | Set play_message.message, leave generate as false |
| Leave a contextual, LLM-generated message | Set play_message.message to instructions, set generate to true |
Example
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
Reducing false positives
Reducing false positives
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.Catching slow voicemail systems
Catching slow voicemail systems
Increase
beep_detection_timeout so the beep model keeps listening long enough for systems with a longer greeting before the beep.Tuning when the LLM flags voicemail
Tuning when the LLM flags voicemail
Adjust
tool_call_overrides.description to match the greeting phrasing you expect, so the model calls the voicemail tool at the right moment.Related
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.

