Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

SIP Domain Resource


A SIP Domain resource describes a custom DNS hostname that can accept SIP traffic for your account. A SIP request to that domain, such as to sip:alice@example.sip.twilio.com, routes to Twilio. Twilio authenticates the request and requests TwiML from the voice_url of the SIP Domain.


SIP Domain Authentication

sip-domain-authentication page anchor

Your SIP Domain must map at least one of these two authentication methods or requests to it will be blocked.


Resource properties
account_sidtype: SID<AC>Not PII

api_versiontype: stringNot PII

The API version used to process the call.


auth_typetype: stringNot PII

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.


date_createdtype: string<DATE TIME RFC 2822>Not PII

The date and time in GMT that the resource was created specified in RFC 2822(link takes you to an external page) format.


date_updatedtype: string<DATE TIME RFC 2822>Not PII

The date and time in GMT that the resource was last updated specified in RFC 2822(link takes you to an external page) format.


domain_nametype: stringNot PII

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.


friendly_nametype: stringNot PII

The string that you assigned to describe the resource.


sidtype: SID<SD>Not PII

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


uritype: stringNot PII

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


voice_fallback_methodtype: enum<HTTP METHOD>Not PII

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

Possible values:
HEADGETPOSTPATCHPUTDELETE

voice_fallback_urltype: string<URI>PII MTL: 30 days

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


voice_methodtype: enum<HTTP METHOD>Not PII

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

Possible values:
HEADGETPOSTPATCHPUTDELETE

voice_status_callback_methodtype: enum<HTTP METHOD>Not PII

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

Possible values:
HEADGETPOSTPATCHPUTDELETE

voice_status_callback_urltype: string<URI>PII MTL: 30 days

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


voice_urltype: string<URI>PII MTL: 30 days

The URL we call using the voice_method when the domain receives a call.


subresource_uristype: object<URI MAP>Not PII

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


sip_registrationtype: booleanNot PII

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


emergency_calling_enabledtype: booleanNot PII

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


securetype: booleanNot PII

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.


byoc_trunk_sidtype: SID<BY>Not PII

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


emergency_caller_sidtype: SID<PN>Not PII

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.


Create a SipDomain resource

create-a-sipdomain-resource page anchor
POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/Domains.json

Parameters

create-parameters page anchor
URI parameters
AccountSidtype: SID<AC>Not PII
Path Parameter

The SID of the Account(link takes you to an external page) that will create the resource.


Request body parameters
DomainNametype: stringNot PII
Required

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.


FriendlyNametype: stringNot PII

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


VoiceUrltype: string<URI>PII MTL: 30 days

The URL we should when the domain receives a call.


VoiceMethodtype: enum<HTTP METHOD>Not PII

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

Possible values:
HEADGETPOSTPATCHPUTDELETE

VoiceFallbackUrltype: string<URI>PII MTL: 30 days

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


VoiceFallbackMethodtype: enum<HTTP METHOD>Not PII

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

Possible values:
HEADGETPOSTPATCHPUTDELETE

VoiceStatusCallbackUrltype: string<URI>PII MTL: 30 days

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


VoiceStatusCallbackMethodtype: enum<HTTP METHOD>Not PII

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

Possible values:
HEADGETPOSTPATCHPUTDELETE

SipRegistrationtype: booleanNot PII

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.


EmergencyCallingEnabledtype: booleanNot PII

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


Securetype: booleanNot PII

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.


ByocTrunkSidtype: SID<BY>Not PII

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


EmergencyCallerSidtype: SID<PN>Not PII

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.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.sip.domains.create({domainName: 'domain_name'})
_10
.then(domain => console.log(domain.sid));

Output

