Reconnect Emergency Call
Reconnects to an existing emergency call that was previously disconnected. This method uses the reconnect token obtained from the original emergencyCall to restore the voice connection without creating a new call session.
Signature
// Callback version
fun reconnectEmergencyCall(
token: Token,
callId: EmergencyCallId,
reconnectToken: ReconnectToken,
callback: (Exception?) -> Unit
)
// Suspend version
suspend fun reconnectEmergencyCall(
token: Token,
callId: EmergencyCallId,
reconnectToken: ReconnectToken
)Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
token | string | Yes | Authentication token for the emergency call |
callId | string | Yes | Unique identifier of the emergency call |
reconnectToken | string | Yes | Reconnect token obtained from the original emergency call |
Return Type
Returns void (or Promise<void> for JavaScript/TypeScript). The method completes successfully when the call is reconnected, or throws an error if the operation fails.
Usage Example
// Callback
client.reconnectEmergencyCall("token", "callId", "reconnectToken") { err ->
err?.let {
// Handle Error in reconnecting emergency call
println("Error in reconnecting emergency call: $err")
} ?: run {
println("Emergency call reconnected successfully")
}
}
// Coroutine
try {
client.reconnectEmergencyCall(
token = "token",
callId = "callId",
reconnectToken = "reconnectToken"
)
println("Emergency call reconnected successfully")
} catch (e: Exception) {
// Handle Error in reconnecting emergency call
}
Errors
| Error Type | Error Code | Description |
|---|---|---|
CS_ERROR | Various CS error codes | Backend error returned from the emergency call service during reconnection |
SESSION_ERROR | internal:auth:authorization_error | Authentication error - invalid or missing authorization token |
NETWORK_ERROR | internal:error:serviceNotAvailable | Network-level errors including connection failures, timeouts (HTTP 503 service unavailable), or HTTP 500+ server errors |
INTERNAL_ERROR | voice:error:media_timeout | Media connection failed to establish within the timeout period |
INTERNAL_ERROR | internal:error:parsing_exception | Failed to parse the response from the server |
INTERNAL_ERROR | internal:error:unsanitized_input_error | Request contains unsanitized input and was rejected |
INTERNAL_ERROR | emergency:error:invalid_reconnect_token_origin | Reconnect token is missing or has invalid origin |
UNKNOWN_ERROR | N/A | Unexpected error that should be reported to support |
For complete error reference and handling guidelines, see Error Reference.
Notes
- The method first disables any existing media connection before attempting to reconnect
- The reconnect token contains the original region information to ensure reconnection to the same server
- Media state transitions through the same flow as initial call establishment
- If media cannot be established, a
media_timeouterror will be thrown - The call ID remains the same throughout reconnection
Related Actions
emergencyCall- Initiate an emergency callhangUpEmergencyCall- End an active emergency call