[OpenSIPS-Users] Public IP in REGISTER

Callum Guy callum.guy at x-on.co.uk
Wed Mar 4 08:49:53 EST 2020


Hi Jehan,

Sounds like you want to be using fix_nated_contact() - when the INVITE
arrives you can try the following:

# Check if contact is RFC1918
if (nat_uac_test(1)) {
    # Replace the contact IP with the received address from the network
    fix_nated_contact();
}

If you look at the registrations via CLI or database (if in use) you'll see
that OpenSIPs is tracking both a contact and received value to deal with
this - that will be where your NAT pings are getting the address from.

Hopefully that helps to get you on the correct path!

Callum

On Tue, 3 Mar 2020 at 21:06, Jehanzaib Younis <jehanzaib.kiani at gmail.com>
wrote:

> Hi gang,
>
> I have quite strange issue. When in some cases when my customer's have
> 10.202.128.xx range they are behind NAT. when i see opensipsctl ul show
> number at sip
> i see contact header as Contact:: sip:number at 10.202.128.xx:5060;transport=udp
> Q=
> which means when i try to relay the invite goes to that 10.202.128.xx:5060
> which is wrong. It should go to its public IP:port
>
> but weird thing is, i see the OPTION is sent to its Public IP (OPTIONS
> sip:180.xx.xx.xx:1502). I also see the 200 OK which is perfect.
>
> I tried to use fix_nated_register(); but it does not change anything.
>
> Can anyone help please?
>
> Thank you
>
>
> Regards,
> Jehan
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>

-- 





*0333 332 0000  |  www.x-on.co.uk <http://www.x-on.co.uk>  |   ** 
<https://www.linkedin.com/company/x-on>   <https://www.facebook.com/XonTel> 
  <https://twitter.com/xonuk> *


X-on
is a trading name of Storacall 
Technology Ltd a limited company registered in
England and Wales.


Registered Office : Avaland House, 110 London Road, Apsley, Hemel 
Hempstead,
Herts, HP3 9SD. Company Registration No. 2578478.

The 
information in this e-mail is confidential and for use by the addressee(s)

only. If you are not the intended recipient, please notify X-on immediately 
on +44(0)333 332 0000 and delete the
message from your computer. If you are 
not a named addressee you must not use,
disclose, disseminate, distribute, 
copy, print or reply to this email. Views
or opinions expressed by an 
individual
within this email may not necessarily
reflect the views of X-on 
or its associated companies. Although X-on routinely
screens for viruses, 
addressees should scan this email and any attachments
for
viruses. X-on 
makes no representation or warranty as to the absence of viruses
in this 
email or any attachments.










-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20200304/3e6c387c/attachment.html>


More information about the Users mailing list