Skip to navigation

Call lifecycle

How a call starts, the states it moves through, and when its results are ready.

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

ItemValue
Operations that start a callcreateCall (POST /calls), createAgentSession (POST /agent-sessions). An inbound call needs no operation
Operations that read a callgetCall, listCalls, searchCalls, getCallTranscript, getCallSummary, getCallExtraction, downloadCallRecording, listCallToolOutcomes
Operation that ends a callendCall (POST /calls/{call_id}/end)
state valuesadmitted, active, evidence_pending, complete, incomplete, aborted. Open vocabulary
Terminal statescomplete, incomplete, aborted. terminal is true for these three. Only incomplete can change again, to complete
evidence_pending limit900 seconds, then incomplete
Agent session deadlineexpires_at: 120 seconds after admission
Longest call30 minutes, whatever max_call_duration_seconds says. The call then ends with end_reason timeout
Inactivity timeoutinactivity_timeout_seconds: 1 to 3600, default 30. The call then ends with end_reason timeout
Poll hintpoll_after_seconds on getCall; null when the call is terminal and no result is pending
Webhook end eventscall.completed or call.failed, once for each call, only within 24 hours of the call end
call.analyzedAfter call.completed, when the results are final, or 6 hours after the call end

How a call starts

StartOperationFirst answerWhat happens next
Outbound phone callcreateCall202 with CallAccepted: call_id, published_version_id, state: admitted, poll_after_seconds, and a Location headerRasen requested the dial once. 202 means admitted, not connected. Read the call at Location.
Your own call legcreateAgentSession201 with state: admitted, websocket_url and expires_atConnect to websocket_url and send audio before expires_at. The call becomes active at the first audio frame.
Inbound phone callNoneThe call appears in listCalls with direction: inboundRasen answers a number that has an inbound agent.
Campaign attemptstartCampaignEach attempt is a callSee Campaign lifecycle.

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

stateMeaningTerminalWhat happens next
admittedRasen accepted the call start and reserved its place. Rasen has accepted no media yet.Noactive when Rasen accepts the call’s media. aborted when the media never connects, the caller ends the call first, or admission refuses the call.
activeRasen accepted the media, and the conversation runs.Noevidence_pending when the conversation ends.
evidence_pendingThe conversation is over. Rasen is storing the call record: transcript, recording and timing.Nocomplete when Rasen has stored the record. incomplete after 900 seconds without it.
completeThe call happened, and its record is complete.YesNothing. Each result becomes ready on its own; read its readiness.
incompleteThe call happened, and part of its record is missing.YesRasen can change it to complete when the full record arrives later. end_reason does not change. Rasen sends no event for this change.
abortedThe call never started: Rasen accepted no media.YesNothing. transcript_state is absent, and the other results are unavailable.

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_outcomeMeaning
dialingRasen requested the dial, and the carrier has not reported an outcome.
ringingThe carrier reports that the phone rings.
answeredThe called phone answered. A voicemail can still answer after the carrier connects; read end_reason.
no_answerThe phone rang, and nobody answered.
busyThe line was busy.
voicemailThe carrier reports that a machine answered.
rejectedThe carrier or the called phone rejected the call.
invalid_numberThe carrier reports that the number is not valid.
failedThe dial failed.
cancelledThe carrier reports the dial as cancelled before it connected.
indeterminateRasen cannot know the carrier’s outcome.

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.

ValueMeaningFields
pendingRasen has not stored the result yet. The call is live, or Rasen is producing the result.transcript_state, extraction_state, summary_state
readyRasen stored the result. Read it.transcript_state, extraction_state, summary_state
absentThe call ended with no transcript.transcript_state
failedRasen could not produce the result.transcript_state, extraction_state, summary_state
unavailableThe result does not exist, and Rasen does not produce it, for example for an aborted call. Right after a call ends, it can read unavailable for a short time; see A terminal call that can change.transcript_state, extraction_state, summary_state
not_requestedThe agent asked for no result of this kind, for example no extraction fields.extraction_state, summary_state

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:

Situationpoll_after_secondsWhat to do
The call is live (admitted, active or evidence_pending)A numberRead the call again after that many seconds.
The call is terminal and a result is pendingA numberRead the call again after that many seconds.
The call is terminal and no result is pendingnull on getCallStop polling this call. To catch an incomplete call that becomes complete later, run a changes scan.

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

What happenedCall state at that timeEvent
Rasen accepted the media, and the call left activeevidence_pending, complete or incompletecall.completed
The call ended before Rasen accepted any mediaabortedcall.failed
After call.completed: the transcript, the recording state and the extraction are final, or 6 hours passed since the call endcomplete or incompletecall.analyzed

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.

Refusal codeMeaning
workspace_concurrency_fullThe workspace already runs all the concurrent calls of its share.
workspace_concurrency_unallottedThe workspace’s share of the account’s concurrent calls is 0.
at_capacityWith details.reason workspace_limit: the workspace already runs as many calls as its own limit allows. With any other reason: no capacity was free to carry the call.
admission_busyThe admission service was busy.
quota_exceededAn enforced quota had no allowance left.

A full workspace answers one of two codes. Handle both:

  • 429 workspace_concurrency_full comes when the workspace’s share or the organization’s total is full. details.reason is workspace_share or organisation_total.
  • 503 at_capacity with details.reason workspace_limit comes when the workspace has a limit of its own and no share. details.active and details.limit give 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. complete and aborted do not change again. incomplete can change to complete.
  • 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 is null.
  • MUST run a changes scan (listCalls with updated_since) to catch an incomplete call that becomes complete. No webhook event announces it.
  • MUST NOT treat 202 from createCall as a connected call.
  • MUST keep an unknown state, dial_outcome, end_reason or readiness value, and never read it as success.