tnigam
05/03/2025, 8:03 PMVapi Support Bot
05/03/2025, 8:05 PMmachineDetectionTimeout 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.
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)Kings_big💫
05/03/2025, 9:32 PMtnigam
05/03/2025, 9:54 PMKings_big💫
05/03/2025, 10:20 PMtnigam
05/04/2025, 2:31 AMtnigam
05/04/2025, 6:06 AMShubham Bajaj
05/05/2025, 10:02 AMtnigam
05/05/2025, 3:26 PMtnigam
05/05/2025, 3:54 PMShubham Bajaj
05/06/2025, 3:22 PMShubham Bajaj
05/06/2025, 3:24 PMShubham Bajaj
05/06/2025, 3:48 PMjson
{
"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.