In the context of the Inbound Processing Region API, a Trunk
resource represents the routing configuration for a particular Elastic SIP Trunk.
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 Trunk.
Changes to this resource may take up to 5 minutes to take effect.
A 34 character string that uniquely identifies the Inbound Processing Region assignments for this SIP Trunk.
^QQ[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The unique SID identifier of the Account.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
A human readable description of the Inbound Processing Region assignments for this SIP Trunk, up to 64 characters.
The date that this SIP Trunk was assigned an Inbound Processing Region, given in ISO 8601 format.
The date that the Inbound Processing Region was updated for this SIP Trunk, given in ISO 8601 format.
GET https://routes.twilio.com/v2/Trunks/{SipTrunkDomain}
The absolute URL of the SIP Trunk
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 fetchTrunks() {11const trunk = await client.routes.v212.trunks("example.pstn.twilio.com")13.fetch();1415console.log(trunk.voiceRegion);16}1718fetchTrunks();
1{2"sip_trunk_domain": "example.pstn.twilio.com",3"url": "https://routes.twilio.com/v2/Trunks/test.pstn.twilio.com",4"account_sid": "AC00000000000000000000000000000000",5"sid": "QQ00000000000000000000000000000000",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/Trunks/{SipTrunkDomain}
The absolute URL of the SIP Trunk
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 updateTrunks() {11const trunk = await client.routes.v212.trunks("example.pstn.twilio.com")13.update({ voiceRegion: "au1" });1415console.log(trunk.voiceRegion);16}1718updateTrunks();
1{2"sip_trunk_domain": "example.pstn.twilio.com",3"url": "https://routes.twilio.com/v2/Trunks/test.pstn.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}