SOLVED Can't make outbound calls

Status
Not open for further replies.

TurabG

Member
Aug 25, 2022
77
6
8
44
I have been asking noob questions around, I hope you guys can bear with me.

In my local instance which I played for more than 2 weeks, I could make outbound calls successfully. Now I am trying to setup a production environment for the first time. On a VPS, behind a firewall. My trunk registers fine. I receive inbound calls and make calls between extensions, without a problem.

I have created only one outbound route which routes 11 digit numbers to my only trunk.

I am receiving 403 from my provider when I try to make outbound calls. They have been really helpful diagnosing the problem but we ended up like this: I have 3 other trunks from the same provider which work on 3CX and they told me that I'd better look up the successful call logs and compare them to the one which gets me a 403.

When I try to make an outbound call, here is what happens:

Request from the extension to the Fusion server:
Code:
INVITE sip:my_mobile_number_xxx@domain SIP/2.0
client_remote_ip_xxx:12095    fusion_remote_ip_xxx:5080
Via: SIP/2.0/TCP client_local_ip_xxx:12095;branch=z9hG4bK158290937;rport
From: "Caller Name" <sip:1001@domain>;tag=3160441591
To: <sip:my_mobile_number_xxx@domain>
Call-ID: 0_2763846314
CSeq: 1 INVITE
Contact: <sip:1001@client_local_ip_xxx:12095;transport=TCP>
Content-Type: application/sdp
Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDA
, MESSAGE
Max-Forwards: 70
User-Agent: Yealink SIP-T21P_E2 52.84.0.140
Allow-Events: talk,hold,conference,refer,check-sync
Supported: replaces
Content-Length: 300

v=0
o=- 20002 20002 IN IP4 client_local_ip_xxx
s=SDP data
c=IN IP4 client_local_ip_xxx
t=0 0
m=audio 12724 RTP/AVP 0 8 18 9 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 mode=20
a=rtpmap:9 G722/8000
a=ptime:20
a=sendrecv
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15

Request from the Fusion to the provider:
Code:
INVITE sip:my_mobile_number_xxx@provider_host_name:5060 SIP/2.0
Via: SIP/2.0/UDP fusion_remote_ip_xxx:5070;rport;branch=z9hG4bK95N44tHa1Z8pg
Max-Forwards: 69
From: "trunk_no_xxx" <sip:trunk_no_xxx@fusion_remote_ip_xxx>;tag=NecSXmpr5KBZH
To: <sip:my_mobile_number_xxx@provider_host_name:5060>
Call-ID: 4de50e45-182e-123c-a684-005056aecfdb
CSeq: 62819099 INVITE
Contact: <sip:gw+d0f6xxxxxxxxxxxxxxxxxxxx@fusion_remote_ip_xxx:5070;transport=udp;gw=d0f6xxxxxxxxxxxxxxxxxxxxxxxxx>
User-Agent: FreeSWITCH
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY
Supported: path, replaces
Allow-Events: talk, hold, conference, refer
Content-Type: application/sdp
Content-Disposition: session
Content-Length: 295
X-FS-Support: update_display,send_info
Remote-Party-ID: "trunk_no_xxx" <sip:trunk_no_xxx@fusion_remote_ip_xxx>;party=calling;screen=yes;privacy=off

v=0
o=FreeSWITCH 1674720895 1674720896 IN IP4 fusion_remote_ip_xxx
s=FreeSWITCH
c=IN IP4 fusion_remote_ip_xxx
t=0 0
m=audio 24868 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
a=silenceSupp:off - - - -
a=ptime:20

By the way, I am using 5070 port in my external profile and 5080 port in internal profile.

Here the response coming from the provider:
Code:
2023/01/26 18:09:43.292407 provider_ip_xxx:5060 -> local_fusion_ip_xxxx:5070
SIP/2.0 403 Forbidden request
Via: SIP/2.0/UDP remote_fusion_ip_xxxxxx:5070;received=remote_fusion_ip_xxxxxx;rport=5070;branch=z9hG4bK95N44tHa1Z8pg
From: "xxxxxx" <sip:xxxxxx@remote_fusion_ip_xxxxxx>;tag=NecSXmpr5KBZH
To: <sip:my_mobile_number_xxx@provider_host_name:5060>;tag=4803055e69cf205bac0201836d47780b.0707
Call-ID: 4de50e45-182e-123c-a684-005056aecfdb
CSeq: 62819099 INVITE
Server: OpenSIPS (2.3.6 (x86_64/linux))
Content-Length: 0

