Ben
01/03/2025, 2:19 PMVapi
01/03/2025, 2:21 PMvapiInstance.call
as that is a private member. Instead, you should use the appropriate event listeners provided by the VAPI Voice Widget to get the Call ID.
When a call is connected, the Voice Widget emits an event that includes the Call ID. You can listen for this event and then retrieve the Call ID from the event object. Here's an example of how you can set up an event listener for the callConnected
event:
javascript
vapiInstance.on('callConnected', function(event) {
var callId = event.callId;
console.log('Connected call with ID:', callId);
});
Make sure to add this event listener after initializing your VAPI Voice Widget instance and before the call is connected to ensure you capture the event.
If you're still having trouble accessing the Call ID, please ask support for more info on this.Vapi
01/03/2025, 2:21 PMBen
01/03/2025, 3:09 PMtype VapiEventListeners = {
'call-end': () => void;
'call-start': () => void;
'volume-level': (volume: number) => void;
'speech-start': () => void;
'speech-end': () => void;
video: (track: MediaStreamTrack) => void;
message: (message: any) => void;
error: (error: any) => void;
};
I think the event handler and suggestion you have provided is a hallucination - thhere is no such callConnected event handler with callId providedBen
01/03/2025, 3:09 PMShubham Bajaj
01/07/2025, 8:19 PMwindow.vapiSDK.vapi.call._meetingSessionSummary.id
.