Trunk Object
This section goes over the parts of the Trunk object. Trunks hold settings that will determine how the system will communicate with an endpoint. Trunks belong to trunk groups.
Refer to our How It Works: Trunk Groups and Trunks section to learn more about what trunks are, what they are used for, and how you can work with them.
Trunk Object Attributes
The fields listed in the table below will be returned in a JSON object when a successful request has been made.
Attribute | Data Type | Description |
---|---|---|
acls | array of objects | The Access Control Lists associated with the trunk. Refer to the table below for more information. |
allow_forward | string | Determines how to handle 302 redirects from legB. Values accepted in this field are:
disabled . |
allow_transfer | boolean | Whether or not to allow transfer. |
asn_mode | string | Whether or not to allow PASSCALLERCSRC, PASSCALLEECSRC variables for ASN proxy. Values accepted in this field are:
disable . |
call_type | string | The call type. Values accepted in this field are:
regular . |
codec | string | The supported codec. Values accepted in this field are: alaw , g722 , g723 , g729 , gsm , opus8 , opus12 , opus16 , opus24 , opus48 , ulaw . The default value is null which means that the trunk will use one of the supported codecs from legA. |
endpoint_sid | string | The secure ID of the endpoint associated with this trunk. |
in_capacity | integer | The maximum number of simultaneous calls which the trunk can receive. Use the -1 value to disable receiving calls by the trunk. 0 means unlimited and is the default value. |
in_identity_format | string | Determines the format, in which the data will be sent to legB in the case the in_identity_mode / out_identity_mode is set to pass the RPID/PAI headers. This setting is only applicable when there is data to be sent. Values accepted in this field are:
passthrough . |
in_identity_mode | string | Controls when and how the information about Remote Party ID (RPID) and P-Asserted-Identity (PAI) headers is accepted when the trunk is receiving calls. Values accepted in this field are:
out_identity_mode parameter below for more information on this. The default value is passthrough . |
in_rfc_4694_mode read only | string | Controls whether the number portability parameters for the "tel" URI are accepted for the incoming leg. Values accepted in this field are:
cut_all . |
location_sid | string | Secure ID of the location object that identifies the Trunk object as belonging to a specific location. |
name | string | The trunk name. |
out_capacity | integer | The maximum number of simultaneous calls which the trunk can send. Use the -1 value to disable sending calls by the trunk. 0 means unlimited and is the default value. |
out_identity_mode | string | Controls whether Remote Party ID (RPID) and P-Asserted-Identity (PAI) headers are passed when the trunk is sending calls. The behavior depends on the in_identity_mode value and RPID/PAI headers presence, and is described in respect to the accepted values below.
passthrough . |
out_rfc_4694_mode read only | string | Controls whether the number portability parameters for the "tel" URI are passed to the outgoing leg. Values accepted in this field are:
cut_all . |
out_sip_ringing_max_ttl | integer | Time in seconds during which an outbound call will continue ringing trying to reach the other party before the call is dropped off. The default value is 180 . |
priority | integer | Allows to change the routing order for trunks inside a trunk group with the routing_type set to failover . Lower values have higher priority. The default value is 0 . |
relay_sip_headers | array | The list of the headers from the incoming leg that must be passed to the outgoing leg. This setting applies when the trunk is receiving calls. Regular expressions can be used instead of complete header names (e.g., the X-.* value will relay all the X-headers). |
transformations | array of objects | The transformations to apply to the trunk. Refer to the transformations section for more information. |
trunk_sid read only | string | The trunk secure ID. |
weight | integer | Allows to distribute the calls among the trunks inside a trunk group with the routing_type set to round_robin . Trunks with bigger values will receive more calls compared to trunks with smaller values. |
Sample Trunk Object
{
"acls": []
"allow_forward": "disabled",
"allow_transfer": false,
"asn_mode": "disable",
"call_type": "regular",
"codec": null,
"endpoint_sid": null,
"in_capacity": 0,
"in_identity_format": "passthrough",
"in_identity_mode": "passthrough",
"in_rfc_4694_mode": "cut_all",
"location_sid": null,
"name": "trunk01",
"out_capacity": 0,
"out_identity_mode": "passthrough",
"out_rfc_4694_mode": "cut_all",
"priority": 0,
"relay_sip_headers": [],
"transformations": [],
"trunk_sid": "4c51c85c-5355-4a91-bf1e-f33d731bcfa9",
"weight": 0
}
Please note, that identity information (the in_identity_mode
and out_identity_mode
parameters) is supported using either RPID or PAI headers. However, when placing the outbound call leg, the PAI format will always be used for sending.
ACL Object
Attribute | Data Type | Description |
---|---|---|
access_control_rules | array | The list of access control rules secure IDs. Refer to the Access Control Rule object for more information about access control rules. |
direction | string | The direction for the access control list. Values accepted in this field are:
|
sms_action_false read only | string | For the Trunk Object this field is always |
sms_action_true read only | string | For the Trunk Object this field is always |
voice_action_false | string | The action to be executed for calls if no access control rules are applied. Values accepted in this field are:
|
voice_action_true | string | The action to be executed for calls if any access control rules are applied. Values accepted in this field are:
|