call_sid.
This page documents how that session is authenticated and brought up. It is the
plumbing under AudioBridge.attach — you
rarely wire it by hand, but you need the shapes to reason about auth, tenancy,
and reconnection.
There is no public REST API for sessions. The control plane is a set of
tRPC-style procedures exposed by the control-plane host and called for you by
the SDK. You authenticate with an API key; the SDK does the procedure calls and
the relay handshake. The shapes below are the real ones the SDK sends — treat
them as the contract, not as endpoints to hand-roll.
Two planes, one credential
Establishing a session touches two planes, both authorized by the same workspace API key:| Plane | What it does | Transport | Auth |
|---|---|---|---|
| Control plane | Mints call state, resolves the relay edge, authorizes the tenant | tRPC over HTTPS to portal.telequick.dev | Authorization: Bearer <apiKey> |
| Data plane | Carries the encoded audio for the call | MoQT over WebTransport to relay.telequick.dev | Relay token (?token=) + namespace scope |
Establish a session
Authenticate the control plane
Construct the client with your workspace API key and org id. The key is sent
as
Authorization: Bearer <apiKey> on every control-plane call; the org id
scopes every procedure to your tenant.Resolve the relay edge
Before opening a session the SDK asks the control plane which relay edge to
dial. This is a query — the SDK sends it, but the shape is worth knowing
because it geo-routes you to the nearest edge and carries the fields the
WebTransport handshake needs.Response:
Your tenant id. Scopes the response to your workspace.
Pin a specific relay edge (e.g.
"us", "uk"). Omit to let the server
geo-route to the nearest edge.false when the tenant has no QUIC/relay entitlement — the rest of the
fields are absent. Fall back to a control-plane-only integration.The MoQT relay endpoint to open the session against (already region-selected).
Which edge was chosen — echoed for telemetry and for pinning on reconnect.
A base64 SHA-256 certificate fingerprint for self-signed dev relays.
null in production, where the relay presents a public-CA certificate and
no fingerprint pinning is needed.On managed cloud the relay runs on a public-CA certificate, so
relayCertHashBase64 is null. You only pass a cert hash when you point the
SDK at a self-signed relay in local development.Open the relay session
With the relay URL and a token, the SDK opens the MoQT session. Under the
hood this is The session address is the
MoqtClient.connect(url, token, onState, opts); the token is
appended to the URL as a ?token= query and verified at the relay’s control
plane, and the WebTransport handshake advertises the moqt-16 subprotocol
(the relay closes the session if the version subprotocol is missing).call_sid: the SDK connects to
moq://<relayHost>/voice/<call_sid> and binds the uplink / downlink
tracks under that namespace. One call_sid is the whole addressing story —
SIP dialog, media session, agent session, telemetry, and this transport
session all key off it (see
Sessions, calls, tracks & streams).Observe session state
The session reconnects transparently with capped backoff; publications and
subscriptions are re-established on every reconnect. Subscribe to the state
machine to drive UI and to know when audio is actually flowing.
Connecting
First connect in progress.
Connected
Session is up; tracks are live.
Reconnecting
Transport dropped; the SDK is retrying with capped exponential backoff and
will replay your pubs/subs on success.
Closed
You (or the peer) ended the session cleanly.
Failed
The initial connect failed — surfaced with a reason string.
Namespace auth (room scope)
The relay does not hand a token holder the whole tenant. Authorization is namespace-scoped: a session may only publish and subscribe within the room-shaped namespace tuple it is authorized for. For voice that room isvoice/<call_sid>, and the two tracks inside it are fixed by role:
| Track | Direction | Who publishes |
|---|---|---|
voice/<call_sid>/uplink | caller → cloud | the caller (or the media plane) |
voice/<call_sid>/downlink | cloud → caller | the agent / your bridge |
attach subscribes uplink and publishes downlink; attachCaller (the
browser-caller mirror) does the reverse.
Connect options
These are the knobs the SDK passes to the relay session;attach sets the
media-relevant ones for you, but they are the honest surface if you drop to the
transport client directly.
Relay token, verified at the relay control plane and sent as a
?token= query
on the WebTransport URL. The Voice SDK forwards your workspace API key here.Base64 SHA-256 certificate fingerprint for a self-signed dev relay. Leave
unset in production (
relayCertHashBase64 from gatewayConnectInfo is null
there).Callback for the
ConnectionState machine above.Refuse to connect unless the browser exposes the standard WebRTC Encoded
Transform API (
RTCRtpScriptTransform). Media-sending browser sessions set
this so the encoded-frame rule holds up front instead of failing later at
capture time. Leave unset for receive-only or non-media sessions. See
browser audio capture.Fallback honesty. In the browser / TypeScript SDK a session is
WebTransport-only today; if WebTransport is unavailable it does not silently
degrade. The QUIC→WebSocket fallback ladder currently ships only in the native
SDK core (Python, Go, Rust, Java, .NET wrappers), which sticks to a WebSocket
rung when QUIC is blocked.
Sessions vs. calls
Keep the two clearly apart:- A call is the SIP dialog and its lifecycle — originate, ring, answer,
transfer, hangup. You drive it with the Calls API
(
voice.calls.*), which returnsCallDatakeyed bysid. - A session is the transport connection that carries that call’s audio,
addressed by the same
sid. You open it with the Transport / AudioBridge API.
sid
→ attach a session (data plane) to move audio. For the server-side “drop-in
agent” pattern you skip the manual session entirely — voice.agents.attach
tells the engine to wire the bridge in-process, and no client session is opened.
See the runtime session lifecycle
for the engine’s view of that.
Related
Transport / AudioBridge
Open and drive the audio session for a call.
Calls
Originate, transfer, and hang up — the call control plane.
Sessions, calls, tracks & streams
The object model: how
call_sid, namespaces, and tracks relate.Errors
Error shapes returned by the control plane and the session.