Bring your own carriers to Twilio
Augment Twilio in seconds with thinQ’s powerful, cloud-based inbound and outbound call technology that seamlessly integrates with your voice API—with little or no dev lift.
Outbound VoiceLet Commio handle the routing of your calls, while Twilio manages and manipulates every dial. Hardcoding our voice solutions into Twilio Voice is a great option for developers who are already using Twilio and do not want to make any major changes to their existing code, but are interested in saving up to 50% on calls and having more control of their routing and higher reliability.
No additional libraries and software are required to be installed with this option, just a simple text change needs to be made.
By changing a simple parameter that is sent to Twilio in your Twilio Library code, Twilio will re-route your outbound calls as a SIP call to us. Our cloud communications platform will route your your calls for you, unlock higher quality voice, give you full control – and save you money in the process.
The parameter to change is the TO phone number. Change this parameter from the format or just the phone number, “19191231234”, to the new format of:
To get started contact us to get test account with Twilio enabled, then go into your existing code that is already working with the Twilio Library.
Change the existing TO phone number to this format to replace what is in the TO field with this information to have your calls sent to Commio.
Before adding Commio:
After adding Commio:
The thinQid and Commio token parameters need to be sent with the call for authentication purposes. You can get the values of these parameters by logging into your thinQ io account.
Inbound VoiceTwilio can be easily enhanced with a minimum of development effort to augment your inbound voice with our Bring Your Own Carrier (BYOC Trunks) solution.
After following these directions, inbound voice calls to your Commio phone numbers will route to Twilio, and outbound calls initiated from Twilio will route through your Commio outbound voice profile.
Following these steps will also eliminate the need for hardcoding a SIP URI to route outbound calls initiated from your application to thinQ, meaning no changes will be needed inside your application’s code.
Login to Twilio and your thinQ io accounts, as we’ll move between both portals throughout these instructions.
In Twilio: Go to your Programmable Voice Dashboard.
Click BYOC Trunks on the left.
Create a New Trunk. Click the blue + sign, then enter a trunk name, i.e. thinq-yourcompanyname then click create BYOC Trunk.
Configuring Twilio for Commio NumbersNext, we'll create an IP Access Control List for thinQ origination IP addresses. Click IP Access Control Lists, then click the blue + sign. In the pop-up, name it “thinq-numbers” and the first IP address 220.127.116.11 / 32, with a friendly name of thinq-inbound-1 then click Create ACL. After you click Create ACL, you’ll be taken to the configuration page for the newly created ACL. Add the second IP address 18.104.22.168 / 32 to the IP Address Ranges section. Give it a friendly name of thinq-inbound-2 or similar.
Create a Termination SIP DomainTermination SIP domains are for sending inbound calls from the carrier – your Commio phone Numbers – to Twilio. This allows you to take action via your Twilio application on incoming calls to your Commio phone numbers. You will be taken to a New Termination SIP Domain configuration page. Configure a Friendly Name to easily identify your domain, suggested Commio and your company name.
Configure a SIP Domain Name to uniquely identify your SIP URI for the domain, this is like an actual domain name, so it must be unique – suggested thinq-yourcompanyname – this URI may be used to direct SIP traffic towards Twilio Programmable Voice.
In the Authentication section of the page, select the IP Access Control list thinq-numbers (that you created previously) from the dropdown.
In the Call Control Configuration section of the page, select your BYOC trunk you created previously from the BYOC TRUNK dropdown.
Scroll to the bottom of the page and click Save.
Create an Inbound Routing Profile at CommioIn thinQ io from the menu select Inbound, then Routing Profiles, then Inbound Profiles.
Click to Add a new profile, and in the pop-up, configure the Name - suggested: Twilio-YourCompanyName or just Twilio.
NOTE: You may want to create multiple SIP Domains on Twilio for different applications, which you would create more routing profiles for, so just make sure it’s descriptive so you recognize what it’s for on Twilio.
Select DNS A for Type, and enter the TERMINATION SIP URI from your Twilio Termination SIP Domains page under BYOC Trunks in your Twilio Programmable Voice page. See the Create a Termination SIP Domain above.
NOTE: Leave the “sip:” prefix off of the URI, it should just be the hostname, i.e. thinq-mycompany.sip.twilio.com
Configuring Twilio for CommioFirst, let's create a Twilio Connect trunk. In thinQ io navigate to Outbound, Trunks, then click Add New. On the New Trunk configuration page, give it a friendly name, then choose the Profile you wish to associate your trunk with. Drop down the Select Trunk Type, and select Connect. Select Twilio from the options, then click Save. You will next see an “Edit Trunk” page. Note the Token and Account ID information, you will use this to configure the SIP URI to configure in Twilio's portal. This is required for routing outbound calls from Twilio through Commio. Copy and paste these values into a text editor or notepad.
Creating an Origination Connection Policy on TwilioAn Origination Connection Policy is the configuration that instructs where Twilio should send outbound calls FROM Twilio, i.e. a verb in your application would contain a phone number to set up an outbound call to. This would typically route outbound from Twilio to that phone number using Twilio’s rates. With this configuration, it will now route through your Commio profile using our rates.
In your Programmable Voice Dashboard on Twilio, go to BYOC Trunks, then select Origination Connection Policy, then click the plus sign to add a new policy. Give it a Friendly Name in the pop-up and click Create. After clicking Create, you will be taken to the Origination Connection Policy list. Click on your newly created policy to open the configuration page.
On the Origination Connection Policy page, click on the Add new Origination Target page, and in the pop up, enter the following SIP URI in the ORIGINATION SIP URI field, then click Create.
Replace YOUR_ACCOUNT_ID and YOUR_ACCOUNT_TOKEN with the values you gathered from the Creating a Twilio Connect Trunk section.
Assigning the Origination Connection PolicyClick on Trunks under BYOC Trunks and select your Commio trunk.
From the General Settings page of your trunk, go to the Origination Connection Policy (to your Carrier) section and choose the newly created Origination Connection Policy from the dropdown. Click Save.
Configuring your Application to use the BYOC TrunksOn the same General Settings page for your BYOC Trunk, you can scroll towards the bottom and configure your Application settings for this trunk. This is your application webhook.
Congratulations! Inbound voice calls to your Commio numbers will now route to Twilio, and outbound calls initiated FROM Twilio will route through your Commio profile.
Get peace of mind
Create custom, omnichannel customer experiences. Start sending better calls & texts with Commio.