_26
{
_26
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_26
"api_version": "2010-04-01",
_26
"auth_type": "IP_ACL",
_26
"date_created": "Mon, 20 Jul 2015 17:27:10 +0000",
_26
"date_updated": "Mon, 20 Jul 2015 17:27:10 +0000",
_26
"domain_name": "domain_name",
_26
"friendly_name": "Scranton Office",
_26
"sip_registration": true,
_26
"sid": "SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_26
"subresource_uris": {
_26
"credential_list_mappings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SIP/Domains/SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/CredentialListMappings.json",
_26
"ip_access_control_list_mappings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SIP/Domains/SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IpAccessControlListMappings.json"
_26
},
_26
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SIP/Domains/SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_26
"voice_fallback_method": "POST",
_26
"voice_fallback_url": null,
_26
"voice_method": "POST",
_26
"voice_status_callback_method": "POST",
_26
"voice_status_callback_url": null,
_26
"voice_url": "https://dundermifflin.example.com/twilio/app.php",
_26
"emergency_calling_enabled": true,
_26
"secure": true,
_26
"byoc_trunk_sid": "BYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_26
"emergency_caller_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_26
}


Fetch a SipDomain resource

fetch-a-sipdomain-resource page anchor
GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{Sid}.json

URI parameters
AccountSidtype: SID<AC>Not PII
Path Parameter

The SID of the Account(link takes you to an external page) that created the SipDomain resource to fetch.


Sidtype: SID<SD>Not PII
Path Parameter

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

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.sip.domains('SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10
.fetch()
_10
.then(domain => console.log(domain.domainName));

Output

_26
{
_26
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_26
"api_version": "2010-04-01",
_26
"auth_type": "IP_ACL",
_26
"date_created": "Mon, 20 Jul 2015 17:27:10 +0000",
_26
"date_updated": "Mon, 20 Jul 2015 17:27:10 +0000",
_26
"domain_name": "dunder-mifflin-scranton.sip.twilio.com",
_26
"friendly_name": "Scranton Office",
_26
"sip_registration": true,
_26
"sid": "SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_26
"subresource_uris": {
_26
"credential_list_mappings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SIP/Domains/SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/CredentialListMappings.json",
_26
"ip_access_control_list_mappings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SIP/Domains/SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IpAccessControlListMappings.json"
_26
},
_26
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SIP/Domains/SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_26
"voice_fallback_method": "POST",
_26
"voice_fallback_url": null,
_26
"voice_method": "POST",
_26
"voice_status_callback_method": "POST",
_26
"voice_status_callback_url": null,
_26
"voice_url": "https://dundermifflin.example.com/twilio/app.php",
_26
"emergency_calling_enabled": true,
_26
"secure": true,
_26
"byoc_trunk_sid": "BYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_26
"emergency_caller_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_26
}


Read multiple SipDomain resources

read-multiple-sipdomain-resources page anchor
GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/Domains.json

URI parameters
AccountSidtype: SID<AC>Not PII
Path Parameter

The SID of the Account(link takes you to an external page) that created the SipDomain resources to read.


PageSizetype: integerNot PII
Query Parameter

How many resources to return in each list page. The default is 50, and the maximum is 1000.


Pagetype: integerNot PII
Query Parameter

The page index. This value is simply for client state.


PageTokentype: stringNot PII
Query Parameter

The page token. This is provided by the API.

Read multiple SipDomain resources

read-multiple-sipdomain-resources-1 page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.sip.domains.list({limit: 20})
_10
.then(domains => domains.forEach(d => console.log(d.sid)));

Output

_38
{
_38
"domains": [
_38
{
_38
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"api_version": "2010-04-01",
_38
"auth_type": "IP_ACL",
_38
"date_created": "Mon, 20 Jul 2015 17:27:10 +0000",
_38
"date_updated": "Mon, 20 Jul 2015 17:27:10 +0000",
_38
"domain_name": "dunder-mifflin-scranton.sip.twilio.com",
_38
"friendly_name": "Scranton Office",
_38
"sip_registration": true,
_38
"sid": "SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"subresource_uris": {
_38
"credential_list_mappings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SIP/Domains/SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/CredentialListMappings.json",
_38
"ip_access_control_list_mappings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SIP/Domains/SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IpAccessControlListMappings.json"
_38
},
_38
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SIP/Domains/SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_38
"voice_fallback_method": "POST",
_38
"voice_fallback_url": null,
_38
"voice_method": "POST",
_38
"voice_status_callback_method": "POST",
_38
"voice_status_callback_url": null,
_38
"voice_url": "https://dundermifflin.example.com/twilio/app.php",
_38
"emergency_calling_enabled": true,
_38
"secure": true,
_38
"byoc_trunk_sid": "BYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"emergency_caller_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_38
}
_38
],
_38
"start": 0,
_38
"end": 0,
_38
"first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SIP/Domains.json?PageSize=50&Page=0",
_38
"next_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SIP/Domains.json?PageSize=50&Page=50",
_38
"page": 0,
_38
"page_size": 50,
_38
"previous_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SIP/Domains.json?PageSize=50&Page=0",
_38
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SIP/Domains.json?PageSize=50&Page=0"
_38
}


