Voice Mail Detection
Voicemail is basically a digital answering machine. When you can’t pick up, callers can leave a message so you don’t miss anything important. It’s especially handy if you’re in a meeting, driving, or just can’t get to the phone in time.
The Main Problem
If a lot of your calls are landing in voicemail, you could be spending too much time and money on calls that never connect to a real person. This leads to wasted resources, and sometimes missed business opportunities.
The Solution: Early Voicemail Detection
By detecting voicemail right away, your VAPI Assistant can either hang up (if leaving a message isn’t necessary) or smoothly play a recorded message. This cuts down on useless call time and makes your entire call flow more efficient.
Two Ways to Detect Voicemail
1. Using Twilio’s Voicemail Detection
Twilio has built-in features to detect when a machine picks up. You configure these settings in your VAPI Assistant so it knows when a voicemail system has answered instead of a live person.
- provider: Tells VAPI to use Twilio’s system.
- voicemailDetectionTypes: Defines the events that mean “voicemail.”
- machineDetectionTimeout: How many seconds to wait to confirm a machine.
- The other settings let you fine-tune how quickly or accurately Twilio identifies a machine based on speech or silence.
Quick Reference
2. Using VAPI’s Built-In Voicemail Tool
VAPI also has an LLM-powered tool that listens for typical voicemail greetings or prompts in the call’s audio transcription. If you prefer an approach that relies more on phrasing and context clues, this is a great option.
Here, tools: [{ type: "voicemail" }]
signals that your VAPI Assistant should look for keywords or patterns indicating a voicemail greeting.
Combining Both Approaches
For the best of both worlds, you can enable Twilio’s detection and the built-in voicemail tool at the same time:
When one method doesn’t catch it, the other might—boosting your overall detection accuracy.
Tips for Better Voicemail Handling
-
Adjust Detection Timing
Lower
machineDetectionTimeout
(e.g., to 5 seconds) if you want the system to decide faster. But remember, shorter timeouts can lead to occasional false positives. -
Fine-Tune Speech and Silence Thresholds
For example:
These values tweak how quickly Twilio “listens” for human speech or background silence.
-
Think Through Your Call Flow
- Give It Time: If you’re leaving a message, you might want to increase
startSpeakingPlan.waitSeconds
so the detection has enough time before the tone. - firstMessageMode: Setting it to
assistant-waits-for-user
can also give you smoother call handling—your assistant won’t barge in if someone unexpectedly picks up late
- Give It Time: If you’re leaving a message, you might want to increase
What Happens When a Call Ends?
- Detected Voicemail + No Message: The call will end, and you’ll see a reason like
customer-did-not-answer
. - Detected Voicemail + Have a Message: Your assistant leaves the recorded message, and the call ends with a reason like
voicemail
.
Testing and Next Steps
- Make a Test Call: Dial a known voicemail number and watch how quickly (and accurately) your VAPI Assistant identifies the machine.
- Tweak Settings: Adjust your timeout and threshold values based on real-world performance.
- Repeat: Keep testing until you’re confident your configuration is catching voicemail reliably without cutting off real people.
By following these steps, you’ll save time, improve call-handling efficiency, and ensure your system feels more professional. If you need to fine-tune or add new features later, you can always revisit these settings and make quick adjustments.