Skip to content

Enable Earmuff on Emergency Call

Enables earmuff mode on an active emergency call. When earmuff is enabled, you will not hear audio from the emergency operator, but they will still be able to hear you.

Signature

// Callback version
fun enableEarmuffEmergencyCall(
  callId: EmergencyCallId,
  callback: (Exception?) -> Unit
)

// Suspend version
suspend fun enableEarmuffEmergencyCall(
  callId: EmergencyCallId
)

Parameters

ParameterTypeRequiredDescription
callIdstringYesUnique identifier of the emergency call

Return Type

Returns void (or Promise<void> for JavaScript/TypeScript). The method completes successfully when earmuff is enabled, or throws an error if the operation fails.

Usage Example

 // Callback

 client.enableEarmuffEmergencyCall("callId") { err ->
     err?.let {
         // Handle Error in enabling earmuff on emergency call
         println("Error in enabling earmuff on emergency call: $err")
     } ?: run {
         println("Earmuff enabled on emergency call successfully")
     }
 }

 // Coroutine
 try {
     client.enableEarmuffEmergencyCall("callId")
     println("Earmuff enabled on emergency call successfully")
 } catch (e: Exception) {
     // Handle Error in enabling earmuff on emergency call
 }

Errors

Error TypeError CodeDescription
INTERNAL_ERRORvoice:error:no_call_foundNo emergency call found with the specified call ID
INTERNAL_ERRORMedia client errorsErrors from the media layer when attempting to enable earmuff
UNKNOWN_ERRORN/AUnexpected error that should be reported to support

For complete error reference and handling guidelines, see Error Reference.

Notes

  • Earmuff mode blocks incoming audio - you won't hear the emergency operator
  • The emergency operator can still hear you when earmuff is enabled
  • Use disableEarmuffEmergencyCall to disable earmuff mode
  • The call must be active and have an established media connection
  • This is a local media operation and does not require server communication
  • Earmuff is useful when you need to consult with someone nearby without the operator hearing

Built with VitePress.