FreePBX/ CUCM 8.6 SIP Trunking - Calls not routing

Hi all

Playing with FreePBX and CUCM in my lab environment at the moment, however I am having an issue with interoperability between the two PBX’s.

I have Extension 1000 configured on the CUCM and Extension 5000 on the FreePBX. Currently I can call from the Cisco phone to my FreePBX extension without issues, however dialling from FreePBX to Cisco results in a fast busy tone.

I have run a wireshark trace and debug from the FreePBX server and have noticed the call isnt even hitting the CUCM, highlighting a config issue in the FreePBX server…I can’t for the life of me work it out though.

FreePBX IP: 10.201.118.5
CUCM IP: 10.201.118.4

My FreePBX trunks are set up as follows:
Trunk Name: CUCM
Outbound CID:5000
Channels:10

Outgoing Settings

Trunk Name: CUCM
Peer Details:
type=friend
qualify=yes
nat=no
insecure=very
host=10.201.118.4
dtmf=rfc2833
disallow=all
canreinvite=no
allow=ulaw&alaw
context=from-trunk

Incoming Settings

User Context: 10.201.118.4
User Details:
type=friend
qualify=yes
nat=no
insecure=very
host=10.201.118.4
fromdomain=10.201.118.4
dtmf=rfc2833
disallow=all
context=from-trunk
canreinvite=no
allow=ulaw&alaw

Outbound Route:
1XXX to CUCM trunk

An excerpt of an asterisk debug is shown below…Hoping someone can help!

[[email protected] ~]# asteriossk -r
Asterisk 11.10.2, Copyright © 1999 - 2013 Digium, Inc. and others.
Created by Mark Spencer [email protected]
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘core show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ‘core show license’ for details.

Connected to Asterisk 11.10.2 currently running on localhost (pid = 1980)
localhost*CLI> sip
notify prune qualify reload set show unregister

localhost*CLI> sip set
debug history

localhost*CLI> sip set debug
ip off on peer

localhost*CLI> sip set debug on

localhost*CLI>
SIP Debugging enabled

localhost*CLI>

<— SIP read from UDP:10.201.78.155:51137 —>
INVITE sip:[email protected] SIP/2.0
Call-ID: [email protected]
CSeq: 1068 INVITE
From: “5000” sip:[email protected];tag=430319674
To: sip:[email protected]
Via: SIP/2.0/UDP 10.201.78.155:51137;branch=z9hG4bK108ab755304b56cd95f2384b8fec3f70363631;rport
Max-Forwards: 70
Contact: “5000” sip:[email protected]:51137;transport=udp
Content-Type: application/sdp
Content-Length: 299

v=0
o=- 1404815805869 1404815805875 IN IP4 10.201.78.155
s=-
c=IN IP4 10.201.78.155
t=0 0
m=audio 36302 RTP/AVP 96 97 3 0 8 127
a=rtpmap:96 GSM-EFR/8000
a=rtpmap:97 AMR/8000
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:127 telephone-event/8000
a=fmtp:127 0-15
<------------->
— (10 headers 13 lines) —
Sending to 10.201.78.155:51137 (no NAT)
Sending to 10.201.78.155:51137 (no NAT)
Using INVITE request as basis request - [email protected]
Found peer ‘5000’ for ‘5000’ from 10.201.78.155:51137

<— Reliably Transmitting (NAT) to 10.201.78.155:51137 —>
SIP/2.0 401 Unauthorized

Via: SIP/2.0/UDP 10.201.78.155:51137;branch=z9hG4bK108ab755304b56cd95f2384b8fec3f70363631;received=10.201.78.155;rport=51137

From: “5000” sip:[email protected];tag=430319674

To: sip:[email protected];tag=as060f8ec7

Call-ID: [email protected]

CSeq: 1068 INVITE

Server: FPBX-2.11.0(11.10.2)

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE

Supported: replaces, timer

WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce=“0b84c45a”

Content-Length: 0

<------------>
Scheduling destruction of SIP dialog ‘[email protected]’ in 11712 ms (Method: INVITE)

localhost*CLI>

<— SIP read from UDP:10.201.78.155:51137 —>
ACK sip:[email protected] SIP/2.0
Call-ID: [email protected]
Max-Forwards: 70
From: “5000” sip:[email protected];tag=430319674
To: sip:[email protected];tag=as060f8ec7
Via: SIP/2.0/UDP 10.201.78.155:51137;branch=z9hG4bK108ab755304b56cd95f2384b8fec3f70363631;rport
CSeq: 1068 ACK
Content-Length: 0

<------------->
— (8 headers 0 lines) —

localhost*CLI>

<— SIP read from UDP:10.201.78.155:51137 —>
INVITE sip:[email protected]:5060 SIP/2.0
Call-ID: [email protected]
CSeq: 1069 INVITE
From: “5000” sip:[email protected];tag=430319674
To: sip:[email protected]
Via: SIP/2.0/UDP 10.201.78.155:51137;branch=z9hG4bKaa504590b49925328e24e50540fee0fd363631;rport
Max-Forwards: 70
Contact: “5000” sip:[email protected]:51137;transport=udp
Content-Type: application/sdp
Authorization: Digest username=“5000”,realm=“asterisk”,nonce=“0b84c45a”,uri=“sip:[email protected]:5060”,response=“79fb90d31d5f0b467dbb6d0b5536f314”,algorithm=MD5
Content-Length: 299

