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.
The Trunk object represents a single telephony connection within a trunk group. Each trunk defines the specific parameters and routing details used to send or receive calls through CarrierX.
A trunk can be configured for inbound, outbound, or bidirectional communication and includes detailed settings for protocols, authentication, capacity limits, and connection endpoints.
Trunks inherit certain attributes from their parent trunk group but can also override group-level settings to define unique behaviors such as codec preferences, SIP signaling details, and routing paths.
This object provides the detailed configuration that enables fine-grained control over how calls are routed through the CarrierX network.
Refer to How It Works: Trunk Groups and Trunks 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 read only | string | Determines how to handle 302 redirects from leg B. Values accepted in this field are:
disabled. |
| allow_transcoding | boolean | Whether transcoding is allowed for calls handled by this trunk. The default value is true. |
| allow_transfer read only | enum | Determines whether the trunk allows call transfer, using SIP REFER. This field supports blind transfer only; attended transfer is not supported. Values accepted in this field are:
disabled. |
| asn_mode | string | Controls the exchange of active speaker notification (ASN) data on the trunk. ASN is used between the conference bridge and the recording server; the bridge normally writes ASN data and the recording server reads it. Values accepted in this field are:
disable. |
| call_type | string | The call type. Values accepted in this field are:
regular. |
| codec | string | A legacy codec setting. The value set in this field is always prepended to both in_codec and out_codec, regardless of whether those fields are explicitly set. Values accepted in this field are: alaw, amrwb, 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 leg A. |
| 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_codec | string | Defines the ordered list of codecs allowed and prioritized for inbound calls and used to construct the codec list for the outgoing leg when the incoming leg (leg A) does not use a wideband codec. The value is a semicolon-separated string of codec names (e.g., This setting determines which codecs can be used and their priority used when generating the codec list for the outgoing leg (leg B). Uses the same set of supported codec values as the |
| in_codec_list | string | Controls how the codec list is constructed for the outgoing leg (leg B) when the incoming leg (leg A) does not use a wideband codec. If a wideband codec is present on leg A,
|
| in_codec_priority | string | Defines codec negotiation priority. Values accepted in this field are:
|
| in_codec_wideband | string | Defines the ordered list of codecs allowed and prioritized for inbound calls and used to construct the codec list for the outgoing leg when the incoming leg (leg A) uses a wideband codec. The value is a semicolon-separated string of codec names (e.g., This setting determines which codecs can be used and their priority used when generating the codec list for the outgoing leg (leg B) in wideband scenarios. Uses the same set of supported codec values as the |
| in_codec_wideband_list | string | Controls how the codec list is constructed for the outgoing leg (leg B) when the incoming leg (leg A) uses a wideband codec. If leg A does not use a wideband codec,
When constructing the final codec list for leg B, codecs selected via |
| in_identity_format | string | Determines the format in which the data will be sent to leg B 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 Routing 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_codec | string | Defines the ordered list of codecs for outbound calls from the trunk. The value is a semicolon-separated string of codec names in priority order. Uses the same set of supported codec values as the codec field. If any value is set in the codec field, it will be prepended to this field's 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). |
| ring_control | string | Controls how SIP 183 (Session Progress) and SIP 180 (Ringing) responses are relayed during call setup. Some carriers send a SIP 183 with no media followed by a SIP 180, which can cause the caller to hear silence; this setting adjusts relay behavior to avoid that. Values accepted in this field are:
|
| 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. The default value is 0. A weight of 0 is treated as 1, so you cannot use this field to stop calls to a trunk. |
Wideband Codecs
A wideband codec is any of the following:
amrwb, g722, isac16, isac32, silk16, silk24, opus16, opus24, opus48.
In most cases, including at least one narrowband codec (ulaw or alaw) is recommended to prevent negotiation failures.
Example Trunk Object
{
"acls": [],
"allow_forward": "disabled",
"allow_transcoding": true,
"allow_transfer": "disabled",
"asn_mode": "disable",
"call_type": "regular",
"codec": null,
"endpoint_sid": null,
"in_capacity": 0,
"in_codec": "ulaw;alaw",
"in_codec_list": "passthrough",
"in_codec_priority": "leg_a_avoid_transcoding",
"in_codec_wideband": "amrwb;g722",
"in_codec_wideband_list": "full_if_wideband",
"in_identity_format": "passthrough",
"in_identity_mode": "passthrough",
"in_rfc_4694_mode": "cut_all",
"location_sid": null,
"name": "trunk01",
"out_capacity": 0,
"out_codec": null,
"out_identity_mode": "passthrough",
"out_rfc_4694_mode": "cut_all",
"priority": 0,
"relay_sip_headers": [],
"ring_control": "passthrough",
"rtp_timeout": 0,
"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
The ACL (Access Control List) object defines the access rules applied to an individual trunk. It includes the same fields as the trunk group ACL — access_control_rules, direction, and the action fields — but applies them specifically to a single trunk connection.
A trunk-level ACL can override the trunk group's ACL to provide more granular control. As with trunk groups, the SMS-related fields are always null because trunks handle only voice traffic. The voice_action_true and voice_action_false fields define the result of rule matches for voice calls.
Refer to the ACL Object for the full attribute set and behavior.
| 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:
|