Bolcho Docs Back to app

Telephony

SIP trunks

Bring your own carrier over SIP. A trunk holds your carrier's gateways (termination/origination), auth, and advanced dialing options. Provisioning sets up the underlying LiveKit SIP trunks + dispatch rule. Every number you add to a trunk becomes a callable Phone number.

GET/telephony/trunks agents:read

List SIP trunks

List trunks with their gateways, status (active/pending), and attached numbers.

Example request

bash
curl https://api.bolchoai.in/v1/telephony/trunks -H "Authorization: Bearer $VOXA_API_KEY"
POST/telephony/trunks workspace:admin

Create SIP trunk

Create a trunk and provision the LiveKit SIP inbound/outbound trunks + dispatch rule. Saves as status=pending if LiveKit SIP isn't reachable yet (re-provision later).

Body

name*stringTrunk name.
gateways*Gateway[]One or more SIP gateways (see fields).
gateways[].ipOrDomain*stringCarrier SIP host or IP, e.g. sip.telnyx.com.
gateways[].portnumberSIP port (default 5060).
gateways[].netmasknumberCIDR netmask for inbound allow-list (default 32).
gateways[].protocolenumudp | tcp | tls (outbound transport).
gateways[].inboundbooleanAccept inbound calls on this gateway.
gateways[].outboundbooleanUse this gateway for outbound calls.
authUsernamestringSIP digest auth username.
authPasswordstringSIP digest auth password.
techPrefixstringTech prefix prepended to outbound numbers.
leadingPlusbooleanForce a leading + on outbound numbers.

Example request

bash
curl -X POST https://api.bolchoai.in/v1/telephony/trunks -H "Authorization: Bearer $VOXA_API_KEY" -H "Content-Type: application/json" \
  -d '{
    "name": "Telnyx",
    "gateways": [{ "ipOrDomain": "sip.telnyx.com", "port": 5060, "protocol": "udp", "inbound": true, "outbound": true }],
    "authUsername": "myuser",
    "authPassword": "mypass"
  }'

Response

json
{ "id": "…", "status": "active", "livekitOutboundTrunkId": "ST_…", "hasPassword": true }
PATCH/telephony/trunks/{id} workspace:admin

Update SIP trunk

Update gateways/auth/advanced; re-provisions LiveKit SIP.

Path parameters

id*uuidTrunk id.

Example request

bash
curl -X PATCH https://api.bolchoai.in/v1/telephony/trunks/$ID \
  -H "Authorization: Bearer $VOXA_API_KEY"
POST/telephony/trunks/{id}/provision workspace:admin

Re-provision trunk

Re-run LiveKit SIP provisioning (e.g. after deploying SIP). Flips a pending trunk to active.

Path parameters

id*uuidTrunk id.

Example request

bash
curl -X POST https://api.bolchoai.in/v1/telephony/trunks/$ID/provision \
  -H "Authorization: Bearer $VOXA_API_KEY"
DELETE/telephony/trunks/{id} workspace:admin

Delete SIP trunk

Tear down the LiveKit SIP resources and delete the trunk (its numbers cascade).

Path parameters

id*uuidTrunk id.

Example request

bash
curl -X DELETE https://api.bolchoai.in/v1/telephony/trunks/$ID \
  -H "Authorization: Bearer $VOXA_API_KEY"