Simon Digilov
04/05/2025, 12:38 PMVapi Support Bot
04/05/2025, 12:39 PMjson
"voicemailDetection": {
"provider": "twilio",
"voicemailDetectionTypes": [
"machine_start",
"machine_end_beep",
"machine_end_silence",
"unknown",
"machine_end_other"
],
"enabled": true,
"machineDetectionTimeout": 5,
"machineDetectionSpeechThreshold": 2400,
"machineDetectionSpeechEndThreshold": 1000,
"machineDetectionSilenceTimeout": 3000
}
According to the [documentation](https://docs.vapi.ai/phone-calling/voice-mail-detection), lowering the machineDetectionTimeout (e.g., to 5 seconds) will make the system decide faster if it's a voicemail, which can help with hanging up quickly.
## 2. Use the End Call Function
You can configure the assistant to end the call immediately after voicemail is detected by setting:
json
"endCallAfterSpokenEnabled": true
This will end the call as soon as the voicemail message is spoken, according to information found in the [Vapi documentation](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336548894896816222).
## 3. Combine Twilio and Vapi's Built-in Tool
For improved accuracy in voicemail detection, you can enable both Twilio's detection and Vapi's built-in LLM-powered voicemail tool:
json
{
...yourExistingSettings,
"model": {
"tools": [{ "type": "voicemail" }]
}
}
This approach uses an LLM to listen for typical voicemail greetings in the call's audio transcription, as mentioned in the [Vapi documentation](https://docs.vapi.ai/phone-calling/voice-mail-detection).
## 4. Programmatically End the CallVapi Support Bot
04/05/2025, 12:39 PMend-call message type within ClientInboundMessage. Include a message with the type property set to "end-call" when sending inbound messages to the client.
## 5. Check for Potential Conflicts
Make sure there are no conflicts between your timeout settings. If machineDetectionSilenceTimeout is longer than your silenceTimeoutSeconds, it could prevent the agent from hanging up properly.
Is there anything specific about these approaches you'd like me to explain further?
Sources:
- [Voicemail detection in Vapi](https://docs.vapi.ai/phone-calling/voice-mail-detection)
- [Vapi Discord thread about endCallAfterSpokenEnabled](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336548894896816222)
- [Vapi Discord thread about machineDetectionTimeout](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1334385998423130174)
- [Vapi Discord thread about voicemail detection configuration](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1305065394662408192)
- [Vapi Discord thread about silence timeout settings](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1344633027925377064)Vapi
04/06/2025, 11:52 AMVapi
04/06/2025, 11:58 AMSimon Digilov
04/09/2025, 9:31 AMSimon Digilov
04/09/2025, 9:31 AM