Skip to content

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

ParameterTypeRequiredDescription
callIdstringYesCall 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 TypeError CodeDescription
SESSION_ERRORVarious session/auth codesSession/token state is invalid while answering
INTERNAL_ERRORvoice:error:no_call_found and relatedCall invite is missing/expired or cannot be resolved
NETWORK_ERRORinternal:error:serviceNotAvailableNetwork failure while processing answer
UNKNOWN_ERRORN/AUnexpected failure

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

Notes

  • answer is 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
  • reject - Reject an inbound call invite

Built with VitePress.