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.0.0).
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:[email protected]>;tag=acb76419-7bf2-4e1a-857c-5ad1f2f42208
To: <sip:INTERNALNUMBER@CLIENTIP>
Contact: <sip:[email protected]: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:[email protected]>
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?