TWILIO CONNECT
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 Voice
Let 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:
sip:12155551212@wap.thinq.com?X-account-id=01234&X-account-token=567890
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 Voice
Twilio 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 Numbers
Next, 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 192.81.237.20 / 32, with a friendly name of thinq-inbound-1 then click Create ACL.

Create a Termination SIP Domain
Termination 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.
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 Commio
In 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 Commio
First, let's create a Twilio Connect trunk. In thinQ io navigate to Outbound, Trunks, then click Add New.


Creating an Origination Connection Policy on Twilio
An 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.

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.
sip:wap.thinq.com?X-account-id=YOUR_ACCOUNT_ID&X-account-token=YOUR_ACCOUNT_TOKEN
Replace YOUR_ACCOUNT_ID and YOUR_ACCOUNT_TOKEN with the values you gathered from the Creating a Twilio Connect Trunk section.
Example:
sip:wap.thinq.com?X-account-id=123456&X-account-token=123456789101112131415161718

Assigning the Origination Connection Policy
Click 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 Trunks
On 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.

Get peace of mind
Create custom, omnichannel customer experiences. Start sending better calls & texts with Commio.