Cisco UCM 9 to FreePBX(Asterisk 10) to Voicepulse

December 22nd, 2012

I’ve been a Voicepulse SIP subscriber of years. I love their SIP business service. It gives me a 4 channel SIP trunk and DID service for about $12 a month plus usage. It’s cheap enough for me to use in my lab without breaking the bank. Initially when my lab was more physical and less virtual, I had the Voicepulse SIP trunks terminated on a Cisco 2801 running CME. From there, I would either register IP Phones directly or quasi-cube the connection to the occasional CUCM I would have spun up for testing. My home office phone ran off this and was mostly up when I wasn’t screwing with the setup.  That was about 6-9 months ago before I completely re-did my lab footprint to run everything virtual on MAC Mini’s.

In order to terminate my trunks in a virtual-only environment, I needed something other than a physical Cisco ISR. (Hey Cisco!!! Virtualize a CUBE!!!) What I needed was a virtual appliance to act as a SBC. Voicepulse requires either a static IP (dont have) or SIP authentication (CUCM natively does not support). I’ve been wanting an excuse to play with Acme or Sonus but neither of those were an option for me at the moment. I had some familiarity networking CUCM with Asterisk so…  Asterisk to the rescue! I decided I would try to terminate my Voicepulse SIP trunks to Asterisk, and create a SIP trunk between it and CUCM.

Asterisk 10 to Voicepulse Config

For my Asterisk server, I decided to use FreePBX. Asterisk can be installed and configured directly a top your Linux of choice, but for simplicity’s sake, FreePBX has a preconfigured installer ISO that builds the appliance for you. It’s essentially a customized CentOS load with the Asterisk packages all ready to go. You just open a browser to it’s IP when finished. For the FreePBX virtual machine, I built it as a single core with 2GB of RAM and a 16GB disk. I booted it off the FreePBX ISO and about 15 minutes later it was ready to go.

Voicepulse has a fairly decent guide on setting up with Asterisk. I used  lot of that as my starting point.  I had to tweak it a little for minor Asterisk 10 differences and lobotomize the dial-plan to support what I was wanting to accomplish with CUCM. Most of my configuration changes makes it so that Asterisk simply passes through information from CUCM and Voicepulse. I only needed to touch three sections in default Asterisk config. Trunks, inbound routes, and outbound routes.

First, create the  SIP trunk to Voicepulse.

VP-TRUNK

 

For outbound caller-id, I am leaving this blank and specifying it in CUCM (more on this later). If you wish to override this, you can do so here. For dial-plan,Voicepulse seems to want all numbers dialed as e.164. They don’t really say that in their config guides, but looking at their dial-plan examples and the plus(+) dialing in their configs, it seems so. I have only tried calling US numbers so I can’t confirm that 100%. All my Asterisk configs in this example will maintain the e.164 formats and expect CUCM to send a properly formatted e.164 number for outbound dialing.  This is why the “Dialed Number Manipulation Rules” are blank here. For the register string, use “user:password@voicepulseserver” while replacing “user” with your VP username, “password” with your VP password, and “voicepulseserver” with the specific VP server you are registering this trunk to (i.e. jfk-primary.voicepulse.com).  See the Voicepulse Asterisk setup guide on their website if this is vague.

Optionally, you can also create a secondary SIP trunk using the same setting above but placing the Voicepulse backup server (i.e. jfk-secondary.voicepulse.com) in the appropriate fields.

Next, you’ll want to create an outbound route for this trunk. This will route dialed numbers to the SIP trunk.

VP-OUT

This should be fairly self explanatory. Since I am doing all my digit manipulation in CUCM, I am just routing +1NXXNXXXXXX to the SIP trunk(s) I created above. Other that matching on +1 NANP dialing plan only (no international) it is passing everything through from CUCM as dialed without discarding or prepending any digits.

Now on to the CUCM SIP Trunk…

Asterisk 10 to Cisco Unified Communications Manager 9 Config

This took a little more trial and error. I read few a guides and perused configs others had used and cobbled this together. It may have redundant or unnecessary options, but with all the testing I have done so far, everything seems to work as it should.

