SIP Forwarding not working correctly

PRI → Cisco Call Manager → SIP Trunk → FreePBX -->Registered User|Phone
I created a pjsip trunk between my Cisco Call Manager and the FreePBX system. In FreePBX it shows the trunk up and it shows the User 7123 registered. Created a route pattern in Call Manager for 7123 to go FreePBX Gateway (SIP Trunk). From my cell, I dial XXX XXX 7123. The phone rings. I pick it up and on the cell I get “User Busy”. What am I missing?

I did a trace on my CM.
Source Destination Protocol Info
10.2.6.221 10.2.6.215 SIP INVITE sip:[email protected]:5060
10.2.6.215 10.2.6.221 SIP 100 trying
10.2.6.215 10.2.6.221 SIP 100 ringing
10.2.6.215 10.2.6.221 SIP/SDP 200 OK (INVITE)
10.2.6.221 20.12.19.31 SIP ACK sip:20.12.19.31:5060
10.2.6.221 20.12.19.31 SIP BYE sip:20.12.19.31:5060

The issue from what I can tell is FreePBX is responding to the invite saying that the inbound call should talk to the external address, which it can’t so the call aborts. How do I fix this?

10.2.6.221 is my Cisco Call Manager
10.2.6.215 is FreePBX
20.12.19.31 is the external address (way downstream) that is auto-populated in General SIP Settings.
CALL SIP LOG: the 10.2.6.210 is a Telos system that is a client to the FreePBX system. Telos won’t integrate directly into CM and requires a middle device FreePBX.

Do you have the 10.2.6.x subnet added in SIP settings as local subnet
is the context on the trunk as from-internal

Yes, 10.2.6.x is listed under Local Networks.
Under pjsip Settings:
Authentication Disabled
Authentication: None
Registration: None
SIP Server: 10.2.6.221
SIP Server Port: 5060
Context: from-internal
Transport: 0.0.0.0-udp

After changing Local Networks, you must restart (not just reload) Asterisk.

If that’s not your issue, at the Asterisk command prompt, type
pjsip set logger on
make a test call in, paste the Asterisk log for the call at pastebin.freepbx.org and post the last eight characters of the URL.

In the trunk pjsip settings- Advanced
Set from-domain to the local PBX ip 10.2.6.215

Just FYI, newer versions of Asterisk will apply local network, external settings with a reload now. Changing bind, port, protocol, etc. still requires a restart.

1 Like

What do you mean by “User 7123”? If you have an extension 7123 on FreePBX, why is the INVITE sent to 1234? If you have extension 7123 on CM, how can it be registered if the trunk has ‘Registration None’?

Typo. it’s all 7123.

logged in as root on the console, command didnt work.
pjsip set logger on
-bash: pjsip: command not found

At the Asterisk command prompt, not a shell prompt.

From a root shell prompt type
asterisk -r
to get an Asterisk prompt.

Also, please post the contents of
/etc/asterisk/pjsip.transports.conf

Not sure how to pull the pjsip.transport.conf file

SIP LOG:

