The ByocTrunks
resource describes a trunk that can be configured to send/receive traffic to/from a PSTN Carrier.
The SID of the Account that created the BYOC Trunk resource.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The unique string that that we created to identify the BYOC Trunk resource.
^BY[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The URL we call using the voice_method
when the BYOC Trunk receives a call.
The HTTP method we use to call voice_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_fallback_url
. Can be: GET
or POST
.
GET
POST
The URL that we call to pass status parameters (such as call ended) to your application.
The HTTP method we use to call status_callback_url
. Either GET
or POST
.
GET
POST
Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See CNAM Lookups for more information.
The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure.
^NY[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the SIP Domain that should be used in the From
header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to "call back" an incoming call, configure this with a SIP Domain to ensure proper routing. If not configured, the from domain will default to "sip.twilio.com".
^SD[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
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 absolute URL of the resource.
POST https://voice.twilio.com/v1/ByocTrunks
application/x-www-form-urlencoded
A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long.
The URL we should call when the BYOC Trunk receives a call.
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 status_callback_url
. Can be: GET
or POST
.
GET
POST
Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See CNAM Lookups for more information.
The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure.
^NY[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the SIP Domain that should be used in the From
header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to "call back" an incoming call, configure this with a SIP Domain to ensure proper routing. If not configured, the from domain will default to "sip.twilio.com".
^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 createByocTrunk() {11const byocTrunk = await client.voice.v1.byocTrunks.create();1213console.log(byocTrunk.accountSid);14}1516createByocTrunk();
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"sid": "BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"friendly_name": "friendly_name",5"voice_url": "https://byoc.example.com/twilio/app",6"voice_method": "POST",7"voice_fallback_method": "POST",8"voice_fallback_url": "https://byoc.example.com/twilio/fallback",9"status_callback_method": "POST",10"status_callback_url": "https://byoc.example.com/twilio/status_callback",11"cnam_lookup_enabled": false,12"connection_policy_sid": "NYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",13"from_domain_sid": "SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",14"date_created": "2020-03-18T23:31:36Z",15"date_updated": "2020-03-18T23:31:36Z",16"url": "https://voice.twilio.com/v1/ByocTrunks/BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"17}
GET https://voice.twilio.com/v1/ByocTrunks/{Sid}
The Twilio-provided string that uniquely identifies the BYOC Trunk resource to fetch.
^BY[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 fetchByocTrunk() {11const byocTrunk = await client.voice.v112.byocTrunks("BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.fetch();1415console.log(byocTrunk.accountSid);16}1718fetchByocTrunk();
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"sid": "BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"friendly_name": "friendly_name",5"voice_url": "https://byoc.example.com/twilio/app",6"voice_method": "POST",7"voice_fallback_method": "POST",8"voice_fallback_url": "https://byoc.example.com/twilio/fallback",9"status_callback_method": "POST",10"status_callback_url": "https://byoc.example.com/twilio/status_callback",11"cnam_lookup_enabled": false,12"connection_policy_sid": "NYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",13"from_domain_sid": "SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",14"date_created": "2020-03-18T23:31:36Z",15"date_updated": "2020-03-18T23:31:37Z",16"url": "https://voice.twilio.com/v1/ByocTrunks/BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"17}
GET https://voice.twilio.com/v1/ByocTrunks
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 listByocTrunk() {11const byocTrunks = await client.voice.v1.byocTrunks.list({ limit: 20 });1213byocTrunks.forEach((b) => console.log(b.accountSid));14}1516listByocTrunk();
1{2"meta": {3"page": 0,4"page_size": 50,5"first_page_url": "https://voice.twilio.com/v1/ByocTrunks?PageSize=50&Page=0",6"previous_page_url": null,7"url": "https://voice.twilio.com/v1/ByocTrunks?PageSize=50&Page=0",8"next_page_url": null,9"key": "byoc_trunks"10},11"byoc_trunks": [12{13"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",14"sid": "BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",15"friendly_name": "friendly_name",16"voice_url": "https://byoc.example.com/twilio/app",17"voice_method": "POST",18"voice_fallback_method": "POST",19"voice_fallback_url": "https://byoc.example.com/twilio/fallback",20"status_callback_method": "POST",21"status_callback_url": "https://byoc.example.com/twilio/status_callback",22"cnam_lookup_enabled": false,23"connection_policy_sid": "NYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",24"from_domain_sid": "SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",25"date_created": "2020-03-18T23:31:36Z",26"date_updated": "2020-03-18T23:31:37Z",27"url": "https://voice.twilio.com/v1/ByocTrunks/BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"28}29]30}
POST https://voice.twilio.com/v1/ByocTrunks/{Sid}
The Twilio-provided string that uniquely identifies the BYOC Trunk resource to update.
^BY[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
application/x-www-form-urlencoded
A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long.
The URL we should call when the BYOC Trunk receives a call.
The HTTP method we should use to call voice_url
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_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 status_callback_url
. Can be: GET
or POST
.
GET
POST
Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See CNAM Lookups for more information.
The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure.
^NY[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the SIP Domain that should be used in the From
header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to "call back" an incoming call, configure this with a SIP Domain to ensure proper routing. If not configured, the from domain will default to "sip.twilio.com".
^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 updateByocTrunk() {11const byocTrunk = await client.voice.v112.byocTrunks("BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.update({ friendlyName: "FriendlyName" });1415console.log(byocTrunk.accountSid);16}1718updateByocTrunk();
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"sid": "BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"friendly_name": "FriendlyName",5"voice_url": "https://byoc.example.com/twilio_updated/app",6"voice_method": "GET",7"voice_fallback_method": "GET",8"voice_fallback_url": "https://byoc.example.com/twilio_updated/fallback",9"status_callback_method": "GET",10"status_callback_url": "https://byoc.example.com/twilio_updated/status_callback",11"cnam_lookup_enabled": true,12"connection_policy_sid": "NYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab",13"from_domain_sid": "SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab",14"date_created": "2020-03-18T23:31:36Z",15"date_updated": "2020-03-18T23:31:37Z",16"url": "https://voice.twilio.com/v1/ByocTrunks/BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"17}
DELETE https://voice.twilio.com/v1/ByocTrunks/{Sid}
The Twilio-provided string that uniquely identifies the BYOC Trunk resource to delete.
^BY[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 deleteByocTrunk() {11await client.voice.v112.byocTrunks("BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.remove();14}1516deleteByocTrunk();