Skip to content

Send DTMF

Sends DTMF digits to an active call. This is commonly used for IVR navigation and keypad-driven call flows.

Signature

// Callback version
fun sendDTMF(
  callId: String,
  digits: String,
  callback: (Exception?) -> Unit
)

// Suspend version
suspend fun sendDTMF(
  callId: String,
  digits: String
)

Parameters

ParameterTypeRequiredDescription
callIdstringYesIdentifier of the active call
digitsstringYesDTMF digit sequence to send (for example "1234")

Return Type

Returns void (or Promise<void> for Web).

Usage Example


 // Callback
 client.sendDTMF("callId", "1234") {
     it?.let { err ->
         // Handle Error in sending DTMF
         println("Error in sending DTMF: $err")
     }
 }

 // Coroutine
 try {
     client.sendDTMF("callId", "1234")
 } catch (e: Error) {
     // Handle Error in sending DTMF
 }

Errors

Error TypeError CodeDescription
INTERNAL_ERRORvoice:error:no_call_foundNo active call found for provided callId
INTERNAL_ERRORMedia-layer errorsFailed to send DTMF over media connection
UNKNOWN_ERRORN/AUnexpected failure

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

Notes

  • DTMF requires an active established call media session
  • Digit validation/handling behavior depends on backend and remote endpoint
  • onDTMF - Fired when DTMF digits are received on a call

Built with VitePress.