Menu

Expand
Rate this page:

ByocTrunk Resource

The ByocTrunks resource describes a trunk that can be configured to send/receive traffic to/from a PSTN Carrier.

ByocTrunk properties

Resource Properties in REST API format
account_sid
sid<AC> Not PII

The SID of the Account that created the BYOC Trunk resource.

sid
sid<BY> Not PII

The unique string that that we created to identify the BYOC Trunk resource.

friendly_name
string Not PII

The string that you assigned to describe the resource.

voice_url

The URL we call using the voice_method when the BYOC Trunk receives a call.

voice_method
http_method Not PII

The HTTP method we use to call voice_url. Can be: GET or POST.

voice_fallback_url

The URL that we call when an error occurs while retrieving or executing the TwiML requested from voice_url.

voice_fallback_method
http_method Not PII

The HTTP method we use to call voice_fallback_url. Can be: GET or POST.

status_callback_url

The URL that we call to pass status parameters (such as call ended) to your application.

status_callback_method
http_method Not PII

The HTTP method we use to call status_callback_url. Either GET or POST.

cnam_lookup_enabled
boolean Not PII

Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC 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.

connection_policy_sid
sid<NY> Not PII

The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure.

from_domain_sid
sid<SD> Not PII

The SID of the SIP Domain that should be used in the From header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to "call back" an incoming call, configure this with a SIP Domain to ensure proper routing. If not configured, the from domain will default to "sip.twilio.com".

date_created
date_time<iso8601> Not PII

The date and time in GMT that the resource was created specified in RFC 2822 format.

date_updated
date_time<iso8601> Not PII

The date and time in GMT that the resource was last updated specified in RFC 2822 format.

url
url Not PII

The absolute URL of the resource.

Create a ByocTrunk resource

post
https://voice.twilio.com/v1/ByocTrunks
Parameters
Parameters in REST API format
friendly_name
Optional
post string Not PII

A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long.

voice_url
Optional
post url PII MTL: 30 DAYS

The URL we should call when the BYOC Trunk receives a call.

voice_method
Optional
post http_method Not PII

The HTTP method we should use to call voice_url. Can be: GET or POST.

voice_fallback_url
Optional
post url PII MTL: 30 DAYS

The URL that we should call when an error occurs while retrieving or executing the TwiML from voice_url.

voice_fallback_method
Optional
post http_method Not PII

The HTTP method we should use to call voice_fallback_url. Can be: GET or POST.

status_callback_url
Optional
post url PII MTL: 30 DAYS

The URL that we should call to pass status parameters (such as call ended) to your application.

status_callback_method
Optional
post http_method Not PII

The HTTP method we should use to call status_callback_url. Can be: GET or POST.

cnam_lookup_enabled
Optional
post boolean Not PII

Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC 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.

connection_policy_sid
Optional
post sid<NY> Not PII

The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure.

from_domain_sid
Optional
post sid<SD> Not PII

The SID of the SIP Domain that should be used in the From header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to "call back" an incoming call, configure this with a SIP Domain to ensure proper routing. If not configured, the from domain will default to "sip.twilio.com".

Example 1
Loading Code Sample...
        
        

        Create Byoc Trunk

        Fetch a ByocTrunk resource

        get
        https://voice.twilio.com/v1/ByocTrunks/{Sid}
        Parameters
        Parameters in REST API format
        sid
        Path
        get sid<BY> Not PII

        The Twilio-provided string that uniquely identifies the BYOC Trunk resource to fetch.

        Example 1
        Loading Code Sample...
              
              

              Fetch Byoc Trunk

              Read multiple ByocTrunk resources

              get
              https://voice.twilio.com/v1/ByocTrunks
              Example 1
              Loading Code Sample...
                    
                    

                    Read Byoc Trunk

                    Update a ByocTrunk resource

                    post
                    https://voice.twilio.com/v1/ByocTrunks/{Sid}
                    Parameters
                    Parameters in REST API format
                    sid
                    Path
                    post sid<BY> Not PII

                    The Twilio-provided string that uniquely identifies the BYOC Trunk resource to update.

                    friendly_name
                    Optional
                    post string Not PII

                    A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long.

                    voice_url
                    Optional
                    post url PII MTL: 30 DAYS

                    The URL we should call when the BYOC Trunk receives a call.

                    voice_method
                    Optional
                    post http_method Not PII

                    The HTTP method we should use to call voice_url

                    voice_fallback_url
                    Optional
                    post url PII MTL: 30 DAYS

                    The URL that we should call when an error occurs while retrieving or executing the TwiML requested by voice_url.

                    voice_fallback_method
                    Optional
                    post http_method Not PII

                    The HTTP method we should use to call voice_fallback_url. Can be: GET or POST.

                    status_callback_url
                    Optional
                    post url PII MTL: 30 DAYS

                    The URL that we should call to pass status parameters (such as call ended) to your application.

                    status_callback_method
                    Optional
                    post http_method Not PII

                    The HTTP method we should use to call status_callback_url. Can be: GET or POST.

                    cnam_lookup_enabled
                    Optional
                    post boolean Not PII

                    Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC 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.

                    connection_policy_sid
                    Optional
                    post sid<NY> Not PII

                    The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure.

                    from_domain_sid
                    Optional
                    post sid<SD> Not PII

                    The SID of the SIP Domain that should be used in the From header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to "call back" an incoming call, configure this with a SIP Domain to ensure proper routing. If not configured, the from domain will default to "sip.twilio.com".

                    Example 1
                    Loading Code Sample...
                          
                          

                          Update Byoc Trunk

                          Delete a ByocTrunk resource

                          delete
                          https://voice.twilio.com/v1/ByocTrunks/{Sid}
                          Parameters
                          Parameters in REST API format
                          sid
                          Path
                          delete sid<BY> Not PII

                          The Twilio-provided string that uniquely identifies the BYOC Trunk resource to delete.

                          Example 1
                          Loading Code Sample...
                                
                                

                                Delete Byoc Trunk

                                Rate this page:

                                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.

                                Loading Code Sample...
                                      
                                      
                                      

                                      Thank you for your feedback!

                                      Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

                                      Sending your feedback...
                                      🎉 Thank you for your feedback!
                                      Something went wrong. Please try again.

                                      Thanks for your feedback!

                                      thanks-feedback-gif