Call events

Track inbound and outbound calls and standalone WebSocket sessions.
View as Markdown

Call lifecycle events track the creation, answering, and termination of voice sessions. These are the foundational events your application will handle. Phone sessions begin with call.created (inbound) or command.call.dial.accepted (outbound); standalone WebSocket sessions have a separate startup sequence described under Call Lifecycle.

All webhook deliveries are signed. See Signature Verification for how to validate event authenticity.

call.created

Fired automatically when a new inbound phone, SIP, or WebRTC call arrives and a session is created. Outbound calls begin with command.call.dial.accepted, while standalone WebSocket sessions begin with websocket.connected or websocket.failed.

Payload schema

FieldTypeDescription
eventstringAlways "call.created". Required
session_uuidstringUnique session identifier. Required
caller_idstringCaller ID number of the incoming call, in canonical international E.164 format with leading + (e.g. +972527121102). Required
didstringCalled DID (Direct Inward Dialing) number, in canonical E.164 format with leading + (e.g. +972747713001). Required
typestringHow the inbound session originated. One of: phone_in, sip, webrtc, unknown. Required
timestampstringRFC 3339 / ISO 8601 UTC timestamp at which the event was emitted (e.g. "2025-06-06T08:53:20.000Z"). Always Z suffix, always 3-digit millisecond fraction. Present on every webhook event. Required
1{
2 "event": "call.created",
3 "session_uuid": "acW68-f47ac10b-58cc-4372-a567-0e02b2c3d479",
4 "caller_id": "+972527121102",
5 "did": "+972747713001",
6 "type": "phone_in",
7 "timestamp": "2025-06-06T08:53:20.000Z"
8}

call.answered

Fired exactly once when the call is answered. In terms of SIP response codes, this event corresponds strictly to a 200 OK from the called party — 183 Session Progress is reported separately as call.early_media_started and is not an answer.

When you issue an explicit answer command, a SIP 200 OK emits one call.answered event. An unanswered call emits call.ended with answered: false. The call.answered payload omits operation_uuid and success.

Payload schema

FieldTypeDescription
eventstringAlways "call.answered". Required
session_uuidstringUnique session identifier. Required
timestampstringRFC 3339 / ISO 8601 UTC timestamp at which the event was emitted. Present on every webhook event. Required
1{
2 "event": "call.answered",
3 "session_uuid": "acW68-f47ac10b-58cc-4372-a567-0e02b2c3d479",
4 "timestamp": "2025-06-06T08:53:22.000Z"
5}

call.ended

call.ended is the single terminal event for every session. It fires exactly once per session — whether or not the call was ever answered. Use the answered boolean to distinguish the two cases:

  • Post-answer termination: answered: true, a real duration_seconds, and hangup_by identifying the party who ended the call.
  • Pre-answer termination (dial never connected, rejected, or cancelled before answer): answered: false, duration_seconds: 0, and hangup_by identifying the responsible party where it can be attributed (e.g. "system" for a ring/dial timeout) or "unknown" when the originator is indeterminate.

It is also fired synthetically when a session becomes orphaned — i.e. it has had no media or signalling activity for approximately 120 seconds and is cleaned up by the platform (see Timing Limits). Synthetic hangups carry answered: false and duration_seconds: 0.

Payload schema

FieldTypeDescription
eventstringAlways "call.ended". Required
session_uuidstringUnique session identifier. Required
answeredbooleantrue if the call reached a true answer (SIP 200 OK) before ending; false for any pre-answer termination, including dial timeouts and synthetic orphan cleanup. Required
hangup_causestringHangup cause. One of: completed, busy, rejected, timeout, not_answered, invalid_number, cancelled, carrier_congested, carrier_unreachable, failed. Treat any unrecognized value as failed — the bucket vocabulary may gain values in future. carrier_congested is transient and retry-safe, while carrier_unreachable is the permanent/config bucket (see the table below). Required
hangup_bystringWhich party ended the call. One of: caller, callee, system, network, unknown. See the Hangup By table below. Required
hangup_descriptionstringHuman-readable English summary of why the call ended. Presentation only — the wording may change without notice, so branch on hangup_cause / hangup_by, never on this string. Required
duration_secondsintegerCall duration in seconds. 0 for pre-answer terminations and for synthetic hangups from orphan cleanup. Required
timestampstringRFC 3339 / ISO 8601 UTC timestamp at which the event was emitted. Present on every webhook event. Required

Example — answered:

1{
2 "event": "call.ended",
3 "session_uuid": "acW68-f47ac10b-58cc-4372-a567-0e02b2c3d479",
4 "answered": true,
5 "hangup_cause": "completed",
6 "hangup_by": "caller",
7 "hangup_description": "The caller hung up.",
8 "duration_seconds": 45,
9 "timestamp": "2025-06-06T08:54:07.000Z"
10}

