Hi folks, little help?
I have an interconnect to two SIP providers via MAN and one NIC.
For the 1st provider:
Asterisk eth0 - 192.168.0.10
gate - 192.168.0.1
real IP - 1.2.3.4
The gate is doing full nat. What comes from Asterisk to provider1 is routing throu the MAN of provider1 (1.2.3.4), what comes from provider1 to 1.2.3.4 is DNAT-ing back to Asterisk (all ports and protocols).
For SIP provider2:
Asterisk eth0.100 - 11.22.33.44 (VLAN interface, real public IP that gave me provider2)
gate - 22.33.44.55 (real public gate of provider2)
Here I have a direct routing to provider2.
I want to do ORIGINATE with number from provider1 and number with provider2. The RTP has to stay in Asterisk, these two networks cannot be accessed via Internet. Provider1 do not have access to provider2 and vise verca.
With default sip.conf (no externip or localnet) and “canreinvite = no” for provider2 when making calls throu provider2 everything works (RTP is in Asterisk). Contact header in SDP is the real IP for provider2 (11.22.33.44). With provider1 this do not work. Contact header in SDP is my fake IP - 192.168.0.10. I have to put externip in sip.conf to my external IP for provider1 to work. But in that case provider2 do not work.
In other words how do you make calls when you have 2 SIP providers with 2 different routing to them, with 2 different real IP addresses?