Docs Guides
Test calls and inbound checks
Two checks cover both directions of an endpoint. A test call is placed from your LiveKit project through RelayDock and your carrier. An inbound check listens while you call your number. Both show each step and where a call stopped.
Outbound: test call
On the endpoint, choose Test call, enter the Number to call and choose Call. RelayDock asks LiveKit to call the number through the endpoint's outbound trunk, with the endpoint's first outbound caller number. If the endpoint has an agent, it is dispatched to the call's room, so the person who answers talks to your agent.
- The endpoint must be enabled, set up in LiveKit (
provision_stateready) and have at least one outbound caller number. Otherwise the call isn't started:409 test_call.endpoint_not_ready. - Call a +E.164 number, or an extension on a registration endpoint. Over the API you can pick the caller with
caller; it must be one of the endpoint's outbound caller numbers. - The phone rings for up to 30 seconds and the call ends after 2 minutes at most.
- Test calls don't count toward your RelayDock minutes. They use minutes in your LiveKit project and at your carrier.
The steps
| Step | When it succeeds | When it fails |
|---|---|---|
livekit.dial | LiveKit started the call | LiveKit couldn't start the call: check the LiveKit project's state and the endpoint's outbound trunk. |
edge.auth | RelayDock verified the credentials | RelayDock rejected the call with a reason, for example caller-not-allowed. See the reasons. |
carrier.answer | The other side answered · 200 OK | The other side rejected the call with the carrier's SIP code: the call reached your carrier, which refused it. |
call.end | Call ended with the duration | Skipped when no call was set up. |
Inbound: listen for a call
On the endpoint, choose Test call, then Inbound and Listen for a call. Within five minutes, call one of the endpoint's numbers from your phone (for a registration, the number your carrier routes to it). The first call that arrives is matched to the check. It is a real call: it reaches your agent and counts like any other call.
- The endpoint must be enabled (
409 inbound_check.disabled). - A trunk needs at least one number (
409 inbound_check.no_number). - One check listens per endpoint at a time (
409 inbound_check.pending).
The steps
| Step | When it succeeds | When it fails |
|---|---|---|
carrier.invite | The call reached RelayDock | No call reached RelayDock within the window: check your carrier's routing to your SIP address, the allowed IPs and the inbound digest password. |
edge.auth | RelayDock verified the credentials | RelayDock rejected the call: the carrier's IP isn't allowed, its digest user name doesn't match, or it dialed a number the endpoint doesn't have. The step shows the address and the dialed number. |
livekit.answer | Your LiveKit agent answered · 200 OK | LiveKit didn't answer with LiveKit's SIP code: check the LiveKit project and the agent name. |
call.end | Call ended with the duration | Skipped when no call was set up. |
What to do for each rejection is in Troubleshooting.
Over the API
Both checks return 202 with a test call object right away. Read it again with its id until state is completed or failed; each step in steps is pending, ok, bad or skipped.
Start a test call
curl -X POST "https://api.relaydock.io/api/v1/endpoints/3f6c2a1e-8b4d-4c7a-9e21-5d0b7f9a6c13/test-calls" \
-H "Authorization: Bearer $RELAYDOCK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+12025550147"
}'import os
import requests
response = requests.post(
"https://api.relaydock.io/api/v1/endpoints/3f6c2a1e-8b4d-4c7a-9e21-5d0b7f9a6c13/test-calls",
headers={"Authorization": f"Bearer {os.environ['RELAYDOCK_API_KEY']}"},
json={"to": "+12025550147"},
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/test-calls', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.RELAYDOCK_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"to": "+12025550147"
}),
})
if (!response.ok)
throw new Error(`${response.status} ${await response.text()}`)
console.log(await response.json())Start an inbound check
curl -X POST "https://api.relaydock.io/api/v1/endpoints/3f6c2a1e-8b4d-4c7a-9e21-5d0b7f9a6c13/inbound-checks" \
-H "Authorization: Bearer $RELAYDOCK_API_KEY"import os
import requests
response = requests.post(
"https://api.relaydock.io/api/v1/endpoints/3f6c2a1e-8b4d-4c7a-9e21-5d0b7f9a6c13/inbound-checks",
headers={"Authorization": f"Bearer {os.environ['RELAYDOCK_API_KEY']}"},
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/inbound-checks', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.RELAYDOCK_API_KEY}`,
},
})
if (!response.ok)
throw new Error(`${response.status} ${await response.text()}`)
console.log(await response.json()) The response lists the endpoint's numbers to call and expires_at, the end of the listening window.
Read the result
curl "https://api.relaydock.io/api/v1/test-calls/9d2e6f41-3c8b-4a7e-b5d0-1e6f2a9c7b38" \
-H "Authorization: Bearer $RELAYDOCK_API_KEY"import os
import requests
response = requests.get(
"https://api.relaydock.io/api/v1/test-calls/9d2e6f41-3c8b-4a7e-b5d0-1e6f2a9c7b38",
headers={"Authorization": f"Bearer {os.environ['RELAYDOCK_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
print(response.json())const response = await fetch('https://api.relaydock.io/api/v1/test-calls/9d2e6f41-3c8b-4a7e-b5d0-1e6f2a9c7b38', {
headers: {
'Authorization': `Bearer ${process.env.RELAYDOCK_API_KEY}`,
},
})
if (!response.ok)
throw new Error(`${response.status} ${await response.text()}`)
console.log(await response.json())A complete polling script is in the recipes; every field is in the reference.
Limits
A team can start 5 test calls and inbound checks together in 10 minutes, and 100 in 24 hours. Beyond that the API returns 429 rate_limited with Retry-After.