Call lifecycle
Summary
This page explains how a call starts and what each call state means. It also gives the
dial_outcome values, the readiness of each result and the webhook event of each end. It does not
cover why a call ended; see Call end reasons.
Facts
How a call starts
Each call runs the live version of its agent at admission, and keeps that version to the end. A later publish or rollback does not change a call that is already admitted.
Call states
endCall on a call in evidence_pending or a terminal state answers the current state with
end_requested: false. The conversation is already over.
Dial outcome
dial_outcome is the carrier’s report for the outbound dial that placed the call. It is null
when no carrier dial placed the call: inbound, browser and test calls. dial_sip_code is the SIP
response code when the carrier gave one, for example 480 or 486.
dial_outcome is an open vocabulary. Keep a value you do not know, and never read it as success.
Result readiness
Each result of a call has its own readiness field. A result read returns what Rasen stored and never
starts work. The call state does not tell you whether a result is ready.
The summary is ready when the extraction finishes. The call has no readiness field for the
recording: downloadCallRecording answers 404 not_found for a call without a recording, and the
call.analyzed event carries recording.available.
When to read again:
A terminal call that can change
An incomplete call becomes complete when its full record arrives later. Rasen sends no webhook
event for this change: the call already got its end event. The change moves the call’s
updated_at. To catch it, list the calls that changed since your last scan with listCalls and
updated_since. See Keep a copy in sync.
complete and aborted do not change state again.
Right after a call becomes terminal, extraction_state and summary_state can read
unavailable for a short time, with poll_after_seconds null. Then they read pending. If a
call ended in the last few seconds and a result reads unavailable, read the call once more after
5 seconds. Only then treat the result as final.
Webhook events
A call gets exactly one of call.completed and call.failed, and call.analyzed only after
call.completed. Rasen sends an end event only within 24 hours of the call end. An imported call
sends no event. See Webhook events for the payloads.
Refusals
A call start that admission refuses places no call. createCall and createAgentSession answer
the refusal as an error, for example 429 workspace_concurrency_full with Retry-After, and
create no call. An inbound call or a campaign attempt that admission refuses is a call in state
aborted. Its end_reason is the refusal code, for example workspace_concurrency_full, and it
sends call.failed.
A full workspace answers one of two codes. Handle both:
429 workspace_concurrency_fullcomes when the workspace’s share or the organization’s total is full.details.reasonisworkspace_shareororganisation_total.503 at_capacitywithdetails.reasonworkspace_limitcomes when the workspace has a limit of its own and no share.details.activeanddetails.limitgive the count.
For both, end a call, or wait for one to finish. Wait at least Retry-After seconds. Then send the
identical request with the same Idempotency-Key. Any other at_capacity reason means that the
platform has no free capacity.
The account’s plan sets its total of concurrent calls, and each workspace gets a share. A workspace without a share has a limit of its own. See Retry after a refusal for how to retry each refusal.
Rules
- MUST read
terminal, not a list of states, to know whether a call has ended.completeandaborteddo not change again.incompletecan change tocomplete. - MUST read each result’s own readiness field before you read the result.
- MUST follow
poll_after_seconds, and stop polling a call when it isnull. - MUST run a changes scan (
listCallswithupdated_since) to catch anincompletecall that becomescomplete. No webhook event announces it. - MUST NOT treat
202fromcreateCallas a connected call. - MUST keep an unknown
state,dial_outcome,end_reasonor readiness value, and never read it as success.