end_call & call_ended
end_call & call_ended
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.
end_call needs an open socket. To cancel an outbound call before your socket connects —
while it’s still Queued or Ringing — use Stop a call
(POST /api/v1/calls/{id}/stop) instead. Dial opens the socket only once the call is answered, so a
call cancelled before that never reaches your server.
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.