krthkntrjn
12/09/2024, 4:52 PMVapi
12/09/2024, 4:55 PM'callStarted' as the event name. If you're using 'call-start' instead, that could be the reason why eventData is undefined—because the event listener is not correctly set up to listen for the right event.
Please ensure that you use the exact event name as provided by VAPI support. Here's the corrected version of your code:
javascript
// Listen for the 'callStarted' event
vapiInstance.on('callStarted', function(eventData) {
// Access the call ID from the event data
var callId = eventData.callId;
console.log('Call ID:', callId);
// You can now use the callId for your purposes
});
Make sure to replace vapiInstance with the actual instance of your VAPI object. If you continue to face issues, please check the documentation or reach out to support for further assistance.Vapi
12/09/2024, 4:55 PMkrthkntrjn
12/09/2024, 4:56 PMShubham Bajaj
12/09/2024, 10:30 PM