v=0
o=- 1404815805869 1404815805875 IN IP4 10.201.78.155
s=-
c=IN IP4 10.201.78.155
t=0 0
m=audio 36302 RTP/AVP 96 97 3 0 8 127
a=rtpmap:96 GSM-EFR/8000
a=rtpmap:97 AMR/8000
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:127 telephone-event/8000
a=fmtp:127 0-15
<------------->
— (11 headers 13 lines) —
Sending to 10.201.78.155:51137 (no NAT)
Sending to 10.201.78.155:51137 (no NAT)
Using INVITE request as basis request - [email protected]
Found peer ‘5000’ for ‘5000’ from 10.201.78.155:51137

<— Reliably Transmitting (NAT) to 10.201.78.155:51137 —>
SIP/2.0 401 Unauthorized

Via: SIP/2.0/UDP 10.201.78.155:51137;branch=z9hG4bKaa504590b49925328e24e50540fee0fd363631;received=10.201.78.155;rport=51137

From: “5000” sip:[email protected];tag=430319674

To: sip:[email protected];tag=as47966c5d

Call-ID: [email protected]

CSeq: 1069 INVITE

Server: FPBX-2.11.0(11.10.2)

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE

Supported: replaces, timer

WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce=“093feea8”

Content-Length: 0

<------------>
Scheduling destruction of SIP dialog ‘[email protected]’ in 11712 ms (Method: INVITE)

localhost*CLI>

<— SIP read from UDP:10.201.78.155:51137 —>
ACK sip:[email protected]:5060 SIP/2.0
Call-ID: [email protected]
Max-Forwards: 70
From: “5000” sip:[email protected];tag=430319674
To: sip:[email protected];tag=as47966c5d
Via: SIP/2.0/UDP 10.201.78.155:51137;branch=z9hG4bKaa504590b49925328e24e50540fee0fd363631;rport
CSeq: 1069 ACK
Content-Length: 0

<------------->
— (8 headers 0 lines) —

localhost*CLI>

<— SIP read from UDP:10.201.78.155:51137 —>
INVITE sip:[email protected]:5060 SIP/2.0
Call-ID: [email protected]
CSeq: 1070 INVITE
From: “5000” sip:[email protected];tag=430319674
To: sip:[email protected]
Via: SIP/2.0/UDP 10.201.78.155:51137;branch=z9hG4bKf989101b5162cae22192fc98420ddc1b363631;rport
Max-Forwards: 70
Contact: “5000” sip:[email protected]:51137;transport=udp
Content-Type: application/sdp
Authorization: Digest username=“5000”,realm=“asterisk”,nonce=“093feea8”,uri=“sip:[email protected]:5060”,response=“f7bfcc227d7f29da0d4455cf82c04f7d”,algorithm=MD5
Content-Length: 299

