Hello.
There is a phone network (172.16.16.0/20 ) with SIP devices, which I cannot control or change thei settings.
That network has no registrar; all sip calls are peer-to-peer, so user names/phones are irrelevant, only IP adresses matter.
One of those devices, however, is on my territory, so I can replace it with asterisk server.
The server has two network interfaces, one for the phone network with adress 172.16.19.86, and one for my local home network with address 192.168.1.4.
When I make a call from my home network via asterisk, asterisk somewhy puts home network address to INVITE sent into phone network:
Via: SIP/2.0/UDP 172.16.19.86:5060;rport;branch=z9hG4bKPj9d2f1e95-4a1b-45e2-9d1d-003afc6c5404
From: "6002" <sip:6002@192.168.1.4>;tag=c0e0944e-5815-483e-a690-7de28001761f
To: <sip:172.16.28.10>
Contact: <sip:asterisk@172.16.19.86:5060>
<...>
IP address in From is 192.168.1.4, but it should be 172.16.19.86.
(As far as I understand how B2BUAs should behave)
I dont know why, but other devices answers with 486 Busy Here for such malformed INVITEs, and are working correctly if they see correct address in From. I verified that with sending hand-crafted packets. So keeping things as they are is not an option.
Peers in the phone network are called from dialplan with Dial command:
exten => _XXX_XXX_XXX_XXX,1,Dial(PJSIP/doorphone-network-trunk/sip:172.16.28.10:5060)
(ip is hardcoded for debugging purposes).
So the question is: is there a way to make asterisk put correct header in the From field?