Connecting Cisco Gateways To Twilio Elastic SIP Trunking

March 17, 2015
Written by

cloverhoundheader

There’s a common phrase you’ll hear from big telecom vendors when you’re trying to get phone connectivity in your office: “your estimate is 90 days.” In the middle of that waiting period, if you change any aspect of the planned PBX installation, you’ll hear the same phrase “your estimate is 90 days.” The days spent waiting add up to missed calls, and unnecessary expenses for small businesses. Getting calls into your office can seem unnecessarily hard. Chad Stachowicz, CEO of Cloverhound, gets his clients up and running making and receiving calls fast. A key tool in his toolbelt is Twilio’s Elastic SIP Trunking.

“There’s thousands of us [telecom developers] running around out there, and we all have our little labs. One of the most annoying things is getting calls into your lab.” Chad founded his own full service communication company (lab, in Chad’s words) to help businesses with everything from receiving calls, to setting up call centers, to data center services.

A common request he gets is to get a closet of telecom hardware hooked up online in no time. With Twilio, he can do it overnight for clients, and do it for cheap.

In this post, Chad shows off how to connect a Cisco gateway to Twilio’s Elastic SIP Trunking.

We’re happy to announce that Twilio’s Elastic SIP Trunking is now generally available. Learn more and sign up here.

[The following is a syndicated post from Chad Stachowicz. Read it on the Cloverhound blog here.]

cloverhound

While I was turning up the new Cloverhound office, we needed to find a Telco to hook up to our CME. Previously, I had used some pretty reasonable providers, however this time since I have been doing a bunch of work with Twilio, I thought I would try their new Elastic SIP Trunking service. I signed up for their BETA, and was given 4 numbers in which I could receive incoming calls. I was told this would be public very shortly.

We are using it with GREAT success for our Charlotte office, and audio quality has been spectacular. We are even using it over a B2B tunnel from the origination point to our office, and it still works amazing.

This is a perfect way to get your Cisco LAB online with PSTN number overnight. Twilio charges only $1/month per number and less than a penny a minute. Most other providers charge $70/mo minimum. Another way Twilio is changing the game!

Provisioning Your Twilio SIP Trunk

The first thing your going to need to do is provision your SIP domain and credentials after logging into Twilio. You can find it by browsing to SIP -> Credentials List. The picture shows our configuration of the Cloverhound site below.

You will also need to create an IP Access Control List with the IP Address of any WAN IP that the SIP requests could be sourced from. This can be found under SIP -> IP Access Control Lists

The final step is to go to your number and configure it to point to your SIP Trunk for incoming calls . This can be found under Numbers -> and looks like the following. (Please note you must be in the Twilio SIP Trunking BETA to get the SIP: Option).

These are all the steps necessary to configure Twilio, now you only must configure your SIP Router with credentials.

Configuring Your Cisco ISR for Twilio SIP Trunking

Pretty much any ISR that supports CUBE will be fine for hooking up to Twilio. Cisco 28xx, 29xx, 38xx, 39xx, 43xx etc.. will all work just fine. I am going to recommend 15.2(4)M7 as the IOS to use for now (or the newest 15.1(4)M train out for older routers)

Twilio require that you use credentials for outbound calls, so this means you MUST use the B2BUA built into Cisco IOS. Posted below is the configuration I am using in my lab.

As you can see the configuration is simple but there are some more things that are going to be important by default. First of all, one real dumb thing to do is put a CUBE on the internet without ANY kind of security. Toll fraud is RAMPANT on the internet with open SIP providers. In 15.x IOS Cisco introduced the IOS Trust List. You MUST use this if your putting your device on the open Internet. The second I did, within 2 days I saw random sip invite being sent from all over the net. Below is a good template for your IOS device, with the Twilio IP’s included.

Next, Twilio wants all numbers in full E.164 format, so we are going to need to transform all outbound calls to E.164 before sending to Twilio. The rules below are doing 2 things, A.) they are changing this outbound call from 91980333XXXX to +1980333XXXX and B.) it is changing my ANI from 4002 to 980218XXXX.

Lastly I have a dial-peer with 91[2-9]..[2-9]…… in order to catch the calls. You can see the translation profile that is applied to translated the number to E.164. Also it seems Twilio appreciates G.711. the ‘session target sip-server’ is what target the sip B2BUA configured above with the ‘sip-ua’ command.

Verification

The easiest way to verify is to run the ‘debug ccsip messages’ command and verify good SIP messaging with Twilio as seen below on an outbound call.

You will see that I smashed enter twice during the debug…. The first time I smashed it is right before I answered the call….The second time I smashed it is right before I hung up the call. It was obviously successful.

Learn more about how to connect your Cisco Gateway to a SIP Trunk here