Docs Guides

Endpoints

An endpoint is one connection to your carrier or PBX, answered by one agent. This guide covers the two types, every setting, the states an endpoint goes through and how to change it from the panel or the API.

Registration or trunk

RegistrationTrunk
Use it for A carrier number or a PBX extension that devices register to.A carrier that sends calls to an address you give it, from fixed IP addresses.
Who connects RelayDock registers with your carrier's or PBX's registrar.Your carrier sends calls to your SIP address.
Authentication A SIP user name and password that RelayDock sends to the registrar.The carrier's IP addresses, a digest user name and password the carrier sends to RelayDock, or both.
Numbers Optional: one number, so that calls the carrier sends by number match.The numbers (DIDs) the carrier sends to this trunk, up to 100.
Outbound calls Through the registrar, with the same credentials.To the carrier's SIP address, by IP only or with digest authentication. Optional.

Carrier steps: Telnyx or any SIP trunk or PBX.

Settings

The panel's labels and the API's fields name the same settings. Fields in the API are nested under registration or trunk; the full list with types is in the API reference.

Every endpoint

In the panel API field What it does
Endpoint name name Shown in the panel, events and emails. Empty uses a name built from the template and the number, or from the trunk's carrier address.
Agent name agent_name The agent_name of the LiveKit agent that answers. Letters, digits, ., _ and -. Empty means a room opens without an agent.
Outbound caller numbers outbound_numbers The numbers your agents may call out with, at most 20. Empty uses the registration's number (or its SIP user name if that is a number or an extension), or the trunk's numbers.
Where should the audio flow? modeauto, relay_always or direct_only. See Audio modes.
Dial format dial_format How RelayDock passes the number your agent dials to the carrier. e164 keeps +E.164; national_tr (Turkish national) turns a +90 number into the national format with a leading 0. The template sets it; inbound calls aren't affected.
Endpoint enabled enabledWhen off, RelayDock stops registering and rejects calls for this endpoint.

Registration

In the panel API field What it does
Provider template provider Fills in the registrar, port, transport, dial format and the carrier's source addresses. Codes: telnyx, netgsm, 3cx, mikopbx, freepbx, other. Only Telnyx is verified with live traffic.
Registrar registration.registrar_hostYour carrier's or PBX's SIP address: a host name or a public IPv4 address.
Port registration.registrar_portFrom the template; 5060 by default.
Transport registration.transportudp, tcp or tls. Templates use TCP; prefer TCP or TLS over UDP.
SIP user name registration.usernameThe account or extension. Printable ASCII without spaces or < > " @ : ; ?.
Password registration.passwordStored encrypted and never returned. When you change other fields, leave it out to keep it.
Number registration.numberOptional, +E.164. If the carrier sends calls by number, this makes them match.
Auth user name registration.auth_usernameOnly if it differs from the SIP user name.
Domain registration.domainSIP domain if it differs from the registrar.
Realm registration.realmOnly if your provider needs it.
Expires (seconds) registration.expiresBetween 60 and 3600; default 300.
Source IPs registration.source_ips The addresses inbound calls may come from. Leave empty: RelayDock uses the template's addresses and the registrar's DNS records.

Trunk

In the panel API field What it does
Carrier IP addresses trunk.source_ips Addresses or CIDR blocks the carrier sends calls from, /16 or narrower, up to 50. Private, loopback and reserved blocks are not accepted.
Digest user name trunk.digest_username Only if the carrier authenticates with a user name. Unique across RelayDock. You need carrier IP addresses, a digest user, or both.
Digest password trunk.digest_passwordThe carrier's digest password. Stored encrypted and never returned.
Numbers (DIDs) trunk.numbersNumbers the carrier sends to this trunk, as +E.164.
Carrier SIP address trunk.outbound.hostTurn on Outbound calls to send your agents' calls here.
Port, Transport trunk.outbound.port, trunk.outbound.transportDefaults: 5060 and TCP.
Authentication trunk.outbound.auth_typeIP only (none) or Digest (digest, with username and password).

