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.
account_sid
type: SID<AC>The SID of the Account that created the Trunk resource.
^AC[0-9a-fA-F]{32}$
34
34
domain_name
type: stringThe unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and -
and must end with pstn.twilio.com
. See Termination Settings for more information.
disaster_recovery_method
type: enum<http-method>The HTTP method we use to call the disaster_recovery_url
. Can be: GET
or POST
.
GET
POST
disaster_recovery_url
type: string<uri>The URL we call using the disaster_recovery_method
if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from this URL and execute the instructions like any other normal TwiML call. See Disaster Recovery for more information.
secure
type: booleanWhether 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
type: objectThe recording settings for the trunk. Can be: do-not-record
, record-from-ringing
, record-from-answer
. If set to record-from-ringing
or record-from-answer
, all calls going through the trunk will be recorded. The only way to change recording parameters is on a sub-resource of a Trunk after it has been created. e.g./Trunks/[Trunk_SID]/Recording -XPOST -d'Mode=record-from-answer'
. See Recording for more information.
transfer_mode
type: enum<string>The call transfer settings for the trunk. Can be: enable-all
, sip-only
and disable-all
. See Transfer for more information.
disable-all
enable-all
sip-only
transfer_caller_id
type: enum<string>Caller Id for transfer target. Can be: from-transferee
(default) or from-transferor
.
from-transferee
from-transferor
cnam_lookup_enabled
type: booleanWhether 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
type: stringThe types of authentication mapped to the domain. Can be: IP_ACL
and CREDENTIAL_LIST
. If both are mapped, the values are returned in a comma delimited list. If empty, the domain will not receive any traffic.
date_created
type: string<date-time>The date and time in GMT when the resource was created specified in RFC 2822 format.
date_updated
type: string<date-time>The date and time in GMT when the resource was last updated specified in RFC 2822 format.
sid
type: SID<TK>The unique string that we created to identify the Trunk resource.
^TK[0-9a-fA-F]{32}$
34
34
POST https://trunking.twilio.com/v1/Trunks
FriendlyName
type: stringA descriptive string that you create to describe the resource. It can be up to 64 characters long.
DomainName
type: stringThe unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and -
and must end with pstn.twilio.com
. See Termination Settings for more information.
DisasterRecoveryUrl
type: string<uri>The URL we should call using the disaster_recovery_method
if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from the URL and execute the instructions like any other normal TwiML call. See Disaster Recovery for more information.
DisasterRecoveryMethod
type: enum<http-method>The HTTP method we should use to call the disaster_recovery_url
. Can be: GET
or POST
.
GET
POST
TransferMode
type: enum<string>The call transfer settings for the trunk. Can be: enable-all
, sip-only
and disable-all
. See Transfer for more information.
disable-all
enable-all
sip-only
Secure
type: booleanWhether 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.
CnamLookupEnabled
type: booleanWhether 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.
TransferCallerId
type: enum<string>Caller Id for transfer target. Can be: from-transferee
(default) or from-transferor
.
from-transferee
from-transferor
GET https://trunking.twilio.com/v1/Trunks/{Sid}
Sid
type: SID<TK>The unique string that we created to identify the Trunk resource to fetch.
^TK[0-9a-fA-F]{32}$
34
34
GET https://trunking.twilio.com/v1/Trunks
PageSize
type: integerHow many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Page
type: integerThe page index. This value is simply for client state.
0
POST https://trunking.twilio.com/v1/Trunks/{Sid}
Sid
type: SID<TK>The unique string that we created to identify the OriginationUrl resource to update.
^TK[0-9a-fA-F]{32}$
34
34
FriendlyName
type: stringA descriptive string that you create to describe the resource. It can be up to 64 characters long.
DomainName
type: stringThe unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and -
and must end with pstn.twilio.com
. See Termination Settings for more information.
DisasterRecoveryUrl
type: string<uri>The URL we should call using the disaster_recovery_method
if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from the URL and execute the instructions like any other normal TwiML call. See Disaster Recovery for more information.
DisasterRecoveryMethod
type: enum<http-method>The HTTP method we should use to call the disaster_recovery_url
. Can be: GET
or POST
.
GET
POST
TransferMode
type: enum<string>The call transfer settings for the trunk. Can be: enable-all
, sip-only
and disable-all
. See Transfer for more information.
disable-all
enable-all
sip-only
Secure
type: booleanWhether 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.
CnamLookupEnabled
type: booleanWhether 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.
TransferCallerId
type: enum<string>Caller Id for transfer target. Can be: from-transferee
(default) or from-transferor
.
from-transferee
from-transferor
DELETE https://trunking.twilio.com/v1/Trunks/{Sid}
Sid
type: SID<TK>The unique string that we created to identify the Trunk resource to delete.
^TK[0-9a-fA-F]{32}$
34
34