In the context of the Inbound Processing Region API, a SipDomain resource represents the routing configuration for a particular Programmable Voice SIP Domain.
By adjusting the value of the voice_region
property, you can control which Twilio Region will process and store data related to inbound calls for the SIP Domain.
Changes to this resource may take up to 5 minutes to take effect. When you change the routing to a new Region for a SIP domain then it does not mean that the SIP Domain will be created automatically in the new Region. You will have to manually create the SIP Domain in the new Region with the same configuration.
GET https://routes.twilio.com/v2/SipDomains/{SipDomain}
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 sipDomain = await client.routes.v212.sipDomains("example.sip.twilio.com")13.fetch();1415console.log(sipDomain.voiceRegion);16}1718fetchSipDomain();
1{2"url": "https://routes.twilio.com/v2/SipDomains/test.sip.twilio.com",3"account_sid": "AC00000000000000000000000000000000",4"sid": "QQ00000000000000000000000000000000",5"sip_domain": "example.sip.twilio.com",6"friendly_name": "string",7"voice_region": "string",8"date_created": "2022-06-02T22:33:47Z",9"date_updated": "2022-06-02T22:33:47Z"10}
POST https://routes.twilio.com/v2/SipDomains/{SipDomain}
application/x-www-form-urlencoded
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 sipDomain = await client.routes.v212.sipDomains("example.sip.twilio.com")13.update({ voiceRegion: "au1" });1415console.log(sipDomain.voiceRegion);16}1718updateSipDomain();
1{2"url": "https://routes.twilio.com/v2/SipDomains/test.sip.twilio.com",3"sip_domain": "example.sip.twilio.com",4"sid": "QQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",6"friendly_name": "friendly_name",7"voice_region": "au1",8"date_created": "2020-08-07T22:29:24Z",9"date_updated": "2020-08-07T22:29:24Z"10}