Numbers

  • Write numbers as +E.164, for example +12025550123. Spaces, dashes and parentheses are removed and a leading 00 becomes +.
  • A number belongs to one endpoint across RelayDock. Adding a number that another endpoint already has returns 409 number.taken, also when the two would match the same incoming number in another format.
  • Inbound calls match a number with or without the leading +. Outbound caller numbers are +E.164 numbers; on a registration endpoint they can also be a 2–15 digit extension.
  • The Numbers page in the panel (and GET /numbers) lists every number with its endpoint, agent and last inbound call.

Create an endpoint with the API

A registration endpoint with the Telnyx template, the same request as the panel's API keys tab:

curl -X POST "https://api.relaydock.io/api/v1/endpoints" \
  -H "Authorization: Bearer $RELAYDOCK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "kind": "registration",
    "provider": "telnyx",
    "agent_name": "my-agent",
    "registration": {
      "transport": "tcp",
      "username": "SIP_USERNAME",
      "password": "SIP_PASSWORD",
      "number": "+12025550123"
    }
  }'

A trunk endpoint that accepts calls from two carrier blocks and calls out over TLS with digest authentication:

curl -X POST "https://api.relaydock.io/api/v1/endpoints" \
  -H "Authorization: Bearer $RELAYDOCK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "kind": "trunk",
    "name": "Carrier trunk",
    "agent_name": "my-agent",
    "trunk": {
      "source_ips": [
        "198.51.100.0/24"
      ],
      "numbers": [
        "+12025550124",
        "+12025550125"
      ],
      "outbound": {
        "host": "sip.carrier.example",
        "port": 5061,
        "transport": "tls",
        "auth_type": "digest",
        "username": "CARRIER_USER",
        "password": "CARRIER_PASSWORD"
      }
    }
  }'

The response is the endpoint with its id, its SIP ID (sip_id) and provision_state. To wait until it is set up, follow the recipe.

States

Setup in LiveKit

provision_state tells you whether the endpoint's trunks and dispatch rule are in place in LiveKit:

State Meaning
waiting_targetNo LiveKit project is connected. The endpoint is set up as soon as you connect one.
pendingRelayDock is creating or updating the objects in LiveKit.
readyEverything is in place; calls can reach your agent and test calls can start.
error LiveKit rejected the setup. provision_error has LiveKit's error code; the diagnosis offers Resync. RelayDock retries every 10 minutes and emails you if it lasts.

Registration

For a registration endpoint, registration.state shows the registration itself:

State In the panel Meaning
registered Registered The registrar accepted the registration.
registering Registering A registration attempt is in progress.
failedThe cause, for example Auth failed The last attempt failed; last_code has the SIP code and the panel names the cause. See registration diagnosis.
disabled Disabled Attempts stopped after 3 authentication failures in a row. Fix the user name or password, then retry.
standby Standby Reported by a standby edge, which doesn't register. Not treated as down.
unknown Waiting No attempt yet. The edge starts registering within a few seconds of setup.

The endpoint list marks an endpoint with a problem when its diagnosis is serious (filter Problems, or GET /endpoints?state=problem). The endpoint page shows the diagnosis with one action; Troubleshooting lists them all. To read the state over the API:

curl "https://api.relaydock.io/api/v1/endpoints/3f6c2a1e-8b4d-4c7a-9e21-5d0b7f9a6c13" \
  -H "Authorization: Bearer $RELAYDOCK_API_KEY"

Change, disable or delete

  • Changes go live within seconds. Leave password fields out to keep them. Changing the agent, the audio mode or the outbound caller numbers, or turning the endpoint back on, updates the objects in LiveKit (provision_state goes back to pending); changing registration fields makes RelayDock register again.
  • Disable an endpoint to stop it without losing its settings:
    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 '{
        "enabled": false
      }'
  • Retry a stopped registration after fixing the credentials (registration endpoints only; up to 6 times a minute per team):
    curl -X POST "https://api.relaydock.io/api/v1/endpoints/3f6c2a1e-8b4d-4c7a-9e21-5d0b7f9a6c13/retry-registration" \
      -H "Authorization: Bearer $RELAYDOCK_API_KEY"
  • Delete an endpoint to stop its calls and remove its LiveKit trunks and rule. This can't be undone. Its numbers and digest user name are free for another endpoint right away.

Your plan limits how many endpoints you can have: the trial allows up to 5 and Starter up to 20; adding more returns 409 endpoint.plan_limit. See pricing.