PurposeThe
stop event terminates the stream from your application’s side. When Vobiz receives it:- The stream stops immediately and the WebSocket closes
- Vobiz moves to the next XML element in your response (e.g.
<Speak>,<Dial>,<Redirect>) - If there is no next element, Vobiz hangs up the call automatically (
HangupCauseCode=4010)
Attributes
Request & Response
Request Format
Send this JSON message through the WebSocket to terminate the stream:Stop event request
Response Format
There is no inbound JSON acknowledgment for thestop event. The WebSocket close itself is your confirmation.
What happens after you send stop:
Examples
Complete Event Sequence
Send stop to end the stream
Node.js Implementation
Agent teardown with stop event
Python AsyncIO Example
Stop event in Python asyncio
Best Practices
Play Farewell Audio Before Stopping
Send any farewell audio and acheckpoint before the stop event. Wait for the playedStream acknowledgment so the caller hears the full goodbye message before the stream terminates.
Handle the WebSocket Close Event
Wire up aws.on('close') handler to flush in-memory buffers (recordings, transcripts) and clean up per-call state. Do not rely on a JSON reply - the close event is your only confirmation.
Avoid Sending Events After Stop
Do not sendplayAudio, clearAudio, or checkpoint events after the stop command. The WebSocket closes immediately and any queued sends will be dropped.