detect voicemail
# support
t
Voicemail detection Google or Vapi, disconnecting the call after the first message. Is anyone else also facing the same issue?
v
If your calls are disconnecting after the first message during voicemail detection, try increasing your
machineDetectionTimeout
parameter. A common cause is having this value set too low (e.g., 4 seconds), which doesn't give the system enough time to properly detect voicemail.
Copy code
javascript
// Recommended configuration
voicemailDetection: {
  enabled: true,
  machineDetectionTimeout: 30, // Increase from default
  voicemailDetectionTypes: ["machine_end_beep", "machine_end_silence", "machine_end_other", "unknown"]
}
Sources: - [Discord discussion about machineDetectionTimeout](https://discord.com/channels/1211482211119796234/1342555558984814653) - [Vapi documentation on voicemail detection](https://docs.vapi.ai/phone-calling/voice-mail-detection)
k
it’s due to voicemail detection settings, which you can adjust in the dashboard to either leave a message or stay on the line longer..
t
I have Google as a voicemail detector and i changed "Max Voicemail Message Wait" to 30 now it is not disconnecting but just waiting in silence and not responding to my answers also. call id: 03c304ad-aafb-447e-9163-f5c7d6af3282
k
Looking into it
t
any progress on this?
Guys we need to go live on MOnday any help would be greatly appreciated
s
@tnigam your exact requirements aren't clearly stated. From the conversation, we I see you're having issues with voicemail detection, but several critical points remain unclear: 1. What's your desired behavior when voicemail is detected? - Do they want to leave a message or end the call? - Do they want the assistant to continue conversing after detection? 2. Is the problem that: - You want voicemail detection but it's not working correctly? - You want to avoid voicemail detection entirely? - You want detection but with different handling? 3. What's the expected conversation flow for Your use case? Without these details, it's difficult to determine the exact solution needed. ccing: @Kings_big💫
t
My requirement is I don't want to leave voicemail, but i want to know the call went to voicemail, and in that case I am sending text message to the user. The problem I am facing is that as soon as I enable detect voicemail, now when user pickup the phone after the FirstMessage agent ends the call. So, there is no conversation possible. look at this call id: 64886ee4-7d9b-42cb-8851-1fb632384102 I did pick up the phone
This is really critical for us to go live today
s
@tnigam Apologies for the delay looking into it
Your case is a bit unique according to the required call experiences. If it is a voicemail, it can optionally leave a message and then end the call.
@tnigam You can use assistant.hooks to send an SMS when voicemail is detected. Although there isn't a dedicated voicemail event in the ASSISTANT_HOOK_EVENT constants, you can use the "call.ending" event with a filter for when the call ends due to voicemail detection. Here's the assistant.hooks JSON schema you would need:
Copy code
json
{
  "hooks": [
    {
      "on": "call.ending",
      "filters": [
        {
          "type": "oneOf",
          "key": "call.endedReason",
          "oneOf": ["voicemail"]
        }
      ],
      "do": [
        {
          "type": "sms",
          "function": {
            "name": "sendSMS",
            "parameters": {
              "to": "{{customerNumber}}",
              "body": "I tried to reach you but got your voicemail. Please call back when you're available."
            }
          },
          "metadata": {
            "from": "+1234567890"  // Replace with your SMS-enabled phone number
          }
        }
      ]
    }
  ]
}
The system works as follows: 1. When a call goes to voicemail, the voicemail detection system identifies it 2. The LiveCallManager ends the call with an endedReason of "voicemail" 3. This triggers the "call.ending" hook with the appropriate filter 4. The SMS function is then called with the provided parameters You'll need to: 1. Ensure you have a valid "from" phone number that's provisioned for SMS in your Vapi account 2. Customize the SMS message as needed 3. Make sure your voicemail detection is properly configured This approach matches your requirement of detecting voicemail and sending an SMS without leaving a voicemail message.
5 Views