Integrating with Twilio’s Telephony System
Introduction
SIP, or Session Initiation Protocol, is a signaling protocol, used to set up, connect, and disconnect communication sessions, typically voice or video calls, in real-time using an IP (Internet Protocol) Network.
Identifying phone numbers
To set up your phone integration, you must identify a Main Call Queue Number. If RedRoute is unable to automate a call, it routes the call to the Main Call Queue Number, where an operator or call center representative will handle it.
Choose a lightly-used phone number (which you input as Public Phone Numbers in the phone integration) to serve as the Main Call Queue Number rather than a highly-used, public-facing number.
If you have an existing IVR system, we also strongly recommend that you identify a Legacy IVR Number to receive a portion of calls while RedRoute ramps up during the launch process. Ensure that this too is a lightly-used phone number.
To identify lightly-used phone numbers, look at the call logs. You can do this one of two ways.
Export call logs via API.
Download a CSV file from the Twilio Console as follows:
Within the Twilio Console, click Dock to open additional options.
In Communications Cloud, click Programmable Voice.
From the Calls drop-down list, select Call Logs.
Export the calls as a CSV file to analyze the call volume per number.
Identify the 2 most infrequently used phone numbers from the list. It is important that these numbers receive very little volume as we will set them as the Main Call Queue Number (the number with the lowest call volume) and Legacy IVR Number.
Double-check that these numbers aren’t used for any special purpose (VIP number, free phone number, etc).
If there are fewer than 2 numbers fitting this criterion, buy any additional numbers from Twilio.
Creating a SIP Trunk
You will need to set up a SIP trunk between Twilio and RedRoute. The following steps will help you:
Within the Twilio Console, click Dock to open up additional options.
In the Super Network pane, click Elastic SIP Trunking.
Select Trunks from the drop-down list.
On the Elastic SIP Trunks page, click Create new SIP Trunk.
Enter a name for the SIP Trunk (we recommend naming it RedRoute), and click Create.
Within the Elastic SIP Trunking pane of the newly created trunk, select Origination.
In the Origination window, click to create an origination URI:
Open the RedRoute portal.
In the Create a SIP Connection page, copy the FQDN in the RedRoute Domain section.
Return to the Twilio Origination page and paste the FQDN name you copied into the Origination SIP URI, ensuring that the identifier begins with sip. For example, if the RedRoute portal provides redroute.rraccess.com as the RedRoute domain, enter sip:redroute.rraccess.com into Twilio.
Leave Priority and Weight as the default values and click Add. The Origination window displays.
Your new Origination SIP URI must be the only Origination SIP URI for this trunk.
In the Elastic SIP Trunking pane, select Termination.
In the Termination SIP URI input field, enter a Termination URI. This identifier can be any text. For example, we named our example demo-prod.
Create an IP Access Control List with the signaling IPs for your region, listed here.
Return to the RedRoute portal.
In the Sending Domain field, enter pstn.twilio.com.
In Receiving Domain, enter the Termination URI. Ensure that you include the full pstn.twilio.com ending. Click Next.
Sending Calls Through the SIP Trunk
Now that you’ve set up the SIP trunk in Twilio and the RedRoute portal, you can send calls through that SIP Trunk.
Note: Only do this when the RedRoute portal prompts you. If done prematurely, calls could be dropped.
To send calls through the SIP Trunk, complete the following steps:
Click Dock within the Twilio Console.
Under Super Network, select Phone Numbers.
From the Phone Numbers pane, select Active Numbers.
In the Active Numbers drop-down list, select the phone number that you’d like to use with RedRoute.
Scroll down to Voice & Fax.
In the Configure with field, ensure that SIP Trunk is chosen.
In the SIP Trunk field, select the recently created SIP Trunk and choose Save.
Repeat these steps for all numbers that you use with RedRoute.
Internal Telephony Number
For Twilio phone numbers, the Internal Telephony Number is the same as the Public Phone Number. In the RedRoute portal, these two fields should be the same.