Example — pre-answer termination:

1{
2 "event": "call.ended",
3 "session_uuid": "acW68-f47ac10b-58cc-4372-a567-0e02b2c3d479",
4 "answered": false,
5 "hangup_cause": "cancelled",
6 "hangup_by": "unknown",
7 "hangup_description": "The caller cancelled before the call was answered.",
8 "duration_seconds": 0,
9 "timestamp": "2025-06-06T08:53:52.000Z"
10}

Hangup Causes

CauseDescription
completedNormal call completion. The call ended gracefully.
busyThe called party was busy.
rejectedThe call was rejected by the called party.
timeoutRing or media timeout — far end did not answer within the call’s ring_timeout_sec, or media stopped flowing for too long.
not_answeredThe called party could not be reached — e.g. the subscriber is not registered, absent, or the number has been changed/rerouted. Note: an ordinary “rang but nobody answered” outcome is reported as timeout, not not_answered.
invalid_numberThe destination number was rejected as malformed or unallocated.
cancelledThe originator cancelled the call before it was answered.
carrier_congestedThe carrier or an upstream switch is temporarily congested, or no channel was momentarily available. Retry-safe: this condition is transient, so the same call MAY succeed if you retry it — potentially over a different route. Safe to re-attempt after a short delay.
carrier_unreachableA permanent carrier- or configuration-side problem prevented the call from completing (the network is faulted, or the gateway/profile/route is misconfigured). Not retry-safe: retrying the same call is unlikely to help until the underlying carrier/config issue is resolved.
failedThe call failed due to a system or network error not covered by the buckets above.

Treat any unrecognized hangup_cause value as failed — the bucket vocabulary may gain values in future.

Hangup By

hangup_by identifies which party ended the call. It is orthogonal to hangup_cause (the reason): a single cause may originate from either side.

ValueMeaning
callerThe party who placed the call disconnected. On an inbound call this is the external customer; on an outbound call this is your app’s own leg.
calleeThe party who was called disconnected. On an inbound call this is your app’s leg; on an outbound call this is the external destination.
systemThe platform ended the call (ring/dial/media timeout, orphan cleanup, shutdown).
networkA carrier or SIP-intermediate failure ended the call.
unknownThe signal was unavailable.

Hangup Description

Human-readable English summary of why the call ended. Presentation only — the wording may change without notice, so branch on hangup_cause / hangup_by, never on this string.

command.call.dial.accepted

Fired after a successful POST /v1/sessions:dial when the gateway begins dialing the destination. Outbound only.

Payload schema

FieldTypeDescription
eventstringAlways "command.call.dial.accepted".
session_uuidstringUnique session identifier.
directionstringAlways "outbound".
typestringAlways "phone_out".
tostringDestination number, in canonical international E.164 format with leading + (e.g. +972527121102).
fromstringCaller-ID presented to the far end, in canonical E.164 format with leading + (e.g. +972747713001).
timestampstringRFC 3339 / ISO 8601 UTC timestamp at which the event was emitted. Present on every webhook event.
1{
2 "event": "command.call.dial.accepted",
3 "session_uuid": "acW68-...",
4 "direction": "outbound",
5 "type": "phone_out",
6 "to": "+972527121102",
7 "from": "+972747713001",
8 "timestamp": "2025-06-06T08:53:20.123Z"
9}

call.ringing_started

Fired when the far end indicates ringing on an outbound dial.

Payload schema

FieldTypeDescription
eventstringAlways "call.ringing_started". Required
session_uuidstringUnique session identifier. Required
timestampstringRFC 3339 / ISO 8601 UTC timestamp at which the event was emitted. Present on every webhook event. Required
1{
2 "event": "call.ringing_started",
3 "session_uuid": "acW68-...",
4 "timestamp": "2025-06-06T08:53:21.123Z"
5}

call.early_media_started

Fired when the far end starts sending early media (audio before answer, e.g. ringback or carrier announcements). This corresponds to SIP 183 Session Progress.

Early media indicates that audio is flowing before the called party answers. call.answered fires when the called party returns SIP 200 OK.

Payload schema

FieldTypeDescription
eventstringAlways "call.early_media_started". Required
session_uuidstringUnique session identifier. Required
timestampstringRFC 3339 / ISO 8601 UTC timestamp at which the event was emitted. Present on every webhook event. Required
1{
2 "event": "call.early_media_started",
3 "session_uuid": "acW68-...",
4 "timestamp": "2025-06-06T08:53:22.123Z"
5}

Call Lifecycle

Every session moves through a sequence of lifecycle events and ends with exactly one terminal call.ended, including unanswered calls (answered: false). The optional states (?) may or may not fire depending on far-end signalling.

