On Emergency Call Disconnected
Fired when an emergency call is unexpectedly disconnected. This event indicates an abnormal disconnection, such as media failure or network issues, rather than a normal hangup.
Event Registration
// Set listener
client.setEmergencyCallListener(object : EmergencyCallListener {
override fun onEmergencyCallDisconnected(callId: String) {
// Handle disconnect event
}
override fun onEmergencyCallHangup(callId: String) {
// Handle hangup event
}
})Event Data
| Parameter | Type | Description |
|---|---|---|
callId | string | Unique identifier of the disconnected emergency call |
Usage Example
client.setOnEmergencyCallDisconnectedListener { callId ->
println("Emergency call $callId is disconnected")
}
When This Event Fires
This event is triggered when the emergency call is disconnected unexpectedly, such as:
- Media Connection Failed: When the media connection (WebRTC/RTC) closes or fails unexpectedly
- Network Issues: When network connectivity is lost during the call
- Media Timeout: When media fails to establish or maintain the connection
Notes
- This event indicates an unexpected disconnection, not a normal hangup
- After this event, you should attempt to reconnect using
reconnectEmergencyCall()with the reconnect token - The call resources are cleaned up automatically after this event
- This is different from
onEmergencyCallHangup, which indicates a normal call termination - Use this event to:
- Notify the user of the disconnection
- Provide an option to reconnect
- Log the disconnection for troubleshooting
- The call ID remains valid and can be used with the reconnect token to restore the call
- Recommended action: Notify the user of the disconnection and offer to reconnect using
reconnectEmergencyCall()with the saved reconnect token; if reconnection fails, inform the user to try calling again
Related Events
onEmergencyCallHangup- Fired when call ends normally