ExoVoIPDeveloper guide

Trunks

Trunks (SIP trunks) connect the phone system to telephone carriers. A tenant can use its own trunks as well as shared trunks provided by Exobyte. Scopes trunks:read / trunks:write.

Adding a trunk

curl -s -X POST https://centralino.exovoip.it/api/v1/trunks \
  -H "X-API-Key: $EXOPBX_API_KEY" -H "Content-Type: application/json" \
  -d '{"name":"Linea principale","registration":"outbound","host":"sip.provider.example",
       "username":"0981123456","secret":"password-del-provider","codecs":["alaw","g722"]}'
FieldDescription
registrationoutbound (the phone system registers with the carrier), inbound (the carrier registers with the phone system), none (IP-based authentication)
host, port, transportCarrier server and transport (udp, tcp, tls)
username, secretCredentials; the secret is never returned (hasSecret)
codecsCodecs in order of preference (e.g. alaw, g722)
maxChannelsMaximum concurrent calls on the trunk

Network verification

When a trunk is created or modified, its server addresses are compared with those of other trunks. If they overlap with trunks of other tenants or shared trunks, the trunk stays pending verification by Exobyte (approval.status = pending_approval) and does not receive calls until approved. The outcome is shown in the response (approval, overlaps).

Status and monitoring

GET /v1/trunks reports a summary status (registered, unregistered, rejected, unknown); real-time details (registration with reason, reachability, latency, active calls) are available in GET /v1/live/trunks and in trunk.state events.

curl -s https://centralino.exovoip.it/api/v1/trunks -H "X-API-Key: $EXOPBX_API_KEY"
curl -s https://centralino.exovoip.it/api/v1/live/trunks -H "X-API-Key: $EXOPBX_API_KEY"

A trunk used by numbers or outbound routes cannot be deleted: 409 IN_USE.

Shared trunks (platform)

Shared trunks (tenantId: null) can be created and modified only with global keys. Without X-Tenant-Id the list shows all platform trunks; the verification queue is at GET /v1/trunks/approvals (scope security:read), with approval and rejection with a reason.

Endpoints

RequestScopeSDK method
GET /v1/trunks/approvalssecurity:readtrunks.approvals()
POST /v1/trunks/:id/approvesecurity:writetrunks.approve()
POST /v1/trunks/:id/rejectsecurity:writetrunks.reject()
GET /v1/trunkstrunks:readtrunks.list()
POST /v1/trunkstrunks:writetrunks.create()
GET /v1/trunks/:idtrunks:readtrunks.get()
PATCH /v1/trunks/:idtrunks:writetrunks.update()
DELETE /v1/trunks/:idtrunks:writetrunks.delete()