Skip to content

Reject Call

Rejects an inbound call invite identified by callId. Use this when you receive a callInvite event and do not want to accept the call.

Signature

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

// Suspend version
suspend fun reject(
  callId: String
)

Parameters

ParameterTypeRequiredDescription
callIdstringYesCall invite identifier received from callInvite

Return Type

Returns void (or Promise<void> for Web). Completion indicates the reject request was processed.

Usage Example

 val callId = "callId"
 client.reject(callId) { err ->
     err?.let { println("Error rejecting call: $it") }
 }

Errors

Error TypeError CodeDescription
SESSION_ERRORVarious session/auth codesSession/token state is invalid while rejecting
INTERNAL_ERRORvoice:error:no_call_found and relatedCall invite is missing/expired or cannot be resolved
NETWORK_ERRORinternal:error:serviceNotAvailableNetwork failure while processing reject
UNKNOWN_ERRORN/AUnexpected failure

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

Notes

  • reject is only valid for pending inbound invites
  • Invites can be canceled or timeout before rejection is attempted
  • answer - Answer an inbound call invite

Built with VitePress.