Voicemail detection
# support
s
Call ID : f20d8a35-58a2-4b57-9d5d-6e2c4c37e693 So this call landed in the voicemail, and I have voicemail detection on How can I make the assistant hang up the call when it hit voicemail?
v
Hi there! 👋 I'm unable to provide specific information about the call ID you mentioned, but I can definitely help with configuring your Vapi assistant to hang up when it detects voicemail. Here are several approaches you can use to make your Vapi assistant hang up when it hits voicemail: ## 1. Configure Voicemail Detection Settings First, ensure your voicemail detection is properly configured:
Copy code
json
"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:
Copy code
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:
Copy code
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 Call
You can programmatically end a call by sending an
end-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)
k
Thank you for reaching out to us. We've received your message and will get back to you as soon as possible.
Hi, checking if this is resolved/solved for you?
s
@Shubham Bajaj
Not resolved
k
Hey Simon, could you please update your voicemail config to the following values in this documentation as it requires other types as well?
3 Views