In Asterisk, create a trunk as follows.

CUCM-TRUNK

Just like with Voicepulse trunks, you don’t need to specify any routes here as that will be done in either CUCM or through Asterisk routes. Note that the 192.168.10.46 is the IP address of my CUCM server. You must use the IP address of CUCM as the user context and fromdomain.

Next, create a inbound route to direct our Voicepulse DID to our CUCM.

VP-IN

I am specifying my exact DID here. Voicepulse presents me an 11 digit number and this “DID number” field  has to match what they are sending me.  I only have one DID with Voicepulse. If I had a block of DIDs, I wouldn’t necessarily need to create individual inbound routes because Asterisk supports wildcards in the form of X or N (where X = any number and N = 2-9) or bracket ranges ([1-4]). Example – if i had 17705551000 – 17705551099, I could use 177055510XX as my “DID Number” that I am routing to CUCM.

When the call gets to CUCM, Asterisk will pass this DID through.

Cisco Unified Communications Manager 9 to Asterisk 10 Config

If you are familiar with Cisco Communication Manager, you can probably skip some of this. In fact, I’m probably not going to go into a lot of detail here as the design on the CUCM side is so subjective to what you are using it for. I’ll briefly hit on my partitions and css’s along with my IP Phone config but that’s ancillary to this config.

For this example, I have 3 partitions on my CUCM server:

part

I also have 3 calling search spaces configured as follows:

css3

css1

css2

 

Not too much you need to do on the phone, but I’ve included the parts that I used for this setup.

phone

dn

enm

First, create a SIP Security Profile. You can either edit the default, or create a new one. I have created a new one. Make sure you pay close attention to the items circled in red.

CM-SIP-SEC-PROFILE

Next, create the CUCM side of the SIP trunk to Asterisk.

CUCM-TRUNK-1

Note that MTP is required. Make sure you have one in the null MRGL or in the MRGL you assign the trunk. I am using the Cisco software MTP that’s part of CUCM for my setup.

CUCM-TRUNK-2

CUCM-TRUNK-3

Make sure you specify the correct SIP Security profile and define the IP address where Asterisk is running. Save and reset the trunk.

Next create a route pattern pointing your outbound routes to this SIP trunk. This is where YMMV and where you will need to know how you want the Cisco IP phones to dial. Your desired end result is that you are sending a +1[2-9]XX[2-9]XXXXXX pattern to the SIP trunk. For my setup, I wanted to dial a 9 and get secondary dial-tone. followed by 10 digits for the local numbers in my area, or 1+10digits for long distance.  The way I chose to do this was with 4 route patterns.

First the LD pattern. Pay close attention to the transformations.

CUCM-ROUTE-1

And then 3 Local patterns matching on the 3 local area codes for Atlanta. (Only 404 shown in the screenshot)

CUCM-ROUTE-2

Notice in both of these that “Use calling Party’s External Phone Number Mask” is selected. On the IP phone, I have my Voicepulse DID assigned as the “External Number Mask”. This checkbox on the route pattern is what forwards this information to the SIP trunk and eventually to Voicepulse. Doing it this way would allow me to have multiple Voicepulse DIDs in the future and allow me to send the number of the phone I am dialing from across the trunk to Voicepulse. This way the Caller-ID on the destination caller’s phone correctly matches the DID the call is coming from.

At this point, you should be able to make outbound calls from a Cisco attached IP Phone through Asterisk to Voicepulse. All that is remaining is routing the inbound DID to your IP phone of choice. To do this, add a translation pattern to translate the 11 digit DID from Asterisk to the extension inCUCM.

It will look something like this.

CUCM-XLATE

Notice here that the “Translation Pattern” is the 11 digit DID from Voicepulse and the “Called Party” is  extension of the IP phone you want to route the call to.

At this point, you should be able to receive both inbound and outbound calls to your Cisco IP Phone.

Tags: ,

