Skip to main content
A phone number is the entry and exit point for voice calls. Each number carries two independent slots — one inbound agent version and one outbound agent version — and is attached to exactly one trunk that brokers connectivity to the carrier. Calls flow over SIP through LiveKit, so the same number can answer incoming calls with one agent and originate outbound calls with another.

The model

Three objects make up the telephony layer:
ObjectWhat it is
Phone numberA purchased or imported number with independent inbound and outbound agent slots. Belongs to one trunk.
TrunkA SIP trunk that connects your org to a carrier. Either Anyreach-managed (Twilio) or bring-your-own-carrier (BYOC).
Inbound routing configAn optional per-org workflow that decides which agent answers an incoming call at call time.
A phone number record (/core/phone-numbers) has two slots that are set independently:
FieldTypeDefaultDescription
inbound_agent_version_idstringnoneAgent version that answers calls to this number.
outbound_agent_version_idstringnoneAgent version used when this number places calls.
trunk_idstringrequiredThe trunk that carries calls for this number.
outbound_shareableboolfalseWhether the number can be used as caller ID by other agents.
Setting one slot does not affect the other. A number can answer inbound calls without ever placing outbound calls, and vice versa.
 Caller ──▶ Carrier ──▶ Trunk ──▶ LiveKit SIP ──▶ inbound agent version
Outbound ◀── Carrier ◀── Trunk ◀── LiveKit SIP ◀── outbound agent version
Agents are reached over SIP. Each org has a dedicated inbound trunk that hosts agent SIP endpoints of the form sip:<agent-uuid>@<host>, and LiveKit bridges the carrier leg to the agent leg.

Trunks: managed vs BYOC

Every number sits on a trunk. There are two kinds.
Managed (Twilio)BYOC
ProviderAnyreach-operated Twilio accountYour own SIP carrier
managed_account_idsetnot set
How numbers are addedBought through Anyreach (purchase-number)Imported onto the trunk you create
Created/edited via APINo — managed trunks are provisioned by AnyreachYes — POST /core/trunks
Best forGetting started quickly with US local numbersKeeping existing carrier contracts and numbers
Managed trunks cannot be created, updated, or deleted through the API, and you cannot create a phone number directly against a managed trunk — buy numbers through the managed account instead. BYOC trunks you own are fully editable.
A BYOC outbound configuration carries the carrier’s SIP details:
FieldTypeDefaultDescription
addressstringrequiredCarrier SIP host to send calls to.
auth_usernamestringrequiredSIP auth username.
auth_passwordstringrequiredSIP auth password.
transportenumUDPSIP transport.
media_encryptionenumNONEMedia encryption setting.

Getting numbers

There are two ways to get a number onto a trunk:
Search the shared Anyreach Twilio account and purchase a number. Search defaults to country_code US and number type local; the search filters voice, SMS, MMS capability, area code, region, and postal code. Purchased numbers land on your managed trunk automatically.

Inbound routing

Once a number has an inbound agent version, every call to it reaches that agent. For static routing, that is all you need — the number maps to one agent. For dynamic routing, configure an inbound routing config for the org. It runs a workflow_definition at call time to pick the agent, with a fallback_agent_id / fallback_agent_version used when the workflow does not select one. There is one config per org, and it has an enabled flag (default true).
When to useChoose
Each number always answers with the same agentStatic — set inbound_agent_version_id on the number
The answering agent depends on caller, time, or other logicDynamic — enable an inbound routing config

Next steps

Buy a number

Search the Anyreach Twilio account and purchase a US local, voice-enabled number.

Assign agents to numbers

Set the inbound and outbound agent-version slots on a number.

Inbound routing

Route incoming calls statically or with a routing workflow.

SIP and BYOC

Bring your own carrier with a SIP trunk and import existing numbers.