DanToy
03/27/2025, 4:00 AMVapi Support Bot
03/27/2025, 4:02 AMjavascript
voicemailDetection: {
provider: "twilio",
voicemailDetectionTypes: [
"machine_start",
"machine_end_beep",
"machine_end_silence",
"unknown",
"machine_end_other"
],
enabled: true,
machineDetectionTimeout: 15
}
3. **Using Call Status API**: Twilio sets a final callStatus
if the remote side never picks up, which can be used to determine if a call was missed.
## Steps to Create a Call Logging Tool
Here's a step-by-step approach to building your missed call logging tool:
1. **Capture Call Events**: Use the [server SDK](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1331285157088333955) to listen for call events when calls are initiated or completed.
2. **Log Events**: Implement logging within your server environment to record call events, including details such as start time, end time, duration, and the assistant involved.Vapi Support Bot
03/27/2025, 4:02 AMGET /api-reference/calls/list
- POST /api-reference/calls/create
- GET /api-reference/calls/get
- DEL /api-reference/calls/delete
- PATCH /api-reference/calls/update
2. **Server URL Events API**: Vapi sends POST requests to a Server URL during and after a call, providing information about call status, end-of-call reports, and hang notifications.
3. **Webhooks for Call Outcome Detection**: Configure webhooks to trigger when a call is not answered, allowing for the detection and logging of missed calls.
4. **End-of-Call Report via Webhook**: Vapi provides an "end-of-call-report" via a webhook after each call, which includes call details that can help identify missed calls.
5. **GET /call/:id Endpoint**: This endpoint can be used to retrieve call transcripts, recordings, and message history, which can help determine if a call was missed.
Would you like more specific details on any particular aspect of creating this missed call logging tool?
Sources:
- [How to detect missed calls programmatically](https://docs.vapi.ai/phone-calling/voice-mail-detection)Vapi Support Bot
03/27/2025, 4:02 AMDanToy
03/27/2025, 4:19 AMVapi Support Bot
03/27/2025, 4:19 AMVapi Support Bot
03/27/2025, 4:19 AMShubham Bajaj
03/27/2025, 11:40 PMDanToy
04/01/2025, 8:14 AMShubham Bajaj
04/02/2025, 2:35 PMDanToy
04/04/2025, 1:54 AMShubham Bajaj
04/06/2025, 12:40 PMDanToy
04/06/2025, 12:50 PMShubham Bajaj
04/07/2025, 1:18 PMendedReason
value of customer-did-not-answer
.
### 1. Set Up a Webhook Server
First, you need to set up a server to handle webhook events from Vapi. Here's a basic example using Express.js:
### 2. Configure Your Vapi Assistant with Server URL
To receive webhook events, you need to configure your Vapi assistant with your server URL:
1. Go to the Vapi dashboard
2. Select or create your assistant
3. In the assistant settings, add your server URL where Vapi will send webhook events
4. Make sure to include the "status-update" event in the "serverMessages" array
json
{
"server": {
"url": "https://your-webhook-server.com/webhook",
"timeoutSeconds": 20
},
"serverMessages": [
"status-update",
"end-of-call-report"
]
}
### 3. Advanced Implementation
### 4. Create a Dashboard for Missed Calls (Optional)
### 5. Deploy Your Webhook Server
For your webhook to be accessible by Vapi, you need to deploy it to a publicly accessible server. You can use services like:
- AWS Lambda with API Gateway
- Heroku
- Vercel
- Google Cloud Functions
- Digital Ocean
Make sure to use HTTPS for security.
## Advanced Features
### 1. Automatic Follow-up Calls
You can extend your system to automatically schedule follow-up calls for missed calls:
javascript
// Inside your handleStatusUpdate function
if (status === 'ended' && endedReason === 'customer-did-not-answer') {
// Log the missed call...
// Schedule a follow-up call for tomorrow
const tomorrow = new Date();
tomorrow.setDate(tomorrow.getDate() + 1);
scheduleFollowUpCall({
customerNumber: customerInfo.number,
scheduledTime: tomorrow,
callId: call.id,
reason: "Follow-up to missed call"
});
}
function scheduleFollowUpCall(callData) {
// Store the scheduled call in your database
// ...
// You could use a job scheduler like node-schedule
// or connect to your CRM to schedule the call
}
### 2. Integration with CRM Systems
You can integrate with CRM systems to update customer records with missed call information:
javascript
// Inside your handleStatusUpdate function
if (status === 'ended' && endedReason === 'customer-did-not-answer') {
// Log the missed call...
// Update CRM
updateCRM({
customerNumber: customerInfo.number,
customerName: customerInfo.name,
event: "missed_call",
timestamp: new Date().toISOString(),
callId: call.id
});
}
function updateCRM(data) {
// Connect to your CRM API
// For example, Salesforce, HubSpot, etc.
// Example for HubSpot
}
## Testing Your Implementation
You can test your webhook implementation by:
1. Using a tool like [ngrok](https://ngrok.com/) to expose your local server to the internet
2. Make an outbound call using the Vapi API to a number that won't answer
3. Verify that your webhook server correctly logs the missed call
By implementing a webhook server that listens for Vapi's status-update
events with the customer-did-not-answer
ended reason, you can build a comprehensive system for logging and managing missed outbound calls. This can be extended with features like automatic follow-ups, CRM integration, and reporting dashboards to help your business better manage customer communication.
I hope this detailed guide helps you implement your missed call logging tool. If you need any specific clarification or have questions about any part of the implementation, please let me know!