end_call & call_ended

View as Markdown

end_call — hang up gracefully

Direction: your server → Dial. Ends the call. Anything already queued for playback is discarded — if the agent should say goodbye first, send the goodbye media, a mark, and end_call only when the mark echoes back.

Once sent, the call is over for good: Dial will refuse reconnection attempts for this call_id.

FieldTypeDescription
typestringAlways "end_call".
1{ "type": "end_call" }

call_ended — the call is over

Direction: Dial → your server. The last frame before Dial closes the socket. Your Call record (status, duration, call.ended event) is finalized regardless of what happens to this socket — treat the frame as a courtesy signal for cleanup, not as the source of truth.

FieldTypeDescription
typestringAlways "call_ended".
reasonstring"caller_hangup" — the other party hung up. "customer_hangup" — you sent end_call. "duration_limit" — the call hit its configured duration cap. "error" — Dial could not sustain the call (e.g. your endpoint stayed unreachable past the reconnect budget).
1{ "type": "call_ended", "reason": "caller_hangup" }