Cisco Unified CM 6.1 to Asterisk and FreePBX SIP Trunks (Powered by Bandwidth.com)

One of the systems I manage is an 875 Extension Cisco Unified Call Manager(UCM). At the moment the system uses SCAN trunks for long distance calling. These SCAN Trunks are provided by the state of Washington and interconnect via a four port FXO card. Callers use a PIN to make long distance calls. This is some seriously old school technology and as such has sound quality to match.

So, armed with a four port SIP trunk account from Bandwidth.com, I set forth to make a SIP trunk from the UCM to Bandwidth.com. Long story short… it does not look like I can. I can set things up that should work, but don’t. There is an active TAC open with Cisco and when(if) we make it work then I’ll be back in a new blog entry.

Instead, we have “Cisco Unified CM 6.1 to Asterisk as SIP Proxy for Long Distance service.”

What is difficult to impossible with UCM is trivial in Asterisk w/FreePBX.

For Bandwidth.com I made a new SIP Trunk with the name of “freepbx” and here are the PEER Details:

username=myusername
type=peer
sendrpid=yes
secret=mypassword
qualify=yes
insecure=very
host=trunk.freepbx.com
fromdomain=trunk.freepbx.com
context=from-trunk

The Register name was formated like this:

myusername:mypassword@trunk.freepbx.com/360746XXXX
——-
For the UCM, I made a SIP Trunk named “ucm” and here are the PEER Details:

type=peer
context=from-callmanager
host=10.XXX.XXX.XXX
disallow=all
allow=ulaw&alaw
nat=no
canreinvite=no
qualify=yes

and in extensions_custom.conf, courtesy of Philippe, I added ( to have these calls bypass most of the dialplan logic )

[from-callmanager] include => from-internal
exten => _1NXXNXXXXXX,1,Dial(${OUT_12}/${EXTEN});
exten => _1NXXNXXXXXX,n,hangup

NOTE: the the “OUT_12” reflects the “freepbx” trunk and the last thing to do is allow anonymous SIP as the calls are routed w/o authentication from the UCM ( for now.)

From CallManagerToSIP

Now on to UCM.

From CallManagerToSIP

Since we are using no authentication to send calls from UCM to Asterisk this part is somewhat straight forward. First step is to define a “SIP Trunk Security Profile Configuration” making sure the “Outgoing Transport Type” is UDP, which looks like:

From CallManagerToSIP

Then we create the SIP Trunk, noting that the “Calling Search Space” in this case is “Reserved Incoming Calls” which basically does not allow inbound calls to go anywhere:

From CallManagerToSIP

The last three items to set up are the “Route Group, Route List and Route Pattern.”

Here is the Route Group:

From CallManagerToSIP

Here is the Route List:

From CallManagerToSIP

And since we need a way to direct calls out this SIP Trunk to make long distance calls, here is the Route Pattern so users dial “891NXXXXXXXXX” to dial out:

Bare in mind, I only want calls going out this trunk ( not in) so if you wanted bi directional calls… You would adjust the “Calling Search Space” in the trunk to allow it.

Otherwise, that is the setup that is live for now. Once an Authenticated SIP Trunk can be sorted out on the UCM, I plan to go directly to Bandwidth.com and skip the proxy.

5 thoughts on “Cisco Unified CM 6.1 to Asterisk and FreePBX SIP Trunks (Powered by Bandwidth.com)

  1. Hey Robert – UCM can’t do SIP NAT traversal. Cisco will try and sell you the SIP gateway license for a router ($4000/us list).

    Your solution is cheaper 🙂

    Great documentation, thanks for all your efforts.

  2. That is good to know. Our vendor, the excellent Ednetics, and I are setting up a test bench to workout the “direct” approach to try and get the UCM to register directly. I’ll bring that point up with them. So far additional costs have not been mentioned, and considering I have it working as is…. I don’t think we are going to spend $4k.
  3. Thanks, this works great. We’re using a trunk with 1 simultaneous call for testing. Any idea how to get CUCM to roll over if all channels are busy? I tried adding a PRI below the SIP trunk in the route group, adding a PRI only route group to the route group list and I also tried adding our partition set to use our PRI under the SIP partition in the CSS. In all cases, if I made a call out the SIP trunk, a second call always rang busy. We needed automatic rollover in case the SIP trunks go down or all channels are busy.
  4. Thanks for the post was very helpfull i just have a quick question about getting the call to callmanager. if u had a DID with bandwidth.com say 6189288XXXX how would u get that from freepbx to Callmanager i have been trying to deal with this for ages but havent had any luck was just wondering thanks in advance 🙂
  5. Thanks for the info. This will be very helpful. We are considering doing the same, adding a SIP trunk or two in lieu of or addition to our costly PRI’s. We have a rather fast internet link (30Mbps symmetrical ethernet) and can prioritize our traffic at our Checkpoint Firewall (NGX R.65 soon to be upgraded to NGX R.70).

    My expectation was we were going to do this at the Voice Gateway’s (not on our Call Manager 7 Cluster or Asterisk Cluster). But if there is expensive licensing involved, we might have to look at alternatives. My only concern with this solution is scalability. From what I know of Asterisk (my engineers usually keep me straight on all the technology) is it essentially proxy’s every call including the RTP audio stream. So what does a solution such as this mean to load on your Asterisk Servers?

    Thanks in advance and appreciate folks like cosmicwombat who are willing to share.

Leave a Reply