Sorry for re-activating this kind of old topic, but I am facing a similar issue.
I am running FreePBX 15.0.17.24 with Asterisk 17.9.3 with two ethernet interfaces, one with local network where all the client phones are in (eth0, 192.168.0.0/20) and one that is connected to the internet and therefore to the external SIP Server (eth1, 10.2.x.x/28).
Now I am facing the problem that SIP messages to internal client phones have the wrong IP address in their FROM-Header (10.2.x.x instead 192.168.x.x).
The SIP message from SIP Registrar for incoming call looks like:
<--- Received SIP request (1020 bytes) from UDP:SIPPROVIDERIP:5060 --->
INVITE sip:TARGETNUMBER@SIPPROVIDER;user=phone SIP/2.0
Via: SIP/2.0/UDP SIPPROVIDERIP:5060;branch=z9hG4bKpgrcno1020p0ufmuj990.1
To: <sip:TARGETNUMBER@SOURCEPROVIDER;user=phone>
From: <sip:SOURCENUMBER@SOURCEPROVIDER;user=phone>;tag=SDdk5a201-1249f1ca
Call-ID: SDdk5a201-343b023ee3b8844802dede39d628fe80-ct4u830
CSeq: 1 INVITE
Max-Forwards: 60
Contact: <sip:SOURCENUMBER@SIPPROVIDERIP:5060;transport=udp>
Date: Tue, 13 Apr 2021 11:45:48 GMT
Allow: INVITE, ACK, PRACK, CANCEL, BYE, OPTIONS, MESSAGE, NOTIFY, UPDATE, REGISTER, INFO, REFER, SUBSCRIBE
Supported: resource-priority
P-Asserted-Identity: <sip:SOURCENUMBER@SOURCEPROVIDER;user=phone>
P-Asserted-Identity: <tel:SOURCENUMBER>
Accept: application/sdp
P-Early-Media: supported
Content-Type: application/sdp
Content-Length: 205
v=0
o=- 1240461225 0 IN IP4 SIPPROVIDERIP
s=IMSS
c=IN IP4 SIPPROVIDERIP
t=0 0
m=audio 13942 RTP/AVP 9 8 0 110
a=rtpmap:110 telephone-event/8000
a=fmtp:110 0-15
a=sendrecv
a=maxptime:40
a=ptime:20
but the SIP message to clients phone looks like:
<--- Transmitting SIP request (731 bytes) to UDP:CLIENTIP:5066 --->
INVITE sip:INTERNALNUMBER@CLIENTIP:5066 SIP/2.0
Via: SIP/2.0/UDP 192.168.XX.YY:5060;rport;branch=z9hG4bKPj2fcfc11a-b046-4efd-b048-2db73b007c5c
From: "SOURCENUMBER" <sip:SOURCENUMBER0@10.2.NN.MM>;tag=acb76419-7bf2-4e1a-857c-5ad1f2f42208
To: <sip:INTERNALNUMBER@CLIENTIP>
Contact: <sip:SOURCENUMBER0@192.168.XX.YY:5060>
Call-ID: c32fda0f-2de2-4cab-86f6-bbf6035e6ee7
CSeq: 29826 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
P-Asserted-Identity: "SOURCENUMBER" <sip:SOURCENUMBER0@10.2.NN.MM>
Max-Forwards: 70
User-Agent: FPBX-15.0.17.24(17.9.3)
Content-Length: 0
Does anybody know how to set correct IP address for internal network?
Communication itself works fine, but I have the issue that I can’t call back incoming calls on some of our SIP softphones as they try to call to NUMBER@10.2.x.x (that was sent in FROM Header) instead of NUMBER@192.168.x.x and therefore the call does not reach asterisk at all…
In /etc/asterisk/pjsip.transports.conf
I have configured all local addresses (192.168.x.x and 10.9. for VPN) for local_net
:
[0.0.0.0-udp]
type=transport
protocol=udp
bind=0.0.0.0:5060
external_media_address=176.X.Y.Z
external_signaling_address=176.X.Y.Z
allow_reload=no
tos=cs3
cos=3
local_net=192.168.0.0/255.255.240.0
local_net=10.9.0.0/255.255.255.0
[0.0.0.0-tcp]
type=transport
protocol=tcp
bind=0.0.0.0:5060
external_media_address=176.X.Y.Z
external_signaling_address=176.X.Y.Z
allow_reload=no
tos=cs3
cos=3
local_net=192.168.0.0/255.255.240.0
local_net=10.9.0.0/255.255.255.0
Is there any other option to tell asterisk to use 192.168.x.x within FROM Header?