Skip to content

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 ​

ParameterTypeDescription
callIdstringIdentifier of the affected call
reasonCallDisconnectReasonMedia disconnect reason — see below

CallDisconnectReason ​

Android / Web valueiOS valueDescription
networkChangeVGCallDisconnectReasonNetworkChangeMedia 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

Built with VitePress.