e[0K<— Received SIP request (1195 bytes) from UDP:10.2.6.221:5060 —>
INVITE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 10.2.6.221:5060;branch=z9hG4bK30c42853ed1877
From: “ME” sip:[email protected];tag=29962388~142540b9-cc6a-44e6-b5ab-b4cfe0ad7da3-35750756
To: sip:[email protected]
Date: Thu, 08 Jun 2023 14:38:57 GMT
Call-ID: [email protected]
Supported: timer,resource-priority,replaces
Min-SE: 1800
User-Agent: Cisco-CUCM14.0
Allow: INVITE, OPTIONS, INFO, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, NOTIFY
CSeq: 101 INVITE
Expires: 180
Allow-Events: presence
Supported: X-cisco-srtp-fallback,X-cisco-original-called
Call-Info: urn:x-cisco-remotecc:callinfo;x-cisco-video-traffic-class=DESKTOP;x-cisco-qos-tcl=true
Session-ID: 3835e3f600105000a00094d4690ce8b7;remote=00000000000000000000000000000000
Cisco-Guid: 0835050496-0000065536-0000008635-3712276490
Session-Expires: 1800
P-Asserted-Identity: “ME” sip:[email protected]
Remote-Party-ID: “ME” sip:[email protected];party=calling;screen=yes;privacy=off
Contact: sip:[email protected]:5060;video;audio;+u.sip!devicename.ccm.cisco.com=“SEP94D4690CE8B7”
Max-Forwards: 69
Content-Length: 0

e[0K<— Transmitting SIP response (386 bytes) to UDP:10.2.6.221:5060 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.2.6.221:5060;rport=5060;received=10.2.6.221;branch=z9hG4bK30c42853ed1877
Call-ID: [email protected]
From: “ME” sip:[email protected];tag=29962388~142540b9-cc6a-44e6-b5ab-b4cfe0ad7da3-35750756
To: sip:[email protected]
CSeq: 101 INVITE
Server: FPBX-14.0.10.3(13.22.0)
Content-Length: 0

e[0K[2023-06-08 14:38:57] e[1;31mWARNINGe[0m[20683][C-00000004]: e[1;37mchan_sip.ce[0m:e[1;37m22996e[0m e[1;37mfunc_header_reade[0m: This function can only be used on SIP channels.
[2023-06-08 14:38:57] e[1;31mWARNINGe[0m[20683][C-00000004]: e[1;37mchan_sip.ce[0m:e[1;37m22996e[0m e[1;37mfunc_header_reade[0m: This function can only be used on SIP channels.
[2023-06-08 14:38:57] e[1;31mWARNINGe[0m[20683][C-00000004]: e[1;37mchan_sip.ce[0m:e[1;37m22996e[0m e[1;37mfunc_header_reade[0m: This function can only be used on SIP channels.
[2023-06-08 14:38:57] e[1;31mWARNINGe[0m[20683][C-00000004]: e[1;37mchan_sip.ce[0m:e[1;37m22996e[0m e[1;37mfunc_header_reade[0m: This function can only be used on SIP channels.
[2023-06-08 14:38:57] e[1;31mWARNINGe[0m[20683][C-00000004]: e[1;37mchan_sip.ce[0m:e[1;37m22996e[0m e[1;37mfunc_header_reade[0m: This function can only be used on SIP channels.
[2023-06-08 14:38:57] e[1;31mWARNINGe[0m[20683][C-00000004]: e[1;37mchan_sip.ce[0m:e[1;37m22996e[0m e[1;37mfunc_header_reade[0m: This function can only be used on SIP channels.
[2023-06-08 14:38:57] e[1;31mWARNINGe[0m[20683][C-00000004]: e[1;37mchan_sip.ce[0m:e[1;37m22996e[0m e[1;37mfunc_header_reade[0m: This function can only be used on SIP channels.
[2023-06-08 14:38:57] e[1;31mWARNINGe[0m[20683][C-00000004]: e[1;37mchan_sip.ce[0m:e[1;37m22996e[0m e[1;37mfunc_header_reade[0m: This function can only be used on SIP channels.
[2023-06-08 14:38:57] e[1;31mWARNINGe[0m[20683][C-00000004]: e[1;37mchan_sip.ce[0m:e[1;37m22996e[0m e[1;37mfunc_header_reade[0m: This function can only be used on SIP channels.
[2023-06-08 14:38:57] e[1;31mWARNINGe[0m[20683][C-00000004]: e[1;37mchan_sip.ce[0m:e[1;37m22996e[0m e[1;37mfunc_header_reade[0m: This function can only be used on SIP channels.
[2023-06-08 14:38:57] e[1;31mWARNINGe[0m[20683][C-00000004]: e[1;37mchan_sip.ce[0m:e[1;37m22996e[0m e[1;37mfunc_header_reade[0m: This function can only be used on SIP channels.

e[0K[2023-06-08 14:38:57] e[1;31mWARNINGe[0m[20683][C-00000004]: e[1;37mchan_sip.ce[0m:e[1;37m22996e[0m e[1;37mfunc_header_reade[0m: This function can only be used on SIP channels.

e[0K<— Transmitting SIP response (574 bytes) to UDP:10.2.6.221:5060 —>
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 10.216.68.221:5060;rport=5060;received=10.2.6.221;branch=z9hG4bK30c42853ed1877
Call-ID: [email protected]
From: “ME” sip:[email protected];tag=29962388~142540b9-cc6a-44e6-b5ab-b4cfe0ad7da3-35750756
To: sip:[email protected];tag=254b12fe-5f40-4734-bc6a-37ab2b192b75
CSeq: 101 INVITE
Server: FPBX-14.0.10.3(13.22.0)
Contact: sip:10.2.6.215:5060
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, MESSAGE, REFER
Content-Length: 0

e[0K<— Transmitting SIP request (1075 bytes) to UDP:10.2.6.210:5060 —>
INVITE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 10.2.6.215:5060;rport;branch=z9hG4bKPj3fba805c-4138-4faf-9b0b-b8a23a0ce511
From: “ME” sip:[email protected];tag=f80ad330-4af5-4461-b113-93d6b9b50591
To: sip:[email protected]
Contact: sip:[email protected]:5060
Call-ID: b1a5f12b-c905-47bd-8ac7-124517186d36
CSeq: 27330 INVITE
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 1800
Min-SE: 90
P-Asserted-Identity: “ME” sip:[email protected]
Max-Forwards: 70
User-Agent: FPBX-14.0.10.3(13.22.0)
Content-Type: application/sdp
Content-Length: 341

v=0
o=- 1963091672 1963091672 IN IP4 10.2.6.215
s=Asterisk
c=IN IP4 10.2.6.215
t=0 0
m=audio 16206 RTP/AVP 0 8 3 111 9 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:111 G726-32/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

e[0K<— Received SIP response (329 bytes) from UDP:10.2.6.210:5060 —>
SIP/2.0 100 Trying - CPSIP
Via: SIP/2.0/UDP 10.2.6.215:5060;rport;branch=z9hG4bKPj3fba805c-4138-4faf-9b0b-b8a23a0ce511
From: “ME” sip:[email protected];tag=f80ad330-4af5-4461-b113-93d6b9b50591
To: sip:[email protected]
Call-ID: b1a5f12b-c905-47bd-8ac7-124517186d36
CSeq: 27330 INVITE
Content-Length: 0

e[0K<— Received SIP response (396 bytes) from UDP:10.2.6.210:5060 —>
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 10.2.6.215:5060;rport;branch=z9hG4bKPj3fba805c-4138-4faf-9b0b-b8a23a0ce511
From: “ME” sip:[email protected];tag=f80ad330-4af5-4461-b113-93d6b9b50591
To: sip:[email protected];tag=41f31b3f5cbf1f1e9dcb519ea0940
Contact: sip:[email protected]:5060
Call-ID: b1a5f12b-c905-47bd-8ac7-124517186d36
CSeq: 27330 INVITE
Content-Length: 0

e[0K<— Transmitting SIP response (574 bytes) to UDP:10.2.6.221:5060 —>
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 10.2.6.221:5060;rport=5060;received=10.2.6.221;branch=z9hG4bK30c42853ed1877
Call-ID: [email protected]
From: “ME” sip:[email protected];tag=29962388~142540b9-cc6a-44e6-b5ab-b4cfe0ad7da3-35750756
To: sip:[email protected];tag=254b12fe-5f40-4734-bc6a-37ab2b192b75
CSeq: 101 INVITE
Server: FPBX-14.0.10.3(13.22.0)
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, MESSAGE, REFER
Contact: sip:10.216.68.215:5060
Content-Length: 0

e[0K<— Received SIP response (719 bytes) from UDP:10.2.6.210:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.2.6.215:5060;rport;branch=z9hG4bKPj3fba805c-4138-4faf-9b0b-b8a23a0ce511
From: “ME” sip:[email protected];tag=f80ad330-4af5-4461-b113-93d6b9b50591
To: sip:[email protected];tag=41f31b3f5cbf1f1e9dcb519ea0940
Contact: sip:[email protected]:5060
Call-ID: b1a5f12b-c905-47bd-8ac7-124517186d36
CSeq: 27330 INVITE
Allow: INVITE, ACK, BYE, CANCEL, REFER, OPTIONS, NOTIFY
Content-Type: application/sdp
Content-Length: 238

v=0
o=- 901031393 901031393 IN IP4 10.2.6.210
s=-
c=IN IP4 10.2.6.210
t=0 0
m=audio 62124 RTP/AVP 0 8 9 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15

e[0K<— Transmitting SIP request (429 bytes) to UDP:10.2.6.210:5060 —>
ACK sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 10.2.6.215:5060;rport;branch=z9hG4bKPjf621ebf7-cb85-4a8a-bd8e-75d136329154
From: “ME” sip:[email protected];tag=f80ad330-4af5-4461-b113-93d6b9b50591
To: sip:[email protected];tag=41f31b3f5cbf1f1e9dcb519ea0940
Call-ID: b1a5f12b-c905-47bd-8ac7-124517186d36
CSeq: 27330 ACK
Max-Forwards: 70
User-Agent: FPBX-14.0.10.3(13.22.0)
Content-Length: 0

e[0K<— Transmitting SIP response (967 bytes) to UDP:10.2.6.221:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.2.6.221:5060;rport=5060;received=10.2.6.221;branch=z9hG4bK30c42853ed1877
Call-ID: [email protected]
From: “ME” sip:[email protected];tag=29962388~142540b9-cc6a-44e6-b5ab-b4cfe0ad7da3-35750756
To: sip:[email protected];tag=254b12fe-5f40-4734-bc6a-37ab2b192b75
CSeq: 101 INVITE
Server: FPBX-14.0.10.3(13.22.0)
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, MESSAGE, REFER
Contact: sip:10.2.6.215:5060
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 1800;refresher=uac
Require: timer
Content-Type: application/sdp
Content-Length: 263

v=0
o=- 2110758865 2110758865 IN IP4 10.2.6.215
s=Asterisk
c=IN IP4 10.2.6.215
t=0 0
m=audio 17280 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

e[0K<— Received SIP request (565 bytes) from UDP:10.2.6.221:5060 —>
ACK sip:10.2.6.215:5060 SIP/2.0
Via: SIP/2.0/UDP 10.2.6.221:5060;branch=z9hG4bK30c429544d49c4
From: “ME” sip:[email protected];tag=29962388~142540b9-cc6a-44e6-b5ab-b4cfe0ad7da3-35750756
To: sip:[email protected];tag=254b12fe-5f40-4734-bc6a-37ab2b192b75
Date: Thu, 08 Jun 2023 14:38:57 GMT
Call-ID: [email protected]
User-Agent: Cisco-CUCM14.0
Max-Forwards: 70
CSeq: 101 ACK
Allow-Events: presence
Session-ID: 3835e3f600105000a00094d4690ce8b7;remote=ff2111c0f7eeb72a0d1be7ab29962388
Content-Length: 0

e[0K<— Received SIP request (540 bytes) from UDP:10.2.6.221:5060 —>
BYE sip:10.2.6.215:5060 SIP/2.0
Via: SIP/2.0/UDP 10.2.6.221:5060;branch=z9hG4bK30c42a2b8dd30b
From: “ME” sip:[email protected];tag=29962388~142540b9-cc6a-44e6-b5ab-b4cfe0ad7da3-35750756
To: sip:[email protected];tag=254b12fe-5f40-4734-bc6a-37ab2b192b75
Date: Thu, 08 Jun 2023 14:38:57 GMT
Call-ID: [email protected]
User-Agent: Cisco-CUCM14.0
Max-Forwards: 70
P-Asserted-Identity: “ME” sip:[email protected]
CSeq: 102 BYE
Reason: Q.850;cause=47
Content-Length: 0

e[0K<— Transmitting SIP request (489 bytes) to UDP:10.2.6.221:5060 —>
BYE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 10.2.6.215:5060;rport;branch=z9hG4bKPjcf092707-0ad7-4950-8fb5-0215b843e389
From: sip:[email protected];tag=254b12fe-5f40-4734-bc6a-37ab2b192b75
To: “ME” sip:[email protected];tag=29962388~142540b9-cc6a-44e6-b5ab-b4cfe0ad7da3-35750756
Call-ID: [email protected]
CSeq: 28038 BYE
Reason: Q.850;cause=16
Max-Forwards: 70
User-Agent: FPBX-14.0.10.3(13.22.0)
Content-Length: 0

e[0K<— Transmitting SIP response (420 bytes) to UDP:10.2.6.221:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.2.6.221:5060;rport=5060;received=10.2.6.221;branch=z9hG4bK30c42a2b8dd30b
Call-ID: [email protected]
From: “ME” sip:[email protected];tag=29962388~142540b9-cc6a-44e6-b5ab-b4cfe0ad7da3-35750756
To: sip:[email protected];tag=254b12fe-5f40-4734-bc6a-37ab2b192b75
CSeq: 102 BYE
Server: FPBX-14.0.10.3(13.22.0)
Content-Length: 0

e[0K<— Transmitting SIP request (453 bytes) to UDP:10.216.68.210:5060 —>
BYE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 10.2.6.215:5060;rport;branch=z9hG4bKPjeff3931b-6da2-4d6f-9699-7139b202d8e2
From: “ME” sip:[email protected];tag=f80ad330-4af5-4461-b113-93d6b9b50591
To: sip:[email protected];tag=41f31b3f5cbf1f1e9dcb519ea0940
Call-ID: b1a5f12b-c905-47bd-8ac7-124517186d36
CSeq: 27331 BYE
Reason: Q.850;cause=47
Max-Forwards: 70
User-Agent: FPBX-14.0.10.3(13.22.0)
Content-Length: 0

e[0K<— Received SIP response (445 bytes) from UDP:10.2.6.221:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.2.6.215:5060;rport;branch=z9hG4bKPjcf092707-0ad7-4950-8fb5-0215b843e389
From: sip:[email protected];tag=254b12fe-5f40-4734-bc6a-37ab2b192b75
To: “ME” sip:[email protected];tag=29962388~142540b9-cc6a-44e6-b5ab-b4cfe0ad7da3-35750756
Date: Thu, 08 Jun 2023 14:39:01 GMT
Call-ID: [email protected]
Server: Cisco-CUCM14.0
CSeq: 28038 BYE
Content-Length: 0

e[0K<— Received SIP response (348 bytes) from UDP:10.2.6.210:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.2.6.215:5060;rport;branch=z9hG4bKPjeff3931b-6da2-4d6f-9699-7139b202d8e2
From: “ME” sip:[email protected];tag=f80ad330-4af5-4461-b113-93d6b9b50591
To: sip:[email protected];tag=41f31b3f5cbf1f1e9dcb519ea0940
Call-ID: b1a5f12b-c905-47bd-8ac7-124517186d36
CSeq: 27331 BYE
Content-Length: 0

e[0K<— Transmitting SIP request (447 bytes) to UDP:10.216.68.221:5060 —>
OPTIONS sip:10.2.6.221:5060 SIP/2.0
Via: SIP/2.0/UDP 10.2.6.215:5060;rport;branch=z9hG4bKPj42bfad57-4c53-4a2f-aae4-5b408aa336bb
From: sip:[email protected];tag=f6a58ec5-99e7-4752-9db8-f43767b2a39f
To: sip:10.2.6.221
Contact: sip:[email protected]:5060
Call-ID: 29df6525-a3c8-4904-8396-2ac7b31f7741
CSeq: 62060 OPTIONS
Max-Forwards: 70
User-Agent: FPBX-14.0.10.3(13.22.0)
Content-Length: 0

e[0K<— Received SIP response (476 bytes) from UDP:10.2.6.221:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.2.6.215:5060;rport;branch=z9hG4bKPj42bfad57-4c53-4a2f-aae4-5b408aa336bb
From: sip:[email protected];tag=f6a58ec5-99e7-4752-9db8-f43767b2a39f
To: sip:10.2.6.221;tag=40634865
Date: Thu, 08 Jun 2023 14:39:01 GMT
Call-ID: 29df6525-a3c8-4904-8396-2ac7b31f7741
Server: Cisco-CUCM14.0
CSeq: 62060 OPTIONS
Allow: INVITE, OPTIONS, INFO, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, NOTIFY
Content-Length: 0

I see no incorrect IP addresses used in that signaling. The call is actually hung up due to the Cisco sending a BYE, which then causes Asterisk to end the call. In the BYE from the Cisco is:

Reason: Q.850;cause=47

A quick Google for “cucm cause code 47” shows:

Typically, 47 cause code is due to a media resource that is a transcoder, MTP, etc… not being available . You should start by looking at CUCM traces for media resource allocation errors and verify that your codecs and regions settings are all correct. Cause code 47 typically indicates a problem with negotiating media.

So this would be media related. You could try limiting the CUCM in FreePBX to a single codec, otherwise you’d need to look at CUCM.

2 Likes

I have had an issue long ago where one of my phones was not connecting properly and it was due to the CODEC the phone was using. The only one I allow the PBX to use is G.711u and the phone was using G.729. Perhaps this is what’s causing your issue?

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.