how can we create a tool that will log missed call...
# support
d
how can we create a tool that will log missed calls?
v
Hi there! 👋 I'd be happy to help you create a tool that logs missed calls! I can provide you with detailed information on how to build a missed call logging tool, including detection methods, implementation steps, and available APIs. ## How to Detect Missed Calls To create an effective missed call logging tool, you'll first need to implement detection methods. According to the [documentation](https://docs.vapi.ai/phone-calling/voice-mail-detection), there are several approaches: 1. **Call Status Detection**: Configure your AI caller to detect different call outcomes, including "not answered" status. When a call isn't answered, send a payload to a webhook with the appropriate status indicator. 2. **Voicemail Detection**: Vapi supports both model-based and Twilio-based voicemail detection approaches. You can use this to identify when calls go to voicemail rather than being answered by a person. For Twilio-based detection, you can configure:
Copy code
javascript
   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.
3. **Implement Real-Time Analytics**: Develop or integrate a real-time analytics engine to process logs and update call counts in real-time. 4. **Create a Dashboard**: Build a dashboard that connects to your analytics engine and displays call data in real-time. 5. **Store Call Data**: Maintain a database to record call details, including missed calls. 6. **Utilize End-of-Call Reports**: Implement the end-of-call report server event, which provides a reliable way to get both the Call ID and complete transcript. 7. **Classify Call Outcomes**: Segment call outcomes and automate outcome assignment using LLMs to categorize call results, including missed calls. ## APIs for Detecting and Logging Missed Calls You can leverage several APIs for your missed call logging tool: 1. **Vapi API Endpoints**: -
GET /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)
d
Thanks. I will try this out. By chance, Do you have any video tutorials in this subject matter?
v
Message marked as helpful by @DanToy! 🎉
Message marked as helpful by @DanToy! 🎉
s
Hey @DanToy, checking if this is resolved for you.
d
My Apology. I was not clear. The tool that i would like to create in vapi is something that will log all the "no answer" call. Meaning client does not answer our Automated call. Its an outbound call.
s
You can use VAPI status update server event for this and can mark the calls which are not answered by your customer or client or leads and then can take further actions on them. The server event named status update is the right tool to make use of it for your this use case.
d
Thank you for your response. If it is not too much to ask, can you point to me a specific documentation and api reference that demonstrate this. Or a loom video will really be appreciated most. I am a beginner here. 😁 Again, thank you so much.
s
Hi, checking if this is resolved/solved for you?
d
not yet
s
When you make outbound calls using Vapi's system, there are several status updates sent to your server. For calls that aren't answered by the customer (missed calls), Vapi sends a webhook with a status update containing the specific
endedReason
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
Copy code
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:
Copy code
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:
Copy code
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!
3 Views