Skip to main content

Trunks

Trunks

πŸ“„οΈ Create a trunk with every PBX setting

Creates a trunk with any field the PBX accepts. `type` may only be `netgsm` or `custom` (omitted: `netgsm` for Netgsm hosts, `custom` otherwise); `fct` and `fctmvno` are rejected with 422. `port` defaults to 5060, and `transport` to `transport-udp` when neither `inbound_identification` nor `inbound_pattern` is sent. `name`, `secret` and `host` are required unless `inbound_pattern` is sent; `permit` is required unless the host is the Netgsm SIP server. An `inbound_pattern` without `name` uses its prefix as the name. `tenantid`, `id`, `deny`, `field_policy` and `identification_mode` are rejected with 422. Creating a trunk is capped by the number of phone line packages the organization owns; every existing trunk except `fct` ones counts against it (`fctmvno` counts). No phone line package returns 403 (also when the package check cannot be completed); a full quota returns 422, and a second create running for the same organization returns 429 after waiting up to 5 seconds. A 429 is also returned when the PBX trunk limit for the organization is reached. Requires `api_user|trunk_create`.

πŸ“„οΈ Update a trunk

Partial update: only the fields sent change, every other field keeps its stored value; at least one field is required. `contact_user`, `from_domain`, `from_user`, `direct_media` and `media_encryption` can be cleared with null; `host`, `port` and `secret` cannot. `name`, `type`, `inbound_identification` and `inbound_pattern.prefix` cannot be changed and are rejected with 422, as are the engine fields. On `fct` and `fctmvno` trunks only the codec and call settings (allow, disallow, media_encryption, rel100, rtp_timeout, user_eq_phone, trust_id_inbound, send_pai, send_rpid, inband_progress) can change and any other field returns 422. Returns the updated trunk without its secret. Requires `api_user|trunk_update`.

πŸ“„οΈ Create an outbound trunk with minimal fields

Only `name`, `host` and `permit` are required. Without `secret` a strong random one is generated and returned once in the response. `port` defaults to 5060 and `transport` to `transport-udp`; every other setting keeps the PBX default. `type` is not accepted: it is `netgsm` for Netgsm hosts and `custom` otherwise. `type`, `inbound_identification`, `inbound_pattern` and the engine fields are rejected with 422. Creating a trunk is capped by the number of phone line packages the organization owns; every existing trunk except `fct` ones counts against it (`fctmvno` counts). No phone line package returns 403 (also when the package check cannot be completed); a full quota returns 422, and a second create running for the same organization returns 429 after waiting up to 5 seconds. A 429 is also returned when the PBX trunk limit for the organization is reached. Requires `api_user|trunk_create`.

πŸ“„οΈ Create an inbound trunk matched by the called number

Inbound calls whose called number starts with `prefix` and is `min_digits`..`max_digits` long land on this trunk. `prefix` must be one of GET /v1/trunks/available-prefixes; an unavailable one returns 422. `name` is required. Without `host` the PBX uses the Netgsm SIP server and fills `permit` itself, as it does whenever the host is the Netgsm SIP server; any other host requires `permit`. `port` defaults to 5060. Without `secret` a strong random one is generated and returned once. `type` is not accepted: it is `netgsm` for Netgsm hosts and `custom` otherwise. Creating a trunk is capped by the number of phone line packages the organization owns; every existing trunk except `fct` ones counts against it (`fctmvno` counts). No phone line package returns 403 (also when the package check cannot be completed); a full quota returns 422, and a second create running for the same organization returns 429 after waiting up to 5 seconds. A 429 is also returned when the PBX trunk limit for the organization is reached. Requires `api_user|trunk_create`.

πŸ“„οΈ Create an inbound trunk matched by the caller number

Inbound calls from `number` land on this trunk; the number becomes the trunk name, so `name` is rejected. `host` and `permit` are required. Without `secret` a strong random one is generated and returned once. `port` defaults to 5060. `type` is not accepted: it is `netgsm` for Netgsm hosts and `custom` otherwise. Creating a trunk is capped by the number of phone line packages the organization owns; every existing trunk except `fct` ones counts against it (`fctmvno` counts). No phone line package returns 403 (also when the package check cannot be completed); a full quota returns 422, and a second create running for the same organization returns 429 after waiting up to 5 seconds. A 429 is also returned when the PBX trunk limit for the organization is reached. Requires `api_user|trunk_create`.