TWILIO CONNECT

Bring your own carriers to Twilio

Augment Twilio in seconds with Commio’s powerful, cloud-based inbound and outbound call technology that seamlessly integrates with your voice API—with little or no dev lift.

Add Commio to Twilio and save up to 50%. "Commio intelligently switches outbound phone providers depending on the destination we call... delivering a significant saving over Twilio's rates." - Jose Q., Support Services Manager (G2 Review, 12/23)
 

Outbound Voice

Hardcoding Commio's voice solutions into Twilio Voice is a great, easy option for developers who are already using Twilio and don't want to make any major changes to their existing code. But they are interested in saving up to 50% on calls and having more control of their routing and higher reliability.

Commio is here to handle the routing of your calls, while your existing Twilio code manages and manipulates every dial. Best of all, no additional code libraries or software is 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 re-routes your outbound calls as a SIP call to us. Our cloud communications platform routes your calls for you, unlocking higher quality voice, giving you full control – and saving 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 a 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:

Before Adding Commio as Twilio BYOC Solution 

After adding Commio:

After Adding Commio as Twilio BYOC Solution SIP Call 

Your Commio thinQid and user token parameters need to be sent with the call for authentication purposes. You can get the values of these parameters by logging into our Commio io platform.   

Inbound Voice

Twilio can be easily enhanced with a minimum of development effort to augment your inbound voice with Commio's 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 Commio, meaning no changes will be needed inside your Twilio application code. 

Login to Twilio and your Commio 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.
  Twilio BYOC Trunks Setup to Add Commio

Create a New Trunk.

Click the blue + sign, then enter a trunk name, i.e. commio-yourcompanyname then click create BYOC Trunk.

Create Twilio Trunk

Configuring Twilio for Commio Numbers

Next, we'll create an IP Access Control List for Commio call origination IP addresses.

Click IP Access Control Lists, then click the blue + sign. 

In the pop-up, name it “commio-numbers” and the first IP address 192.81.237.20 / 32, with a friendly name of commio-inbound-1 then click Create ACL.

Twilio IP Access Control List

After you click Create ACL, you’ll be taken to the configuration page for the newly created ACL.

Add the second IP address 192.81.236.20 / 32 to the IP Address Ranges section.

Give it a friendly name of commio-inbound-2 or similar.

Commio Phone Numbers Twilio IP Ranges

Create a Termination SIP Domain

Termination SIP domains are for sending inbound calls from the carrier – your Commio phone numbers (DIDs) – to Twilio. This allows you to take action via your Twilio application on incoming calls to your Commio phone numbers.

Twilio Termination SIP Domains Commio

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 commio-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 commio-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.

New Termination SIP Domain Twilio

Create an Inbound Routing Profile at Commio

In Commio io, 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 inside 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. commio-mycompany.sip.twilio.com

Add Routing Profile in Commio io for Twilio

Configuring Twilio for Commio

First, let's create a Twilio Connect trunk. In Commio io navigate to Outbound, Trunks, then click Add New.

Add New Trunk for Twilio BYOC in Commio io Platform

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.

Commio io Select Twilio

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.

Commio trunk token account ID for Twilio

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. This would typically route outbound from Twilio to that phone number using Twilio's rates.

With this configuration, you will now route through your Commio profile using our lower 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.

Origination Connection Policy on Twilio BYOC to Enable Commio

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.

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

Set Up Origination Target for Twilio Commio

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.

Twilio Origination Connection Policy

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.

Twilio Application Webhook for Commio

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.

';