Trunk Resource
The Trunk resource represents a SIP Trunk in your Twilio account. A Trunk can have associated Credential Lists, IP Access Control Lists, Origination URLs, and Phone Numbers.
To learn how to create and use SIP Trunks, check out our getting started guide.
Trunk properties
Resource Properties in REST API format | |
---|---|
account_sid
|
The SID of the Account that created the Trunk resource. |
domain_name
|
The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and |
disaster_recovery_method
|
The HTTP method we use to call the |
disaster_recovery_url
|
The URL we call using the |
friendly_name
|
The string that you assigned to describe the resource. |
secure
|
Whether Secure Trunking is enabled for the trunk. If enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See Secure Trunking for more information. |
recording
|
The recording settings for the trunk. Can be: |
transfer_mode
|
The call transfer settings for the trunk. Can be: |
transfer_caller_id
|
Caller Id for transfer target. Can be: |
cnam_lookup_enabled
|
Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the SIP Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See CNAM Lookups for more information. |
auth_type
|
The types of authentication mapped to the domain. Can be: |
auth_type_set
|
Reserved. |
date_created
|
The date and time in GMT when the resource was created specified in RFC 2822 format. |
date_updated
|
The date and time in GMT when the resource was last updated specified in RFC 2822 format. |
sid
|
The unique string that we created to identify the Trunk resource. |
url
|
The absolute URL of the resource. |
links
|
The URLs of related resources. |
Create a Trunk resource
https://trunking.twilio.com/v1/Trunks
Parameters
Parameters in REST API format | |
---|---|
friendly_name
Optional
|
A descriptive string that you create to describe the resource. It can be up to 64 characters long. |
domain_name
Optional
|
The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and |
disaster_recovery_url
Optional
|
The URL we should call using the |
disaster_recovery_method
Optional
|
The HTTP method we should use to call the |
transfer_mode
Optional
|
The call transfer settings for the trunk. Can be: |
secure
Optional
|
Whether Secure Trunking is enabled for the trunk. If enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See Secure Trunking for more information. |
cnam_lookup_enabled
Optional
|
Whether Caller ID Name (CNAM) lookup should be enabled for the trunk. If enabled, all inbound calls to the SIP Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See CNAM Lookups for more information. |
transfer_caller_id
Optional
|
Caller Id for transfer target. Can be: |
Example 1
Fetch a Trunk resource
https://trunking.twilio.com/v1/Trunks/{Sid}
Parameters
Parameters in REST API format | |
---|---|
sid
Path
|
The unique string that we created to identify the Trunk resource to fetch. |
Example 1
Read multiple Trunk resources
https://trunking.twilio.com/v1/Trunks
Example 1
Update a Trunk resource
https://trunking.twilio.com/v1/Trunks/{Sid}
Parameters
Parameters in REST API format | |
---|---|
sid
Path
|
The unique string that we created to identify the OriginationUrl resource to update. |
friendly_name
Optional
|
A descriptive string that you create to describe the resource. It can be up to 64 characters long. |
domain_name
Optional
|
The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and |
disaster_recovery_url
Optional
|
The URL we should call using the |
disaster_recovery_method
Optional
|
The HTTP method we should use to call the |
transfer_mode
Optional
|
The call transfer settings for the trunk. Can be: |
secure
Optional
|
Whether Secure Trunking is enabled for the trunk. If enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See Secure Trunking for more information. |
cnam_lookup_enabled
Optional
|
Whether Caller ID Name (CNAM) lookup should be enabled for the trunk. If enabled, all inbound calls to the SIP Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See CNAM Lookups for more information. |
transfer_caller_id
Optional
|
Caller Id for transfer target. Can be: |
Example 1
Delete a Trunk resource
https://trunking.twilio.com/v1/Trunks/{Sid}
Parameters
Parameters in REST API format | |
---|---|
sid
Path
|
The unique string that we created to identify the Trunk resource to delete. |
Example 1
Need some help?
We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.