Docs Guides
Audio modes
Signaling always passes through RelayDock. Audio can flow directly between your carrier and your agent platform, or through RelayDock's static IP. Each endpoint has a mode that decides.
The three modes
| Mode | API value | What it does |
|---|---|---|
| Automatic | auto | The default. Audio is direct unless the carrier offers a private address on an inbound call; then the call is relayed. Relayed calls are not encrypted on the LiveKit leg. |
| Always Relay | relay_always | Audio always flows through RelayDock's static IP, in both directions. The LiveKit leg is encrypted (SRTP). Use it for carriers that only accept media from known addresses. |
| Direct only | direct_only | Audio never passes through RelayDock. An inbound call whose carrier offers a private address is rejected with 488 private-sdp. |
How Automatic decides
On an inbound call, RelayDock looks at the audio address in the carrier's offer. If it is a private address (10.x, 172.16.x–172.31.x, 192.168.x or 100.64.x–100.127.x), LiveKit couldn't reach it, so RelayDock relays the call. This is common with a PBX behind NAT. The endpoint's events then show Call moved to Relay with the address the carrier offered.
Outbound calls in Automatic mode are direct. If your carrier needs the static IP for audio, use Always Relay.
What call records show
Each call record has mode (direct or relay) and, for relayed calls, relay_reason: auto when Automatic switched to Relay, always for Always Relay. The panel's call detail says Audio went through RelayDock with the reason, and the address the other side advertised.
Pricing
Your plan's included minutes count relayed minutes first, then direct ones. Minutes beyond your plan cost $0.0015 on Direct and $0.003 on Relay, and the month's minute charge is capped at $3 per call at your peak concurrency. See pricing.
Change the mode
In the panel, choose under Where should the audio flow? in the connection details when you add an endpoint, or later in its Settings tab. Over the API:
curl -X PATCH "https://api.relaydock.io/api/v1/endpoints/3f6c2a1e-8b4d-4c7a-9e21-5d0b7f9a6c13" \
-H "Authorization: Bearer $RELAYDOCK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"mode": "relay_always"
}'import os
import requests
response = requests.patch(
"https://api.relaydock.io/api/v1/endpoints/3f6c2a1e-8b4d-4c7a-9e21-5d0b7f9a6c13",
headers={"Authorization": f"Bearer {os.environ['RELAYDOCK_API_KEY']}"},
json={"mode": "relay_always"},
timeout=30,
)
response.raise_for_status()
print(response.json())const response = await fetch('https://api.relaydock.io/api/v1/endpoints/3f6c2a1e-8b4d-4c7a-9e21-5d0b7f9a6c13', {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${process.env.RELAYDOCK_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"mode": "relay_always"
}),
})
if (!response.ok)
throw new Error(`${response.status} ${await response.text()}`)
console.log(await response.json())Changing the mode updates the endpoint's trunks in LiveKit, because the encryption setting of the LiveKit leg depends on it. The change applies to new calls.