SIP gateway / B2BUA
Terminates carrier trunks and browser-originated calls, authenticates and
routes them, and stitches the two legs of every call together.
RTP media plane
Receives and sends the audio packets, transcodes codecs, handles jitter and
DTMF, and taps recordings — all in-engine, per session.
Agent runtime
Drives the conversation: streams caller audio to your ASR/LLM/TTS or
speech-to-speech provider and paces the reply back into the call.
MoQT transport
Carries audio to and from browsers and apps as media-over-QUIC objects,
tunneled through WebTransport on the same port as your control API.
The end-to-end path
Here is an inbound PSTN call reaching an AI agent. Read it top to bottom; each arrow is a handoff between the roles above.The call arrives
The carrier sends an
INVITE to the tenant’s SIP edge
(<workspace-id>.sip.telequick.dev). The gateway matches the trunk by
source IP, resolves the tenant, and runs digest auth, ACL, and spam
filtering before it accepts anything.The gateway routes and opens media
Acting as a back-to-back user agent (B2BUA), the gateway picks the
destination from the dialplan and skill-based routing, then opens an RTP
media session pinned to the CPU core that owns the call.
The media plane decodes
Carrier audio is G.711 µ-law or A-law at 8 kHz. The media plane decodes it
to the runtime’s internal format — 8 kHz PCM16, little-endian — in 20 ms
frames, and handles jitter, DTMF, and the recording tap along the way.
The runtime holds the conversation
Decoded audio streams into the agent runtime. It runs your cascaded
ASR → LLM → TTS graph or a single speech-to-speech provider, decides turn
boundaries, and produces reply audio.
Direct media vs. proxied media
Whether the media plane and the SIP gateway sit on the same host is a per-trunk choice. Setmedia_mode on the trunk:
- direct (default)
- proxy
RTP terminates wherever the agent runs, and after call setup the gateway is
signalling-only — it manages the SIP dialog while audio flows straight
from the carrier to the runtime’s media plane. Fewer hops, lower latency,
and no media relay to scale. Use this for well-behaved carriers.
Direct media is the fast path and the default. Reach for
proxy only when a
carrier’s NAT or SBC policy refuses to send audio to an address other than the
one it signalled to.Browser and app clients
A browser or mobile client does not speak SIP — it rides the media-over-QUIC transport. Audio never touches WebRTC’s transport; only the browser’s Opus encoder and capture graph are borrowed (see WebRTC diversion):mic track up, a spk
track down) so a client never subscribes to its own audio and creates a feedback
loop. The relay mesh handles the fan-out. Full detail lives in
Transport to web & apps.
Two planes on the QUIC edge
The engine terminates a single QUIC listener that multiplexes two logical planes:| Plane | Protocol | Carries | Reached at |
|---|---|---|---|
| Control | QUIC + HTTP/3 | Session setup, agent config, call control, telemetry | portal.telequick.dev / agent.telequick.dev |
| Media | MoQT over WebTransport | Live audio tracks (publish / subscribe) | The same :443, tunneled through WebTransport |
:443 — MoQT rides inside
WebTransport alongside the HTTP/3 control traffic, so there is a single port and
a single certificate to open. Native SDKs can additionally dial a dedicated
media endpoint for the MoQT plane.
Converging the media plane onto the shared
:443 WebTransport port is the
current direction. A standalone media-over-QUIC port still exists for native
SDKs that dial the transport directly; it is the legacy rung, not the
default. WebSocket (control and data) and WebRTC (browser media) remain the
required fallbacks when QUIC or WebTransport is unavailable.The relay mesh
The engine runs one reactor per CPU core (shard-per-core), and calls are pinned to a core. When a track needs to reach subscribers on other cores — or on other hosts — the relay mesh does the fan-out:- Cross-core — a published track is broadcast to sibling cores on the same host through a lock-free ring, so a subscriber pinned elsewhere still receives every audio object.
- Cross-host — edges peer with each other and push tracks between hosts, so a
browser connected to one edge can subscribe to a call terminating on another.
The mesh is reachable at
relay.telequick.dev.
Related
Components
A closer look at each piece of the stack and what it owns.
Sessions, calls, tracks & streams
The object model behind the data path.
Transport to telephony
SIP trunking, numbers, ACD, and the call lifecycle.
Agent runtime
Bring your own ASR/LLM/TTS or speech-to-speech provider.
Deployment models
Managed cloud and on-prem self-hosting.
Transport to web & apps
How browser and mobile clients reach the stack over QUIC.