Outbound (POST /v1/sessions:dial):
command.call.dial.accepted
└─▶ call.ringing_started?
└─▶ call.early_media_started? (SIP 183 — NOT an answer)
├─▶ call.answered ─▶ … ─▶ call.ended { answered: true }
└────────────────────▶ call.ended { answered: false }
(timeout / busy / rejected / cancelled,
duration_seconds: 0; hangup_by is "system"
for a ring/dial timeout, else "unknown")
Inbound (incoming call):
call.created
└─▶ call.answered ─▶ … ─▶ call.ended { answered: true }
└──────────────────────▶ call.ended { answered: false } (caller gives up before answer)
Standalone WebSocket session (POST /v1/sessions:connectWebsocket):
websocket.connected ─▶ … ─▶ websocket.disconnected ─▶ call.ended
or
websocket.failed ──────────────────▶ call.ended
or
connection timeout ─────────▶ call.ended

A standalone type: "websocket" session has no phone leg and emits neither call.created nor command.call.dial.accepted. websocket.connected advances it from connecting to answered without emitting call.answered. Its lifetime is bound to the backend WebSocket: a disconnect or connection failure ends the session, and call.ended follows the corresponding WebSocket event. See Create Session for the full contract.

Ordering & dedup. Delivery is at-least-once with in-order (FIFO) delivery per session_uuid: the delivery worker preserves emission order for events with the same session_uuid, including across retries, but the same event may be delivered more than once. Process those events in delivery order and dedupe on the delivery idempotency_key. Use timestamp as event-time metadata, not as a sorting key. Exactly one terminal call.ended is emitted per session.

Outbound Call Origination Lifecycle

A POST /v1/sessions:dial produces the following outbound lifecycle events. Every event below carries a timestamp (RFC 3339 UTC string). For this session, preserve the delivery order guaranteed above.

OrderEventFiresPayload beyond event / session_uuid / timestamp
1command.call.dial.acceptedAlways — immediately after the dial is accepted.direction ("outbound"), type ("phone_out"), to, from (both canonical E.164 with leading +).
2call.ringing_startedOptional — when the far end signals ringing.No additional payload fields.
3call.early_media_startedOptional — when SIP 183 early audio (ringback or announcements) flows.No additional payload fields.
4call.answeredOptional — exactly once, only on a true answer (SIP 200 OK). Skipped entirely if the call is never answered.No additional payload fields.
5call.endedAlways — the single terminal event, answered or not.answered, hangup_cause, hangup_by, hangup_description, duration_seconds.

Each intermediate event is emitted at most once and only advances forward: a dial may skip straight from command.call.dial.accepted to call.ended (e.g. immediate rejection), or stop at any intermediate stage. call.early_media_started reports SIP 183 early audio; call.answered reports a SIP 200 OK answer.

Timing Limits

Three platform limits surface as ordinary call.ended events:

  • Outbound dial cap (ring_timeout_sec). Every outbound dial supplies this value explicitly. If an outbound dial is not answered within that window, the platform stops the attempt and emits call.ended with answered: false and hangup_cause: "timeout". This window is measured from when dialing begins (when command.call.dial.accepted is emitted), not from when the far end starts ringing — see Ring timeout timing.
  • Bridge limit (~120 seconds of inactivity). A session that becomes orphaned (no media or signalling activity) for approximately 120 seconds is cleaned up and emits a synthetic call.ended with answered: false and duration_seconds: 0.
  • Standalone WebSocket connection cap. A standalone type: "websocket" session whose backend never connects within the platform’s connection window is ended and emits call.ended.

These windows are platform behaviour and may change; treat the exact values as approximate and branch on hangup_cause, not on elapsed time you measure yourself.

Answering Machine Detection (AMD)

The platform does not classify an outbound answer as human or machine. call.answered fires on every SIP 200 OK, including when a voicemail system picks up.

Lifecycle and interaction signals alone make voicemail detection necessarily heuristic. Common signals an application can combine:

  • Long uninterrupted single-party audio after answer. Voicemail greetings are continuous monologues. If, after call.answered, the far end produces a long stretch of audio with no DTMF (no dtmf.received) and no natural pause where a person would respond to your prompt, treat it as a likely machine.
  • No interactive response to a prompt. If you play a prompt and collect digits (play_and_get_digits) and consistently get digits.collected with status: "no_input" or "partial_then_timeout", the answering party may be a machine that cannot respond.
  • Early media that never becomes an answer. A call.early_media_started followed by a long delay and then a hangup with answered: false typically reflects ringback or a carrier announcement, not a person — this is the unanswered case, distinct from a machine that actually answers.

For reliable detection, analyze the call audio with a dedicated answering-machine-detection algorithm. You can supply it with real-time audio through a WebSocket audio relay, or stream an active recording from its live_url. Combine that analysis with lifecycle events and interaction signals as appropriate for your traffic. If the result indicates a recording, delete the session, passing the event’s session_uuid as {uuid}.

Triggered By

These events are produced by the following endpoints and lifecycle triggers: