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.
Your SIP Domain must map at least one of these two authentication methods or requests to it will be blocked.
The SID of the Account that created the SipDomain resource.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
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.
The date and time in GMT that the resource was created specified in RFC 2822 format.
The date and time in GMT that the resource was last updated specified in RFC 2822 format.
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 unique string that that we created to identify the SipDomain resource.
^SD[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The HTTP method we use to call voice_fallback_url
. Can be: GET
or POST
.
GET
POST
The URL that we call when an error occurs while retrieving or executing the TwiML requested from voice_url
.
The HTTP method we use to call voice_url
. Can be: GET
or POST
.
GET
POST
The HTTP method we use to call voice_status_callback_url
. Either GET
or POST
.
GET
POST
The URL that we call to pass status parameters (such as call ended) to your application.
The URL we call using the voice_method
when the domain receives a call.
A list of mapping resources associated with the SIP Domain resource identified by their relative URIs.
Whether to allow SIP Endpoints to register with the domain to receive calls.
Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses.
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.
The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with.
^BY[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
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.
^PN[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/Domains.json
application/x-www-form-urlencoded
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
.
A descriptive string that you created to describe the resource. It can be up to 64 characters long.
The HTTP method we should use to call voice_url
. Can be: GET
or POST
.
GET
POST
The URL that we should call when an error occurs while retrieving or executing the TwiML from voice_url
.
The HTTP method we should use to call voice_fallback_url
. Can be: GET
or POST
.
GET
POST
The URL that we should call to pass status parameters (such as call ended) to your application.
The HTTP method we should use to call voice_status_callback_url
. Can be: GET
or POST
.
GET
POST
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.
Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses.
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.
The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with.
^BY[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
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.
^PN[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createSipDomain() {11const domain = await client.sip.domains.create({ domainName: "domain_name" });1213console.log(domain.accountSid);14}1516createSipDomain();
1{2"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",3"api_version": "2010-04-01",4"auth_type": "IP_ACL",5"date_created": "Mon, 20 Jul 2015 17:27:10 +0000",6"date_updated": "Mon, 20 Jul 2015 17:27:10 +0000",7"domain_name": "domain_name",8"friendly_name": "Scranton Office",9"sip_registration": true,10"sid": "SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",11"subresource_uris": {12"credential_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialListMappings.json",13"ip_access_control_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json"14},15"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",16"voice_fallback_method": "POST",17"voice_fallback_url": null,18"voice_method": "POST",19"voice_status_callback_method": "POST",20"voice_status_callback_url": null,21"voice_url": "https://dundermifflin.example.com/twilio/app.php",22"emergency_calling_enabled": true,23"secure": true,24"byoc_trunk_sid": "BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",25"emergency_caller_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"26}
GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{Sid}.json
The SID of the Account that created the SipDomain resource to fetch.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The Twilio-provided string that uniquely identifies the SipDomain resource to fetch.
^SD[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function fetchSipDomain() {11const domain = await client.sip12.domains("SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")13.fetch();1415console.log(domain.accountSid);16}1718fetchSipDomain();
1{2"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",3"api_version": "2010-04-01",4"auth_type": "IP_ACL",5"date_created": "Mon, 20 Jul 2015 17:27:10 +0000",6"date_updated": "Mon, 20 Jul 2015 17:27:10 +0000",7"domain_name": "dunder-mifflin-scranton.sip.twilio.com",8"friendly_name": "Scranton Office",9"sip_registration": true,10"sid": "SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",11"subresource_uris": {12"credential_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialListMappings.json",13"ip_access_control_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json"14},15"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",16"voice_fallback_method": "POST",17"voice_fallback_url": null,18"voice_method": "POST",19"voice_status_callback_method": "POST",20"voice_status_callback_url": null,21"voice_url": "https://dundermifflin.example.com/twilio/app.php",22"emergency_calling_enabled": true,23"secure": true,24"byoc_trunk_sid": "BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",25"emergency_caller_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"26}
GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/Domains.json
How many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Maximum: 1000
The page token. This is provided by the API.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listSipDomain() {11const domains = await client.sip.domains.list({ limit: 20 });1213domains.forEach((d) => console.log(d.accountSid));14}1516listSipDomain();
1{2"domains": [3{4"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"api_version": "2010-04-01",6"auth_type": "IP_ACL",7"date_created": "Mon, 20 Jul 2015 17:27:10 +0000",8"date_updated": "Mon, 20 Jul 2015 17:27:10 +0000",9"domain_name": "dunder-mifflin-scranton.sip.twilio.com",10"friendly_name": "Scranton Office",11"sip_registration": true,12"sid": "SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",13"subresource_uris": {14"credential_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialListMappings.json",15"ip_access_control_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json"16},17"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",18"voice_fallback_method": "POST",19"voice_fallback_url": null,20"voice_method": "POST",21"voice_status_callback_method": "POST",22"voice_status_callback_url": null,23"voice_url": "https://dundermifflin.example.com/twilio/app.php",24"emergency_calling_enabled": true,25"secure": true,26"byoc_trunk_sid": "BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",27"emergency_caller_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"28}29],30"start": 0,31"end": 0,32"first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains.json?PageSize=50&Page=0",33"next_page_uri": null,34"page": 0,35"page_size": 50,36"previous_page_uri": null,37"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains.json?PageSize=50&Page=0"38}
POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{Sid}.json
The SID of the Account that created the SipDomain resource to update.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The Twilio-provided string that uniquely identifies the SipDomain resource to update.
^SD[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
application/x-www-form-urlencoded
A descriptive string that you created to describe the resource. It can be up to 64 characters long.
The HTTP method we should use to call voice_fallback_url
. Can be: GET
or POST
.
GET
POST
The URL that we should call when an error occurs while retrieving or executing the TwiML requested by voice_url
.
The HTTP method we should use to call voice_url
GET
POST
The HTTP method we should use to call voice_status_callback_url
. Can be: GET
or POST
.
GET
POST
The URL that we should call to pass status parameters (such as call ended) to your application.
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.
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
.
Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses.
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.
The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with.
^BY[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
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.
^PN[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function updateSipDomain() {11const domain = await client.sip12.domains("SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")13.update({ friendlyName: "friendly_name" });1415console.log(domain.accountSid);16}1718updateSipDomain();
1{2"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",3"api_version": "2010-04-01",4"auth_type": "IP_ACL",5"date_created": "Mon, 20 Jul 2015 17:27:10 +0000",6"date_updated": "Mon, 20 Jul 2015 17:27:10 +0000",7"domain_name": "dunder-mifflin-scranton.sip.twilio.com",8"friendly_name": "friendly_name",9"sip_registration": true,10"sid": "SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",11"subresource_uris": {12"credential_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialListMappings.json",13"ip_access_control_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json"14},15"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",16"voice_fallback_method": "POST",17"voice_fallback_url": null,18"voice_method": "POST",19"voice_status_callback_method": "POST",20"voice_status_callback_url": null,21"voice_url": "https://dundermifflin.example.com/twilio/app.php",22"emergency_calling_enabled": true,23"secure": true,24"byoc_trunk_sid": "BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",25"emergency_caller_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"26}
DELETE https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{Sid}.json
The SID of the Account that created the SipDomain resources to delete.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The Twilio-provided string that uniquely identifies the SipDomain resource to delete.
^SD[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function deleteSipDomain() {11await client.sip.domains("SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").remove();12}1314deleteSipDomain();