# Voicemail detection (/docs/dashboard-guides/voicemail)

> Recognize an answering machine on outbound calls, leave your message once, and end the call instead of pitching to a recording.

Many outbound calls are answered by a machine, not a person. Without
detection, your agent gives its whole opening to the voicemail greeting, waits
for replies that never come, and the call runs until the mailbox cuts it off.
The minutes are spent and nobody hears the pitch.

With voicemail detection on, the agent recognizes the greeting, stops talking,
leaves the message you wrote, and hangs up.

## What it changes [#what-it-changes]

Take a call that reaches a mailbox. The greeting plays first either way.
Without detection, the agent then talks to the recording until the mailbox
cuts it off, about 46 seconds in this example. With detection, your message is
left and the call ends at about 13 seconds. That is **about 70% less time** on
every voicemail.

  <svg viewBox="0 0 640 124" role="img" aria-label="An example voicemail call, without and with detection. Both start with the mailbox greeting. Without detection the agent then keeps talking to the recording until about 46 seconds. With detection it leaves your message and the call ends at about 13 seconds.">
    <text x="0" y="18" fontSize="13" fill="currentColor">Without detection</text>
    <rect x="0" y="28" width="108" height="26" rx="4" fill="currentColor" opacity="0.35" />
    <text x="10" y="46" fontSize="12" fill="currentColor">Greeting</text>
    <rect x="110" y="28" width="442" height="26" rx="4" fill="currentColor" opacity="0.12" />
    <text x="120" y="46" fontSize="12" fill="currentColor">Agent talks to the recording</text>
    <text x="562" y="46" fontSize="13" fill="currentColor">~46 s</text>
    <text x="0" y="88" fontSize="13" fill="currentColor">With detection</text>
    <rect x="0" y="98" width="108" height="26" rx="4" fill="currentColor" opacity="0.35" />
    <text x="10" y="116" fontSize="12" fill="currentColor">Greeting</text>
    <rect x="110" y="98" width="46" height="26" rx="4" fill="currentColor" opacity="0.9" />
    <text x="166" y="116" fontSize="13" fill="currentColor">~13 s: message left, call ended</text>
  </svg>
  An example outbound call that reaches voicemail.

| | Without detection | With detection |
|---|---|---|
| What the agent says | Its full opening, to a recording | Nothing more once the greeting is recognized, then your voicemail message |
| How the call ends | When the mailbox or the idle timeout cuts it off | Right after your message. With no message set, at once and in silence |
| Call logs | Looks like an answered call with a one-sided transcript | Marked **Voicemail**, so it is easy to filter and count |
| Campaigns | Counted as completed, so it is not retried | Can be retried later with auto-retry |

## How it decides [#how-it-decides]

The agent listens to what the other end says in the first moments of the call
and decides whether it is a live person or a recorded greeting.

| Sounds like voicemail | Sounds like a live person |
|---|---|
| "Please leave a message after the tone" | "Hello?" |
| "You've reached Sarah. I'm not available right now" | "Who is this?" |
| "Your call has been forwarded to voicemail" | "I'm busy, can you call me later?" |
| "The mailbox is full" or "The number you have dialed" | A short answer such as "Yes", "Haan", or a name |
| A scripted one-way message with no pause for a reply | A question or request aimed at the caller |

It works in any language the agent transcribes. A greeting in Hindi or Spanish
that says the person is unavailable and asks for a message counts as voicemail.

**When in doubt, it treats the call as a live person.** Hanging up on a real
customer is worse than missing one voicemail, so a borderline greeting keeps the
conversation going.

These are not treated as voicemail:

- A recording notice on a live line, such as "This call may be recorded for
  quality and training". It counts as voicemail only if the same greeting also
  asks for a message.
- A call screener that asks for your name so it can connect you. See
  [Call screening detection](/docs/dashboard-guides/call-screening).

## What happens when it detects voicemail [#what-happens-when-it-detects-voicemail]

### The agent stops talking [#the-agent-stops-talking]

Anything it was saying is cut off at once.