Update a SipDomain resource

update-a-sipdomain-resource page anchor
POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{Sid}.json

URI parameters
AccountSidtype: SID<AC>Not PII
Path Parameter

The SID of the Account(link takes you to an external page) that created the SipDomain resource to update.


Sidtype: SID<SD>Not PII
Path Parameter

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


Request body parameters
FriendlyNametype: stringNot PII

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


VoiceFallbackMethodtype: enum<HTTP METHOD>Not PII

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

Possible values:
HEADGETPOSTPATCHPUTDELETE

VoiceFallbackUrltype: string<URI>PII MTL: 30 days

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


VoiceMethodtype: enum<HTTP METHOD>Not PII

The HTTP method we should use to call voice_url

Possible values:
HEADGETPOSTPATCHPUTDELETE

VoiceStatusCallbackMethodtype: enum<HTTP METHOD>Not PII

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

Possible values:
HEADGETPOSTPATCHPUTDELETE

VoiceStatusCallbackUrltype: string<URI>PII MTL: 30 days

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


VoiceUrltype: string<URI>PII MTL: 30 days

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


SipRegistrationtype: booleanNot PII

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.


DomainNametype: stringNot PII

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.


EmergencyCallingEnabledtype: booleanNot PII

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


Securetype: booleanNot PII

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.


ByocTrunkSidtype: SID<BY>Not PII

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


EmergencyCallerSidtype: SID<PN>Not PII

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.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.sip.domains('SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10
.update({friendlyName: 'friendly_name'})
_10
.then(domain => console.log(domain.domainName));

Output

_26
{
_26
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_26
"api_version": "2010-04-01",
_26
"auth_type": "IP_ACL",
_26
"date_created": "Mon, 20 Jul 2015 17:27:10 +0000",
_26
"date_updated": "Mon, 20 Jul 2015 17:27:10 +0000",
_26
"domain_name": "dunder-mifflin-scranton.sip.twilio.com",
_26
"friendly_name": "friendly_name",
_26
"sip_registration": true,
_26
"sid": "SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_26
"subresource_uris": {
_26
"credential_list_mappings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SIP/Domains/SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/CredentialListMappings.json",
_26
"ip_access_control_list_mappings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SIP/Domains/SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IpAccessControlListMappings.json"
_26
},
_26
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SIP/Domains/SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_26
"voice_fallback_method": "POST",
_26
"voice_fallback_url": null,
_26
"voice_method": "POST",
_26
"voice_status_callback_method": "POST",
_26
"voice_status_callback_url": null,
_26
"voice_url": "https://dundermifflin.example.com/twilio/app.php",
_26
"emergency_calling_enabled": true,
_26
"secure": true,
_26
"byoc_trunk_sid": "BYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_26
"emergency_caller_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_26
}


Delete a SipDomain resource

delete-a-sipdomain-resource page anchor
DELETE https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{Sid}.json

URI parameters
AccountSidtype: SID<AC>Not PII
Path Parameter

The SID of the Account(link takes you to an external page) that created the SipDomain resources to delete.


Sidtype: SID<SD>Not PII
Path Parameter

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

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.sip.domains('SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove();


Rate this page: