Voicemail Detection
# support
m
Hello! I have 2 calls 42abe164-a5a4-461a-98f2-221123bb3345 and a37f1eaf-7515-44d0-874a-2733172d0a9e They both have the same configuration to detect voicemail. The first one 42a... I denied the call so I assumed it should have gone to voicemail but it just said twilio connection failed. The second call a37.. I let it ring until it reached voicemail, in that case it left a voicemail. How can I make sure that it also leaves a voicemail when the person denies the call? Here's my config: finalAiConfig.voicemail_detection || { provider: "twilio", voicemailDetectionTypes: [ "machine_start", "machine_end_beep", "unknown" ], enabled: true, machineDetectionTimeout: 7 } ), voicemailMessage: finalAiConfig.voicemailEnabled === false ? undefined : ( finalAiConfig.voicemail_message || "Hey! Please call me back! Thank you!" ), I also use the VAPI voicemail tool as backup.
v
Hi there! 👋 I see you're having an issue with voicemail detection when a call is denied. While I can't analyze those specific call IDs, I can definitely help with your voicemail configuration to ensure it works properly when calls are denied. ## Why This Is Happening When a call is denied, Twilio treats this differently than when a call rings until voicemail. According to the information I found, Twilio is supposed to send
customer-busy
or
customer-did-not-answer
signals when a call is not answered or hung up, rather than triggering the voicemail detection flow that works when calls ring to voicemail naturally. ## How to Improve Your Configuration Here are some recommendations to improve your setup: ### 1. Increase the machineDetectionTimeout Your current timeout is set to 7 seconds, which may be too short. According to [documentation on voicemail detection](https://docs.vapi.ai/phone-calling/voice-mail-detection), a longer timeout gives the system more time to detect voicemail:
Copy code
javascript
machineDetectionTimeout: 30  // Recommended value between 15-30 seconds
### 2. Ensure All Voicemail Detection Types Are Included Consider adding more detection types to your configuration:
Copy code
javascript
voicemailDetectionTypes: [
  "machine_start",
  "machine_end_beep",
  "machine_end_silence",
  "machine_end_other",
  "unknown"
]
### 3. Optimize Your VAPI Voicemail Tool Configuration Since you're already using the VAPI voicemail tool as backup, make sure it's properly configured. The VAPI tool uses an LLM to listen for typical voicemail greetings in the call's audio transcription. Here's how to ensure it's properly set up:
Copy code
javascript
{
  ...yourExistingSettings,
  voicemailDetection: {
    provider: "twilio",
    voicemailDetectionTypes: [
      "machine_start",
      "machine_end_beep",
      "machine_end_silence",
      "unknown"
    ],
    enabled: true,
    machineDetectionTimeout: 30
  },
  model: {
    tools: [{ type: "voicemail" }]
  }
}
This configuration enables both Twilio's detection and VAPI's built-in voicemail tool simultaneously, which according to the [voicemail detection documentation](https://docs.vapi.ai/phone-calling/voice-mail-detection) can boost your overall detection accuracy: "When one method doesn't catch it, the other might." ### 4. Check for Twilio Connection Issues The "Twilio connection failed" error might indicate underlying connectivity issues. This could be due to: - Twilio not responding within the required timeframe - SIP configuration issues - Account permissions or geographic restrictions Is there anything else you'd like to know about configuring voicemail detection for denied calls? Sources: - [https://docs.vapi.ai/phone-calling/voice-mail-detection](https://docs.vapi.ai/phone-calling/voice-mail-detection) - [https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336407849806462976](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336407849806462976) - [https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1342555558984814653](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1342555558984814653) - [https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1334385998423130174](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1334385998423130174)
k
🔵 03:48:15:263 Call
42abe164-a5a4-461a-98f2-221123bb3345
Waited 300s But Transport Never Connected. This call never connected, you have to check with Twilio team for this.
m
What I've noticed is that if I let it ring it will detect the voicemail but if I reject the call it doesn't go to voicemail. Not sure why?
s
Hey buddy, I was out of office for a couple of days, so couldn't reply to your earlier email. Apologies for it. You were saying is completely right, but the call ID shared. In this case, the call never connected with the Twilio system. Because of this, I cannot make any further comment on your evaluation and interpretation. If you don't pick it, it will be able to identify if it's a voicemail or not. But if you reject the call, that means the call was never answered. Then it shouldn't be going to the voicemail, but in the new phone system, it goes to the voicemail. How Twilio gives its back to us depends on your call ID. If you could share a call ID where on rejection on your phone it places a voicemail but it doesn't reach out the voice mail message, then I can definitely try to play out with your current assistant voicemail config.
9 Views