15 Responses to “Cisco UCM 9 to FreePBX(Asterisk 10) to Voicepulse”

  1. Mathieu Says:

    Hello,

    Thank you for your tutorial, it’s working great. However I’m experiencing some trouble if MTP is checked on SIP trunk in CUCM 8.6.

    When checked the quality is bad as sh** and there’s ton of jitter on cisco phones.

    When unchecked the quality is excellent, but “forward all” doesn’t work anymore on phone, there’s no audio and asterisk drop the call after 30 seconds.

    Do you have some idea of this. Maybe how to get rid off this jitter when MTP is enabled…

    Thank you anyway

    Best Regards

  2. Nick Marus Says:

    It’s hard to say, but my first guess would be something is wrong with the MTP. With a MTP all media traffic is going through that device. If you are using a CUCM software MTP, it may be that there is a CPU or network issue there causing bad quality.

  3. Stephan Says:

    exactly that iam looking for so long!

  4. Stephan Says:

    me again, i got now outside dialling working but i cant get inbound working. Could you maybe assist me? drop a line to my mail.

    Thank You

  5. Stephan Says:

    Hej,

    i got this now working, but after 4 Rings on the CUCM it sends a Got SIP response 480 “Temporarily Not Available” back from 192.168.254.6:506

    how can i increase the amounts he tries to ring my phones?

    Regards

    Stephan

  6. myron Says:

    I setup my system to match your configuration. I can place outbound calls no problem, on inbound calls I get a 404 not found when looking at the SIP trace from the asterisk CLI. Any thouhts?

  7. Dinesh Says:

    Trying to use it with localphone.com. I am getting a message of All Circuits are Busy Now. Try your call later. Not sure where to debug.
    CUCM 8.6.2, Freepbx 4.211.64-5, Sip Phone is X-Lite on Win7.

    There is credit in the localphone.com account so calls should go through.

    Also on localphone.com, I can see that FreePbx is registered correctly

    Any pointers

    The MRGL was created by following
    http://www.ucprimer.com/integating-cucm-86-with-lync.html

  8. Dinesh Says:

    Figured it out. It started working after I put in

    fromuser=XXXX
    fromdomain=localphone.com

    in the SIP trunk PEER details from Freepbx to localphone.

  9. Ahmed Says:

    Well, I’m experiencing the same problem as some of you above. Calls from CUCM to Asterisk working fine but no incoming calls to CUCM.

    Did any of you get it working? If yes, please share how you got it working.

  10. Daniel Says:

    I am too having issues when trying to call my DID (from IPKall) which is linked to a free SIP provider (GetOnSip.com). I have followed this guide and I am able to dial out from my 7975 phone. However, it seems like FreePBX/Asterisk isn’t ever transferring calls made to my IPKall number to CUCM. Whenever I try and call the number, it returns with a “The number you have dialed is not in service. Please check the number and try again.”. Any help will be greatly appreciated as this setup is almost working perfectly. Thanks.

  11. Jonathan Says:

    Followed your guide, but I can get incoming calls to work. My FreePBX box says:

    NOTICE[1972][C-00000007] chan_sip.c: Failed to authenticate on INVITE to ‘”WOOD JONATHAN ” ;tag=as2e9fa7f4′

    And idea on what is wrong here?

  12. Daniel Says:

    I have solved the inbound call issues. Anyone who would like immediate help, contact me at http://contact.technofrat.com

    I will try and post my own blog post as an addendum to this post.

  13. artheb Says:

    HI,
    I followed this tutorial and opposite to other I have a problems with calls from CUCM to asterisk. When I do sip trace on asterisk box, I get 401 unauthorized and call does not even appear on the asterisk.
    Calls are working ok from asterisk to CUCM. However when I hangup on asterisk before call is answered on asterisk. Phone keeps ringing. Any idea?

  14. Daniel Says:

    Artheb, I have this system fully working. Shoot me an email here (http://contact.technofrat.com) and I can walk you through the steps. This goes for anyone else as well…just shoot me an email.

  15. artheb Says:

    @Daniel
    Did you get my message?

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CAPTCHA Image
*