Close a WebRTC session
Closes the peer connection and hangs up its call, if any (`end_reason: hangup`). Closing the peer connection from the browser has the same effect. An ephemeral key restricted to a line closes only the sessions opened with that restriction.
Closes the peer connection and hangs up its call, if any (end_reason: hangup). Closing the peer connection
from the browser has the same effect. An ephemeral key restricted to a line closes only the sessions opened
with that restriction.
AuthorizationBearer <token>Your API key, 06l_…. For servers only.
session_id*stringA WebRTC session, from POST /v1/webrtc/sessions.
^rtc_[0-9a-z]{26}$Closed.
curl -X DELETE 'https://api.06line.com/v1/webrtc/sessions/string'Open a WebRTC session POST
Exchanges an SDP offer for an answer, the way WHIP does. The offer holds one audio transceiver (`sendrecv`) and one data channel labelled `06line`, with every ICE candidate already gathered (no trickle ICE). Use the `ice_servers` returned with the ephemeral key. The session lives as long as the peer connection: it carries the audio of the calls placed or answered with its `id`, one at a time, and pushes `call.incoming`, `call.state` and `line.state` on the data channel. Audio is G.711 µ-law (PCMU), 8 kHz, which every WebRTC stack supports; an offer without PCMU gets no audio. Every session of the company hears `call.incoming` (a session of a key restricted to a line, only for its line), right after `session.ready` for a call already ringing, then `call.state` when the call stops ringing. A session closed with `DELETE` ends its call `hangup`; a session lost on the way (ICE failed) ends it `failed`.
Place a call POST
Dials `to` from one of your lines. The audio goes through the WebRTC session given in `session_id`, whose data channel then reports `call.state` events. One call at a time per line and per session. An unknown session (`404`) or a busy line (`409`) is refused before anything is created. When the line cannot dial, the call is still created and returned (`201`) already `ended`, with `end_reason` `failed` or `line_offline`. Sending the same `client_ref` again returns the first call (`200`) instead of dialing twice.