CallEvent is how the gateway tells you what happened to a call after you hand the call off. The gateway pushes events on the same uni-stream pipe as audio.

CallEvent schema

Event types

Subscribing

Send one EventStreamRequest immediately after connect. The SDKs do this for you in connect() / connect_async(). The client_id should be a stable per-process UUID. The gateway uses it to demux events when the same tenant has multiple connected SDK instances.
After this RPC, the gateway opens server-initiated uni-streams to your session. These streams contain audio and event frames.

Ordering

For a single call_sid, the gateway emits events strictly in this order:
Across call_sids, events are not ordered. The gateway pushes them as fast as it can serialize them.

Reconnect behaviour

  • Within a session: If a uni-stream resets mid-frame, the gateway opens a new one. It replays the latest CHANNEL_HANGUP_COMPLETE for each call that completed during the gap. The gateway does not replay mid-call events, because you already missed the audio.
  • Across sessions: A fresh QUIC connection with the same client_id resumes the subscription. The gateway holds an event buffer of 120 seconds per client_id. It drops anything older.
Track in-flight call_sids in a set. Remove them on CHANNEL_HANGUP_COMPLETE. Do not drive UI from status strings alone. Those strings are for humans. Branch on event_type. Use q850_cause to disambiguate hang-up reasons.