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
| Parameter | Type | Required | Description |
|---|---|---|---|
callId | string | Yes | Call 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 Type | Error Code | Description |
|---|---|---|
SESSION_ERROR | Various session/auth codes | Session/token state is invalid while rejecting |
INTERNAL_ERROR | voice:error:no_call_found and related | Call invite is missing/expired or cannot be resolved |
NETWORK_ERROR | internal:error:serviceNotAvailable | Network failure while processing reject |
UNKNOWN_ERROR | N/A | Unexpected failure |
For complete error reference and handling guidelines, see Error Reference.
Notes
rejectis only valid for pending inbound invites- Invites can be canceled or timeout before rejection is attempted
Related Actions
answer- Answer an inbound call invite
Related Events
onCallInvite- Fired when an inbound invite is receivedonCallInviteCancel- Fired when an invite is canceled