On Call Media Disconnect
Fired when call media disconnects and cannot continue in the current state.
Event Registration
fun setOnCallMediaDisconnectListener(
fn: (callId: String, reason: CallDisconnectReason) -> Unit
): Subscription
Usage Example
client.setOnCallMediaDisconnectListener { legId, reason ->
when (reason) {
CallDisconnectReason.networkChange -> println("Received call media disconnect $reason for Call $legId")
}
}
Event Data
| Parameter | Type | Description |
|---|---|---|
callId | string | Identifier of the affected call |
reason | CallDisconnectReason | Media disconnect reason — see below |
CallDisconnectReason
| Android / Web value | iOS value | Description |
|---|---|---|
networkChange | VGCallDisconnectReasonNetworkChange | Media disconnected due to a network change (e.g. Wi-Fi to cellular switch, or connectivity loss after all reconnection retries exhausted) |
INFO
networkChange is currently the only disconnect reason. Additional values may be added in future SDK versions — always handle unknown enum values gracefully with a default case.
Notes
- Use this event to trigger reconnection UX and recovery actions
- This represents media-level disconnect, not necessarily full call teardown
Related Actions
reconnectCall- Attempt call media reconnection
Related Events
onCallMediaReconnecting- Fired when reconnection startsonCallMediaReconnection- Fired when reconnection succeeds