Answer Call
Answers an inbound call invite identified by callId. Use this when you receive a callInvite event and want to accept the call.
Signature
// Callback version
fun answer(
callId: String,
callback: (Exception?) -> Unit
)
// Suspend version
suspend fun answer(
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 answer request was accepted by the SDK/backend flow.
Usage Example
val callId = "callId"
client.answer(callId) { err ->
err?.let { println("Error answering call: $it") }
}
Errors
| Error Type | Error Code | Description |
|---|---|---|
SESSION_ERROR | Various session/auth codes | Session/token state is invalid while answering |
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 answer |
UNKNOWN_ERROR | N/A | Unexpected failure |
For complete error reference and handling guidelines, see Error Reference.
Notes
answeris only valid for an active inbound invite- Invites can time out or be canceled before answer is attempted
- Register invite listeners before expecting inbound calls
Related Actions
reject- Reject an inbound call invite
Related Events
onCallInvite- Fired when an inbound invite is receivedonCallInviteCancel- Fired when an invite is canceled