Diogo Azevedo
11/05/2025, 2:21 PMVapi Support Bot
11/05/2025, 2:29 PMlistenUrl WebSocket may stop streaming audio. The recommended approach is to monitor for a handoff event and then re-establish your WebSocket connection. For example:
javascript
socket.onmessage = (event) => {
if (!(event.data instanceof Blob)) {
try {
const message = JSON.parse(event.data);
if (message.type === 'handoff-completed') {
reconnectToListenUrl(); // Your logic to reconnect
}
} catch (error) {
console.error('Failed to parse message:', error);
}
}
};
Reconnect to the new listenUrl after detecting the handoff to resume audio processing.
Source:
- [Vapi documentation and known issue explanation](https://docs.vapi.ai/calls/call-features)Chiranjeet Mishra
11/06/2025, 9:55 PM