# Handle voicemail

Configure your AI agent to detect and handle voicemails automatically

It is common that your phone agent will encounter voicemails. You can configure your agent to either hang up or leave a message when it detects a voicemail.

The system internally run voicemail detection continuously (within the timeout), and if you select to hang up in voicemail, we will do that the moment we detect we are in voicemail. If you select to leave a message, the system will wait for its turn to speak to leave that message. If the voicemail detection timeout is reached, the system will stop the voicemail detection, and will continue with the call as normal.

1

<figure><img src="https://project-44.gitbook.io/~gitbook/image?url=https%3A%2F%2Fmintlify.s3.us-west-1.amazonaws.com%2Fretellai%2Fimages%2Fvoicemail.png&#x26;width=300&#x26;dpr=4&#x26;quality=100&#x26;sign=f704f040&#x26;sv=2" alt=""><figcaption></figcaption></figure>

Enable Voicemail Detection

Navigate to your agent settings and enable “Voicemail Detection”

2

Choose Voicemail Behavior

Select one of two options:

* **Hang up**: The agent will disconnect when it detects a voicemail
* **Leave a message**: The agent will play a pre-recorded message after it’s agent’s turn to speak

3

Configure Detection Duration

Set the “Voicemail Detection Duration” timeout. This is the time where you will have the voicemail detection to be active for after the call is connected. With more minutes into the call, the chance you hit a voicemail is lower and you might want to turn the voicemail detection off to avoid false positives, and that’s why there’s a timeout setting here. This timeout will not cause your agent’s voicemail message to be cut off.

We recommend starting with 30 seconds, and extend this time if you reach voicemail in a later time in the call or the recorded message in that voicemail is long.

4

Set Voicemail Message (Optional)

If you selected “Leave a message” in Step 2: Enter the message you want the agent to leave. You can either set a prompt so that the message will be generated dynamically, or you can set a fixed static message.