When I saw the contact header, I found it different from my local instance tests (which unfortunately I destroyed), although (as far as I know) I hadn't changed anything to effect contact header like this. So I tried forcing contact header re-writing in another extension's settings and made a call again. This time the request never goes to the provider. Fusion first responds with a 407 requiring authentication. The client returns another invite with authentication this time, then Fusion returns with 183 Session Progress and a subsequent 480 Temporarily Unavailable.

Here is that request from client to Fusion with forcing contact header re-writing:
Code:
INVITE sip:my_mobile_number_xxx@domain SIP/2.0
client_remote_ip_xxx:12466 fusion_remote_ip_xxx:5080
Via: SIP/2.0/TCP client_local_ip_xxx:12466;branch=z9hG4bK2724368777;rport
From: "1002" <sip:1002@domain>;tag=293730739
To: <sip:my_mobile_number_xxx@domain>
Call-ID: 0_1136942625
CSeq: 1 INVITE
Contact: <sip:1001@fusion_remote_ip_xxx:12466;transport=TCP>
Content-Type: application/sdp
Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDA
, MESSAGE
Max-Forwards: 70
User-Agent: Yealink SIP-T21P_E2 52.84.0.140
Allow-Events: talk,hold,conference,refer,check-sync
Supported: replaces
Content-Length: 300

v=0
o=- 20004 20004 IN IP4 client_local_ip_xxx
s=SDP data
c=IN IP4 client_local_ip_xxx
t=0 0
m=audio 12370 RTP/AVP 0 8 18 9 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 mode=20
a=rtpmap:9 G722/8000
a=ptime:20
a=sendrecv
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15

When I test the other trunks running on 3CX on the same IP on port 5060, here is a successful outbound call request:
(After receiving a 407 Proxy Auth. Required)
Code:
INVITE sip:my_mobile_number_xxx@domain@provider_host_name:5060 SIP/2.0
Via: SIP/2.0/UDP 3cx_local_ip_xxx:5060;branch=z9hG4bK-524287-1---2e6fc7675961756d;rport
Max-Forwards: 70
Contact: <sip:other_turkn_no_xxx@3cx_remote_ip_xxx:5060>
To: <sip:my_mobile_number_xxx@provider_host_name:5060>
From: "other_trunk_no_xxx"<sip:other_turkn_no_xxx@3cx_remote_ip_xxx:5060>;tag=c51e4c0e
Call-ID: t5Qd8UzCmcEeuHIYwQyFoQ..
CSeq: 2 INVITE
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REGISTER, SUBSCRIBE, NOTIFY, REFER, INFO, MESSAGE, UPDATE
Content-Type: application/sdp
Proxy-Authorization: Digest username="other_trunk_no_xxx",realm="provider_host_name",nonce="63d155dxxxxxxxxxxxxxxx",uri="sip:my_mobile_number_xxx@provider_host_name:5060",response="6513de7xxxxxxxxxxxxx",algorithm=MD5
Supported: replaces, timer
User-Agent: 3CXPhoneSystem 18.0.5.418 (418)
Remote-Party-ID: "other_trunk_no_xxx"<sip:other_turkn_no_xxx@3cx_remote_ip_xxx:5060>;party=calling
Content-Length: 277

v=0
o=3cxPS 63552094208 55129931777 IN IP4 3cx_remote_ip_xxx
s=3cxPS Audio call
c=IN IP4 3cx_remote_ip_xxx
t=0 0
m=audio 10090 RTP/AVP 18 0 8 101
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=sendrecv

3cx_remote_ip is actually also fusion_remote_ip here.

So, what am I missing? What is that I have misconfigured here?
 

TurabG

Member
Aug 25, 2022
77
6
8
44
This has been solved. Turns out From header was the problem. Fusion (very normally) sends its own public IP with the "From:" header by default while the provider required it's host name. So I edited the gateway, set "From Domain" to the provider host name, it worked. (After restarting the gateway.)
 
Status
Not open for further replies.