My agent is failing to detect voicemail
# support
c
My Ai agent is not detecting voicemails and is having conversations with voicemails and wasting credit. I have voicemail detection enabled. - also new to this appreciate your assistance anyone
v
Hi there! Sorry to hear you're having trouble with voicemail detection πŸ“ž I understand your AI agent is failing to detect voicemails despite having voicemail detection enabled, which is causing unnecessary conversations and wasting credits. I can definitely help troubleshoot this issue! ## Common Reasons for Voicemail Detection Failure Even when enabled, voicemail detection can fail due to several factors: - **Configuration Issues**: Your voicemail detection settings might need adjustment - **Conflicting Settings**: Some parameters might be conflicting with each other - **Timing Problems**: The system might be jumping in too early during voicemail greetings ## Recommended Configuration Vapi offers two main methods for voicemail detection: 1. **Twilio's Voicemail Detection**: According to the [Vapi documentation](https://docs.vapi.ai/phone-calling/voice-mail-detection), you can configure Twilio's detection with settings like:
Copy code
json
voicemailDetection: {
  provider: "twilio",
  voicemailDetectionTypes: [
    "machine_start",
    "machine_end_beep",
    "machine_end_silence",
    "unknown",
    "machine_end_other"
  ],
  enabled: true,
  machineDetectionTimeout: 15,
  machineDetectionSpeechThreshold: 2500,
  machineDetectionSpeechEndThreshold: 2050,
  machineDetectionSilenceTimeout: 2000
}
2. **VAPI's Built-In Voicemail Tool**: This is an LLM-powered tool that listens for typical voicemail greetings:
Copy code
json
{
  ...yourExistingSettings,
  "model": {
    "tools": [{ type: "voicemail" }]
  }
}
For best results, you can combine both approaches! ## Troubleshooting Steps 1. **Adjust Timeout Values**: If your
machineDetectionTimeout
is too low (e.g., 4 seconds), try increasing it to 15-30 seconds. According to [user discussions](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1342555558984814653), a longer timeout can be more reliable.
2. **Fine-tune Speech Thresholds**: Adjust
machineDetectionSpeechThreshold
and
machineDetectionSpeechEndThreshold
to better detect when machine greetings finish. 3. **Adjust Wait Time**: Set
startSpeakingPlan.waitSeconds
to 0.8 as suggested in [community discussions](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336875140990111796). 4. **Use Custom Endpointing Rules**: Implement custom rules with a delay to fix timing issues:
Copy code
javascript
startSpeakingPlan: {
  customEndpointingRules: [
    {
      type: 'assistant',
      regex: '.*voicemail.*',  // Adjust based on your voicemail message
      delayMs: 3000  // Adds a 3-second delay
    }
  ]
}
5. **Check for Conflicting Settings**: Ensure that
machineDetectionSilenceTimeout
isn't longer than your
silenceTimeoutSeconds
, as this could prevent the agent from hanging up. Is there anything specific about your configuration you'd like me to help with, or would you like more details on any of these troubleshooting steps? Sources: - [Voicemail Detection Methods](https://docs.vapi.ai/phone-calling/voice-mail-detection) - [Discord Thread on Voicemail Detection](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1342555558984814653) - [Discord Thread on Wait Time Settings](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336875140990111796) - [Discord Thread on Custom Endpointing Rules](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336548894896816222)
v
Message marked as helpful by @alampole! πŸŽ‰
s
@Curtis could you share the call ID so I could take a look?
a
Hey I fixed this problem and my Voice Agent worked perfecty fine on my Website. I got say this having a voice agent trained on your Business data is way superior to a chatbot. Thanks to the @Vapi team🫑
s
Marking this ticket as Solved βœ