v=0
o=- 1404815805869 1404815805875 IN IP4 10.201.78.155
s=-
c=IN IP4 10.201.78.155
t=0 0
m=audio 36302 RTP/AVP 96 97 3 0 8 127
a=rtpmap:96 GSM-EFR/8000
a=rtpmap:97 AMR/8000
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:127 telephone-event/8000
a=fmtp:127 0-15
<------------->
— (11 headers 13 lines) —
Sending to 10.201.78.155:51137 (NAT)
Using INVITE request as basis request - [email protected]
Found peer ‘5000’ for ‘5000’ from 10.201.78.155:51137
Found RTP audio format 96
Found RTP audio format 97
Found RTP audio format 3
Found RTP audio format 0
Found RTP audio format 8
Found RTP audio format 127
Found unknown media description format GSM-EFR for ID 96
Found unknown media description format AMR for ID 97
Found audio description format GSM for ID 3
Found audio description format PCMU for ID 0
Found audio description format PCMA for ID 8
Found audio description format telephone-event for ID 127
Capabilities: us - (gsm|ulaw|alaw), peer - audio=(gsm|ulaw|alaw)/video=(nothing)/text=(nothing), combined - (gsm|ulaw|alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 10.201.78.155:36302
Looking for 1000 in from-internal (domain 10.201.118.5)

localhost*CLI>
list_route: hop: sip:[email protected]:51137;transport=udp

<— Transmitting (NAT) to 10.201.78.155:51137 —>
SIP/2.0 100 Trying

Via: SIP/2.0/UDP 10.201.78.155:51137;branch=z9hG4bKf989101b5162cae22192fc98420ddc1b363631;received=10.201.78.155;rport=51137

From: “5000” sip:[email protected];tag=430319674

To: sip:[email protected]

Call-ID: [email protected]

CSeq: 1070 INVITE

Server: FPBX-2.11.0(11.10.2)

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE

Supported: replaces, timer

Contact: sip:[email protected]:5060

Content-Length: 0

<------------>

localhost*CLI>
Audio is at 11724

localhost*CLI>
Adding codec 100003 (ulaw) to SDP

localhost*CLI>
Adding codec 100004 (alaw) to SDP

localhost*CLI>
Adding codec 100002 (gsm) to SDP

localhost*CLI>
Adding non-codec 0x1 (telephone-event) to SDP

localhost*CLI>

<— Transmitting (NAT) to 10.201.78.155:51137 —>
SIP/2.0 183 Session Progress

Via: SIP/2.0/UDP 10.201.78.155:51137;branch=z9hG4bKf989101b5162cae22192fc98420ddc1b363631;received=10.201.78.155;rport=51137

From: “5000” sip:[email protected];tag=430319674

To: sip:[email protected];tag=as3ddd0dd7

Call-ID: [email protected]

CSeq: 1070 INVITE

Server: FPBX-2.11.0(11.10.2)

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE

Supported: replaces, timer

Contact: sip:[email protected]:5060

Content-Type: application/sdp

Content-Length: 281

v=0

o=root 470998268 470998268 IN IP4 10.201.118.5

s=Asterisk PBX 11.10.2

c=IN IP4 10.201.118.5

t=0 0

m=audio 11724 RTP/AVP 0 8 3 127

a=rtpmap:0 PCMU/8000

a=rtpmap:8 PCMA/8000

a=rtpmap:3 GSM/8000

a=rtpmap:127 telephone-event/8000

a=fmtp:127 0-16

a=ptime:20

a=sendrecv

<------------>

localhost*CLI>

<— SIP read from UDP:10.201.118.6:50556 —>
OPTIONS sip:10.201.118.5:5060 SIP/2.0
To: sip:10.201.118.5:5060
Via: SIP/2.0/UDP 10.201.118.6:5060;wlsscid=6aa6b97cdedafbd6;branch=z9hG4bK507684f0d8f53d3fd3e8d196b7c031c5;wlsssid=sip-1ml6itwhumw75
CSeq: 1 OPTIONS
Content-Length: 0
Call-ID: [email protected]
Max-Forwards: 70
From: sip:10.201.118.6;tag=864c0e4e

<------------->
— (8 headers 0 lines) —
Sending to 10.201.118.6:5060 (no NAT)
Looking for s in from-sip-external (domain 10.201.118.5)

<— Transmitting (no NAT) to 10.201.118.6:5060 —>
SIP/2.0 200 OK

Via: SIP/2.0/UDP 10.201.118.6:5060;wlsscid=6aa6b97cdedafbd6;branch=z9hG4bK507684f0d8f53d3fd3e8d196b7c031c5;wlsssid=sip-1ml6itwhumw75;received=10.201.118.6

From: sip:10.201.118.6;tag=864c0e4e

To: sip:10.201.118.5:5060;tag=as09d80331

Call-ID: [email protected]

CSeq: 1 OPTIONS

Server: FPBX-2.11.0(11.10.2)

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE

Supported: replaces, timer

Contact: sip:10.201.118.5:5060

Accept: application/sdp

Content-Length: 0

<------------>
Scheduling destruction of SIP dialog ‘[email protected]’ in 32000 ms (Method: OPTIONS)

localhost*CLI>

<— Reliably Transmitting (NAT) to 10.201.78.155:51137 —>
SIP/2.0 503 Service Unavailable

Via: SIP/2.0/UDP 10.201.78.155:51137;branch=z9hG4bKf989101b5162cae22192fc98420ddc1b363631;received=10.201.78.155;rport=51137

From: “5000” sip:[email protected];tag=430319674

To: sip:[email protected];tag=as3ddd0dd7

Call-ID: [email protected]

CSeq: 1070 INVITE

Server: FPBX-2.11.0(11.10.2)

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE

Supported: replaces, timer

Content-Length: 0

<------------>

localhost*CLI>
[2014-07-08 11:36:38] WARNING[10898][C-00000004]: channel.c:4860 ast_prod: Prodding channel ‘SIP/5000-00000002’ failed

localhost*CLI>

<— SIP read from UDP:10.201.78.155:51137 —>
ACK sip:[email protected]:5060 SIP/2.0
Call-ID: [email protected]
Max-Forwards: 70
From: “5000” sip:[email protected];tag=430319674
To: sip:[email protected];tag=as3ddd0dd7
Via: SIP/2.0/UDP 10.201.78.155:51137;branch=z9hG4bKf989101b5162cae22192fc98420ddc1b363631;rport
CSeq: 1070 ACK
Content-Length: 0

<------------->
— (8 headers 0 lines) —
Really destroying SIP dialog ‘[email protected]’ Method: ACK

localhost*CLI>
Really destroying SIP dialog ‘[email protected]’ Method: ACK

localhost*CLI> sip set debug onexitsip set debug onff

localhost*CLI>
SIP Debugging Disabled

I may be too late in replying and you might have found this out yourself. I guess the issue is when you try calling from CUCM -> FreePBX. The Free PBX sends a 401 Unauthorized.

This is because of secret configuration on your extensions. Just register the extension with blank secret. Once you do that, FreePBX will not challenge the CUCM with 401 Unauthorised message.

If you have already passed this stage, please let me know, if you can help me with some of my problems.