How to detect voicemail on outbound calls

This question originally came up in our Slack community and the thread has been consolidated here for long-term reference.

I’m using self-hosted LiveKit for outbound calls, but when the call goes to voicemail, the agent treats it as if the customer is speaking.

How can I detect voicemail?

You can use function tools to detect voicemail. See the documentation:

Additionally, you can add a detection tool that recognizes specific words commonly found in voicemail greetings (like “leave a message after the beep”) and then shut down the room appropriately.