Cisco and FreePBX Integration

I have a SIP trunk operational between UCM and FreePBX. Users on each system can call between each other. I can call out via Broadvoice SIP from FreePBX.

I want the ability to do the following and cant seem to get it to work.

1)User on UCM calls outside world and all calls are routed to FreePBX and out. If I view the full logfile I see the call making to FreePBX but get the following:

[Dec 30 08:56:34] VERBOSE[5400] logger.c: – Executing [[email protected]:1] NoOp(“SIP/172.16.1.8-096e98c0”, “Received incoming SIP connection from unknown peer to XXXXXXXXXX”) in new stack
[Dec 30 08:56:34] VERBOSE[5400] logger.c: – Executing [[email protected]:2] Set(“SIP/172.16.1.8-096e98c0”, “DID=XXXXXXXXXX”) in new stack
[Dec 30 08:56:34] VERBOSE[5400] logger.c: – Executing [[email protected]:3] Goto(“SIP/172.16.1.8-096e98c0”, “s|1”) in new stack
[Dec 30 08:56:34] VERBOSE[5400] logger.c: – Goto (from-sip-external,s,1)
[Dec 30 08:56:34] VERBOSE[5400] logger.c: – Executing [[email protected]:1] GotoIf(“SIP/172.16.1.8-096e98c0”, “1?from-trunk|XXXXXXXXXX|1”) in new stack
[Dec 30 08:56:34] VERBOSE[5400] logger.c: – Goto (from-trunk,XXXXXXXXXX,1)
[Dec 30 08:56:34] VERBOSE[5400] logger.c: – Executing [[email protected]:1] Set(“SIP/172.16.1.8-096e98c0”, “__FROM_DID=XXXXXXXXXX”) in new stack
[Dec 30 08:56:34] VERBOSE[5400] logger.c: – Executing [[email protected]:2] NoOp(“SIP/172.16.1.8-096e98c0”, “Received an unknown call with DID set to XXXXXXXXXX”) in new stack
[Dec 30 08:56:34] VERBOSE[5400] logger.c: – Executing [[email protected]:3] Goto(“SIP/172.16.1.8-096e98c0”, “s|a2”) in new stack
[Dec 30 08:56:34] VERBOSE[5400] logger.c: – Goto (from-trunk,s,2)
[Dec 30 08:56:34] VERBOSE[5400] logger.c: – Executing [[email protected]:2] Answer(“SIP/172.16.1.8-096e98c0”, “”) in new stack
[Dec 30 08:56:34] VERBOSE[5400] logger.c: – Executing [[email protected]:3] Wait(“SIP/172.16.1.8-096e98c0”, “2”) in new stack
[Dec 30 08:56:36] VERBOSE[5400] logger.c: – Executing [[email protected]:4] Playback(“SIP/172.16.1.8-096e98c0”, “ss-noservice”) in new stack

The same # dials fine from FreePBX.

  1. I want to have all incoming calls to FreePBX via the Broadvoice connection routed to UCM SIP Trunk. Basically FreePBX is a SIP gateway because UCM doesnt hook up directly to Broadvoice without IOS gateway or other gateway.

I know there is some additional debug that may be needed but any help would be appreciated.

Thanks.

Ok I was messing around with the incoming routes as well and I see why it would dial the 1001. I changed the incoming route DID to the correct value.

When I dial PSTN I get the same results as before, a ss-noservice in the log, even with the from-trunk set in the USER context FreePBX sees the SIP invite for the full 10 digit number.

He has anonymous SIP on.

Sorry I was tired when I did this. Calls from PSTN can’t originate out.

Try changing the user context of the trunk to from-internal and report back.

We can address the Anonymous SIP issue once we get it working. I assume that the connection is on a private network without any obvious threat vectors?

Having the context in from-internal will allow you to use the FreePBX outbound routes.

from-trunk hits the inbound routes but does not allow access to any outbound dial. This is normally where a DID would arrive in the system.

I assume you mean the USER context under incoming settings on the SIP trunk to UCM. I changed this to “from-trunk”, when I dial a PSTN number from the Cisco side it rings a 1001 extension on the FreePBX side, very interesting.

“Received incoming SIP connection from unknown peer to XXXXXXXXXX”

Seems the unknown bit is a clue. Try setting the context back the way you had it and in the general section of FreePBX allow “anonymous” sip.

If that is the solution… You are going to need to be mindfull to set implicit rules in your firewall.

Try changing the context of the trunk to ‘from-trunk’

Sorry I wasn’t cluing in to what you meant by user context.

Yes you got it, you can either you misc. destination or custom extension to achieve the same results.

It would be great if you could send a username from the UCM then your trunk would not have to use anonymous SIP.

OK got it. I added context=from-internal to the UCM SIP trunk outgoing settings PEER details

Thanks for the help.

Also I got requirement #2 resolved. Just created a Misc Destination that points to a UCM extension. Then added a incoming route with my Broadvoice DID and set destination to the Misc Destination above.

Good stuff…

In the SIP trunk to my UCM system I changed USER context to from-internal and did not change. Here is what I have under Incoming Settings USER Details, maybe I am missing something

host=172.16.1.8
type=peer