Skip to content

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

ParameterTypeRequiredDescription
tokenstringYesAuthentication token for the emergency call
callIdstringYesUnique identifier of the emergency call
reconnectTokenstringYesReconnect 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 TypeError CodeDescription
CS_ERRORVarious CS error codesBackend error returned from the emergency call service during reconnection
SESSION_ERRORinternal:auth:authorization_errorAuthentication error - invalid or missing authorization token
NETWORK_ERRORinternal:error:serviceNotAvailableNetwork-level errors including connection failures, timeouts (HTTP 503 service unavailable), or HTTP 500+ server errors
INTERNAL_ERRORvoice:error:media_timeoutMedia connection failed to establish within the timeout period
INTERNAL_ERRORinternal:error:parsing_exceptionFailed to parse the response from the server
INTERNAL_ERRORinternal:error:unsanitized_input_errorRequest contains unsanitized input and was rejected
INTERNAL_ERRORemergency:error:invalid_reconnect_token_originReconnect token is missing or has invalid origin
UNKNOWN_ERRORN/AUnexpected 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_timeout error will be thrown
  • The call ID remains the same throughout reconnection

Built with VitePress.