NAME

Twilio::Rest::Api::V2010::Account::Sip::Domain - The Domain resource

SYNOPSIS

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

my $domain = $client->sip->domains->create($domain_name, \%options);
for my $domain ($client->sip->domains->read({}, 20)) {
  ...
}
my $domain = $client->sip->domains($sid)->fetch;
$client->sip->domains($sid)->update(\%options);
$client->sip->domains($sid)->delete;

DESCRIPTION

Custom DNS hostnames that can accept SIP traffic

This file holds DomainList, DomainPage, DomainContext and DomainInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.

DomainList

Returned by $client->sip->domains. See also Twilio::ListResource.

create

my $domain = $client->sip->domains->create($domain_name, \%options);

Create a new Domain. Returns a DomainInstance.

The required values are:

$domain_name

The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and "-" and must end with sip.twilio.com.

The options are:

byoc_trunk_sid

The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with.

emergency_caller_sid

Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call.

emergency_calling_enabled

Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses.

friendly_name

A descriptive string that you created to describe the resource. It can be up to 64 characters long.

secure

Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain.

sip_registration

Whether to allow SIP Endpoints to register with the domain to receive calls. Can be true or false. true allows SIP Endpoints to register with the domain to receive calls, false does not.

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_status_callback_method

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

voice_status_callback_url

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

voice_url

The URL we should when the domain receives a call.

read

my @records = $client->sip->domains->read(\%options, $limit, $page_size);

Retrieve a list of domains belonging to the account used to make the request. Returns the records as a list, fetching as many pages as it needs.

stream

my $stream = $client->sip->domains->stream(\%options, $limit, $page_size);

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

page

my $page = $client->sip->domains->page(\%options, $page_size, $page_token, $page_number);

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

get_page

my $page = $client->sip->domains->get_page($url);

Fetches the page at a URL given by Twilio.

get_context

my $context = $client->sip->domains->get_context($sid);

Returns a DomainContext, and makes no request.

DomainPage

A Twilio::Page of DomainInstance objects.

records_key

build_instance

Used by Twilio::Page.

DomainContext

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

fetch

my $domain = $client->sip->domains($sid)->fetch;

Fetch an instance of a Domain. Returns a DomainInstance.

update

my $domain = $client->sip->domains($sid)->update(\%options);

Update the attributes of a domain. Returns a DomainInstance.

The options are:

byoc_trunk_sid

The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with.

domain_name

The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and "-" and must end with sip.twilio.com.

emergency_caller_sid

Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call.

emergency_calling_enabled

Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses.

friendly_name

A descriptive string that you created to describe the resource. It can be up to 64 characters long.

secure

Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain.

sip_registration

Whether to allow SIP Endpoints to register with the domain to receive calls. Can be true or false. true allows SIP Endpoints to register with the domain to receive calls, false does not.

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_status_callback_method

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

voice_status_callback_url

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

voice_url

The URL we should call when the domain receives a call.

delete

$client->sip->domains($sid)->delete;

Delete an instance of a Domain. Returns true.

auth

my $list = $object->auth;

See Twilio::Rest::Api::V2010::Account::Sip::Domain::AuthTypes.

credential_list_mappings

my $list = $object->credential_list_mappings;

my $context = $object->credential_list_mappings($sid);

See Twilio::Rest::Api::V2010::Account::Sip::Domain::CredentialListMapping.

ip_access_control_list_mappings

my $list = $object->ip_access_control_list_mappings;

my $context = $object->ip_access_control_list_mappings($sid);

See Twilio::Rest::Api::V2010::Account::Sip::Domain::IpAccessControlListMapping.

DomainInstance

See also Twilio::InstanceResource.

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

Its fields are:

account_sid

The SID of the Account that created the SipDomain resource.

api_version

The API version used to process the call.

auth_type

The types of authentication you have mapped to your domain. Can be: IP_ACL and CREDENTIAL_LIST. If you have both defined for your domain, both will be returned in a comma delimited string. If auth_type is not defined, the domain will not be able to receive any traffic.

byoc_trunk_sid

The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with.

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.

domain_name

The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and "-" and must end with sip.twilio.com.

emergency_caller_sid

Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call.

emergency_calling_enabled

Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses.

friendly_name

The string that you assigned to describe the resource.

secure

Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain.

sid

The unique string that that we created to identify the SipDomain resource.

sip_registration

Whether to allow SIP Endpoints to register with the domain to receive calls.

subresource_uris

A list of mapping resources associated with the SIP Domain resource identified by their relative URIs.

uri

The URI of the resource, relative to https://api.twilio.com.

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_status_callback_method

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

voice_status_callback_url

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

voice_url

The URL we call using the voice_method when the domain 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.