NAME

Twilio::Rest::Voice::V1::ByocTrunk - The ByocTrunk resource

SYNOPSIS

my $client = Twilio::Rest::Client->new($account_sid, $auth_token);

my $byoc_trunk = $client->voice->v1->byoc_trunks->create(\%options);
for my $byoc_trunk ($client->voice->v1->byoc_trunks->read({}, 20)) {
  ...
}
my $byoc_trunk = $client->voice->v1->byoc_trunks($sid)->fetch;
$client->voice->v1->byoc_trunks($sid)->update(\%options);
$client->voice->v1->byoc_trunks($sid)->delete;

DESCRIPTION

BYOC Trunks allow you to bring your own voice carrier to Twilio, enabling your calls to use our Programmable Voice APIs.

This file holds ByocTrunkList, ByocTrunkPage, ByocTrunkContext and ByocTrunkInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.

ByocTrunkList

Returned by $client->voice->v1->byoc_trunks. See also Twilio::ListResource.

create

my $byoc_trunk = $client->voice->v1->byoc_trunks->create(\%options);

Returns a ByocTrunkInstance.

The options are:

cnam_lookup_enabled

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

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

friendly_name

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

from_domain_sid

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".

status_callback_method

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

status_callback_url

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

voice_fallback_method

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

voice_fallback_url

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

voice_method

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

voice_url

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

read

my @records = $client->voice->v1->byoc_trunks->read(\%options, $limit, $page_size);

Returns the records as a list, fetching as many pages as it needs.

stream

my $stream = $client->voice->v1->byoc_trunks->stream(\%options, $limit, $page_size);

Takes the same arguments as "read", and returns a Twilio::Stream.

page

my $page = $client->voice->v1->byoc_trunks->page(\%options, $page_size, $page_token, $page_number);

Fetches one page, and returns a Twilio::Page.

get_page

my $page = $client->voice->v1->byoc_trunks->get_page($url);

Fetches the page at a URL given by Twilio.

get_context

my $context = $client->voice->v1->byoc_trunks->get_context($sid);

Returns a ByocTrunkContext, and makes no request.

ByocTrunkPage

A Twilio::Page of ByocTrunkInstance objects.

records_key

build_instance

Used by Twilio::Page.

ByocTrunkContext

Returned by $client->voice->v1->byoc_trunks($sid). It makes no request until one of these methods is called.

fetch

my $byoc_trunk = $client->voice->v1->byoc_trunks($sid)->fetch;

Returns a ByocTrunkInstance.

update

my $byoc_trunk = $client->voice->v1->byoc_trunks($sid)->update(\%options);

Returns a ByocTrunkInstance.

The options are:

cnam_lookup_enabled

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

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

friendly_name

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

from_domain_sid

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".

status_callback_method

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

status_callback_url

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

voice_fallback_method

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

voice_fallback_url

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

voice_method

The HTTP method we should use to call voice_url One of GET or POST.

voice_url

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

delete

$client->voice->v1->byoc_trunks($sid)->delete;

Returns true.

ByocTrunkInstance

See also Twilio::InstanceResource.

It has fetch, update and delete, which work as they do on the context.

Its fields are:

account_sid

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

cnam_lookup_enabled

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

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

date_created

The date and time in GMT that the resource was created specified in RFC 2822 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.

date_updated

The date and time in GMT that the resource was last updated specified in RFC 2822 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.

friendly_name

The string that you assigned to describe the resource.

from_domain_sid

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".

sid

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

status_callback_method

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

status_callback_url

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

url

The absolute URL of the resource.

voice_fallback_method

The HTTP method we use to call voice_fallback_url. Can be: GET or POST. One of 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_method

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

voice_url

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

CONSTRUCTORS

new

Objects here come from the methods above, so there is no need to call new directly.

LICENSE

Copyright (c) 2026 Francisco Zarabozo. Released under the MIT License.