### It waits for the greeting to finish [#it-waits-for-the-greeting-to-finish]

The agent waits until the greeting has been quiet for about 2 seconds, so your
message does not talk over it.

### It leaves your message [#it-leaves-your-message]

Your voicemail message is spoken in the agent's own voice. **If you left the
message empty, the agent hangs up without a word**, and the person never
learns who called. See [Writing the voicemail message](#writing-the-voicemail-message).

### The call ends [#the-call-ends]

The call ends as soon as the message finishes. It is logged as **Voicemail**.

## Turning it on [#turning-it-on]

1. Open the agent and go to **Voicemail Handling**.
2. Turn on **Enable Voicemail Detection**.
3. Write a **Voicemail Message**. The field is optional, but an empty one means
   a silent hang-up (see below).
4. Save the agent.

It applies per agent, from the next outbound call.

Voicemail detection is included on selected plans. If you do not see
**Voicemail Handling** on your agent, compare plans on the
[pricing page](https://omnidim.io/pricing).

## Writing the voicemail message [#writing-the-voicemail-message]

If **Voicemail Message** is empty, the agent hangs up the moment it detects
voicemail. The person gets no name, no reason and no callback number, only a
missed call from a number they may not know.

Leave it empty only when you mean to: for example, when you will call the same
person again shortly and do not want to leave several messages.

The message is the only thing the person will hear from you, so make it count:

> Hi Priya, this is Maya from Rivertown Dental about your appointment on
> Friday. Please call us back at 555 0123. Thanks!

- **Say who you are and why you called** in the first sentence.
- **Give one clear next step**: a number to call back, or when you will try
  again.
- **Keep it to two or three sentences.** The call ends as soon as it finishes.
- **Personalize it with variables.** Write `{{name}}` where the name goes.
  It and any other variables you pass with the call are filled in for each
  contact, the same as in the welcome message.

## Where it works [#where-it-works]

| Call | Detection runs |
|---|---|
| Outbound phone calls | Yes |
| Inbound phone calls | No. Someone called you, so a machine is not expected. |
| Web calls | No |
| A call that is being transferred | No. Once a transfer starts, a voicemail verdict is ignored. |

## Afterwards [#afterwards]

**Call logs.** Each detected call shows a **Voicemail** badge. Filter by the
**Voicemail** status in [Call logs](/docs/dashboard-guides/recent-calls) to see
them all, with the greeting in the transcript.

**Analytics.** Voicemail is counted as its own outcome. It is part of your
connect rate (calls completed plus voicemail), separate from no-answer and
busy.

**Campaigns.** In a [bulk call campaign](/docs/bulk-calls/best-practices),
lines that reached voicemail can be retried. With auto-retry on, they are
called again up to your retry limit. You can also include them when you retry
failed lines by hand.

**Post-call actions and webhooks.** By default they run on both completed and
voicemail calls, so your CRM still hears about a voicemail. See
[Post-call actions](/docs/dashboard-guides/post-call).

## Over the API [#over-the-api]

Turn detection on when you
[create](/docs/api-reference/agents/createAgent) or
[update](/docs/api-reference/agents/updateAgent) an agent:

```json
{
  "voicemail": {
    "enabled": true,
    "message": "Hi {{name}}, this is Maya from Rivertown Dental. Please call us back at 555 0123."
  }
}
```

The agent you get back shows the same settings as `voicemail_enabled` and
`voicemail_message`.

Each [call log](/docs/api-reference/calls/getCallLog) tells you what happened:

| Field | Value on a detected voicemail |
|---|---|
| `is_voicemail` | `true` |
| `hangup_source` | `voicemail` |
| `hangup_reason` | `Voicemail detected` |

## Good to know [#good-to-know]

- **One decision per call.** Once the agent decides a call is a live person,
  it does not switch to voicemail later in the same call.
- **It listens to words.** A mailbox that plays only a beep, with no spoken
  greeting, gives it nothing to recognize, and the agent carries on as normal.
- **It works alongside call screening.** If a phone's screener sends your call
  to voicemail, your voicemail message is left there too.