Trunks are used for PBX interaction with third-party SIP servers. Interoperability means routing outgoing calls and accepting incoming calls via DID.
Trunks are authorized in two ways:
If the call came from an address from the "super_trunk_ip" list, then, depending on the "any_extension/any_did" parameters, the call immediately goes to the desired extension.
If the address is not in "super_trunk_ip" and the call came to a DID, then it is checked whether this DID belongs to this trunk (according to "network_permission_group_id") and is passed on the extensions only in this case.
Description of data structures
Name | Type | Description | Required | Default value |
---|---|---|---|---|
|
| The name of the trunk | yes | |
|
| The direction of the trunk. The trunk can be incoming (value “in”), in which case incoming calls to DID can be received through the trunk, outgoing (value “out”), in which case outgoing calls can be routed through the trunk, and bidirectional (value “all”). | no | |
|
| The unique ID of the trunk. Read only. | - | - |
|
| The identifier of a group of trusted networks from which requests are allowed for this trunk. Applies to trunks with in and all direction | yes, if trunk direction is in or all | null |
|
| The address of the SIP server to which the call will be sent according to the routing rules. Applies to trunks with out and all directions. Specified as host:port. Host can be a domain name, ":port" is optional (5060 if not present). If it is necessary to use tcp protocol, then "host:port;tranport=tcp" | yes, if trunk direction is out or all | null |
|
| The status of the trunk for receiving incoming calls. If the parameter is set to blocked, then the system will return an error on an attempt to call the DID of this trunk. | no | blocked |
|
| The status of the trunk for receiving outgoing calls. If the parameter is set to blocked, then an attempt to make an external call through this trunk will fail. | no | blocked |
|
| Enable (“yes” value) or disable (“no” value) sbc mode for the trunk. If SBC mode is enabled, the media for calls going through the trunk will go through the same address as the SIP messages. | no | |
|
| The number of characters that will be removed from the beginning of the number when an outgoing call is sent through this trunk. | no | null |
|
| The prefix that will be added to the beginning of the number when sending an outgoing call through this trunk. | no | null |
|
| The username for authorization when sending an outgoing call through this trunk. | no | null |
|
| The user password for authorization when sending an outgoing call through this trunk. | no | null |
|
| The username in the “From” field when sending an outgoing call through this trunk. | no | null |
|
| The domain in the “From” field when sending an outgoing call through this trunk. | no | null |
|
| If the parameter is set to "yes", then when sending an outgoing call through the trunk to an external SIP server, the Ringme-user header will be added to the INVITE packet, which will contain the full name of the extension from which the call is made, in the format with a domain prefix: domain_prefix*client_prefix*extension_number | no | yes |
|
| A list of addresses in the form ip[:port] to check if calls from them can be used to call to any DID or extension. Addresses are unique within the entire PBX. | no | [] |
|
| If the call is from "super_trunk_ip", to a global extension (xxxx*xxx*xxx), then it is allowed if the parameter is set to "yes". | no | no |
|
| If the call is from "super_trunk_ip", to a DID number, then it is allowed if the parameter value is "yes". | no | no |
|
| The maximum number of simultaneous channels used by the trunk. Incoming/outgoing are summarized. With a value of "0" there is no limit. | no | 0 |
|
| On an incoming call from the trunk, converts the A-number according to the corresponding dialing rules | no | null |
|
| On a call going to the trunk, converts the A-number (“From” field) according to the corresponding dialing rules | no | null |
|
| When the " For example, "address" = srvtest.ucom4b.com $ host -t srv _sip._udp.srvtest.ucom4b.com 2. For srvtest.ucom4b.com $ host -t srv _sip._udp.srvtest.ucom4b.com 3. There is more than one A record for srvtest.ucom4b.com but no SRV records: calls will leave and reserve on A records randomly
| no | false |
Resources of the "Admin" section
POST /admin/trunk/
Create a trunk
JSON parameters
Response fields
GET /admin/trunk/
Get a trunk list
Request parameters
Name | Type |
---|---|
|
|
|
|
Response fields
PUT /admin/trunk/{id
}
Update a trunk
URL Parameters
Name | Type |
---|---|
|
|
JSON parameters
Response fields
GET /admin/trunk/{id
}
Get a trunk by id
URL Parameters
Name | Type |
---|---|
|
|
Response fields
DELETE /admin/trunk/{id
}
Delete a trunk
URL Parameters
Name | Type |
---|---|
|
|