Resource model
- Gateways are only needed for outbound calls. They are tried in ascending
priority, and a carrier failure that another gateway could fix moves on to the next one. - Carrier IPs are only needed for inbound calls. Bolna’s SIP edge refuses an INVITE from any address that is not on an active, inbound-enabled trunk’s carrier IP list.
- Numbers carry the agent that answers inbound calls to them. A number without an agent is answered by the trunk’s
default_inbound_agent_id. The same number is the caller ID for outbound calls.
Bolna’s connection details
GET /trunk/pop returns the values you configure at your carrier: the SIP domain and port to send inbound calls to, the transports the edge accepts, the signalling IPs to allowlist, and the RTP port range. They are the same for every trunk.
How calls use a trunk
Inbound. Your carrier sends the INVITE to Bolna’s SIP domain. The edge accepts it only from one of your carrier IPs, matches the called number (the Request-URI user part) to a number’se164 and then its destination_key, and answers with that number’s agent. The INVITE must carry an SDP offer.
Outbound. Set the agent’s telephony provider to trunk with the Update agent API ("agent_config": {"telephony_provider": "trunk"}), then call POST /call with one of your trunk numbers as from_phone_number. The trunk must be active, outbound-enabled and have at least one gateway. If the carrier challenges the call, Bolna answers with the trunk’s auth_username and auth_password.
A trunk’s channels caps its concurrent calls, inbound and outbound combined. An inbound call over the cap is refused with SIP 486 Busy Here; an outbound call over it waits in your call queue until a channel is free.
Endpoints
Trunks
Gateways and carrier IPs
Numbers
Calls and connection details
Limits and formats
Errors
Write endpoints return200, including the create endpoints. Error bodies take one of three shapes:
Trunks belong to your organisation and are shared by its members. A sub-account API key reaches only the trunks created under that sub-account, and an agent assigned to a number must belong to the same organisation and sub-account.
The
/sip-trunks endpoints are Legacy SIP trunks (deprecated). Existing legacy trunks keep working; use the /trunk endpoints for every new setup, and see Migrate to SIP trunks to move an existing one.
