> For the complete documentation index, see [llms.txt](https://docs.plumvoice.com/fuse/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.plumvoice.com/fuse/outbound/detecting-voicemail.md).

# Detecting Voicemail

## Callee Type Detection

When placing outbound calls, it is often necessary to alter the call flow based on the type of callee you have reached. For example you may wish to play a specific message in the case of an answering machine or proceed with the interactive call flow when you reach a person.

Fuse includes support for callee type detection through the global variable `session.connection.callee_type`.

The platform automatically updates this variable over the course of the first 4 seconds of the call. \
Initially the variable will contain the value “*processing*”, and after 4 seconds it will be updated to be one of the following values:

1. **voice**
2. **answeringmachine**
3. **fax**
4. **unknown**

The recommended approach for using this variable is to play an initial prompt that is at least 4 seconds long and then use the [*Compare Variable*](/fuse/call-flow/compare-variable.md) (<img src="/files/-M4u9_-yddKq0elF-SOr" alt="" data-size="line">) module to branch on the different values that *`session.connection.callee_type`*.

Here is an example of a module branching on the `session.connection.callee_type` value:

<div align="left"><img src="/files/-M4u9_-CRZvKZe1zCU-S" alt=""></div>

### **Detecting Voicemail Call Flow Example**

While it is highly accurate, `session.connection.callee_type` is attempting to analyze potentially non-standard voicemail and answering machine behaviors, therefore, its performance is not guaranteed. It can and will have issues with certain types of voicemail or ring back behaviors that will lead to false positives/false negatives.

The best practice is for the initial prompt request the callee to press a button to accept the call, which guarantees that the call was connected to a person rather than a machine.

Consider the following example:

<div align="left"><img src="/files/-M4u9_-FImhETFK7UYUz" alt=""></div>

|                       | Person answers with DTMF                                                                                                                                                                             | Person answers by voice                                                                                                                                                                                              | Answering Machine                                                                                                                                         |
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Call scenario**     | **Callee presses any key**                                                                                                                                                                           | **Callee answers by voice (such as&#x20;*****hi*****,&#x20;*****hello*****) but&#x20;*****not*****&#x20;by touch tone key**                                                                                          | **The call is directed to the answering machine**                                                                                                         |
| *welcome*             | The [record](/fuse/input/record.md) module is used to see if the callee respond to the welcome prompt, Any touch tone input on the will then end the record module and continue onto the next module | The record module is terminated by the [final silence](/fuse/module-settings.md#final-silence) setting in the record module                                                                                          | The record module is terminated by the [final silence](/fuse/module-settings.md#final-silence) setting in the record module                               |
| *check\_response*     | The *welcome$.termchar* value in the module will indicate that the recording is indeed terminated by a touch tone                                                                                    | Since the recording ended by silence, *welcome$.termchar* is *false* and the application will branch to the right                                                                                                    | Since the recording ended by silence, *welcome$.termchar* is *false* and the application will branch to the right                                         |
| *check\_callee\_type* |                                                                                                                                                                                                      | Because there was a response from the caller within the first 4 seconds of the call, the platform will evaluate *session.connection.callee\_type* as “*voice*” and therefore direct the application back to the left | If the answering message is continuous throughout the first 4 seconds, the platform will evaluate *session.connection.callee\_type* as “answeringmachine” |
| **Resulting Module**  | *welcome\_call\_flow*                                                                                                                                                                                | *welcome\_call\_flow*                                                                                                                                                                                                | *leave\_voicemail*                                                                                                                                        |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.plumvoice.com/fuse/outbound/detecting-voicemail.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
