[OpenSIPS-Users] Public IP in REGISTER

Jehanzaib Younis jehanzaib.kiani at gmail.com
Wed Mar 4 23:04:07 EST 2020


Thank you for your email Callum,
I can not see the public IP in the command line that is strange. but OPTION
is working fine. i can see 200 OK in the OPTION.
I have already tried what you have suggested i.e fixed_nated_contact on
INVITE it is still sending to my 10.xx.xx.xx ip.

Here is my URL location
AOR:: xxxxxx
        Contact:: sip:xxx at 10.202.128.xx:5060;transport=udp Q=
                Expires:: 2914
                Callid:: n883832msp1lm0nl3cmjks88jkpinsc0 at 10.202.128.xx
                Cseq:: 12
                User-agent:: HUAWEI-EchoLife HG8240H/V3R013C10S108
                State:: CS_NEW
                Flags:: 0
                Cflags:: 3
                Socket:: udp:mysipserverip:5060
                Methods:: 8191

here is my url and nat module parameters

loadmodule "usrloc.so"
modparam("usrloc", "nat_bflag", "NAT")
modparam("usrloc", "db_mode",   0)

loadmodule "nathelper.so"
modparam("nathelper", "natping_interval", 120) # Ping interval 120 s
modparam("nathelper", "ping_nated_only", 1)   # Ping only clients behind NAT
modparam("nathelper", "sipping_method", "OPTIONS")
modparam("nathelper", "sipping_from", "sip:pinger at mytestdomain.com")
modparam("nathelper", "received_avp", "$avp(i:42)")
modparam("nathelper", "sipping_bflag", 7)

loadmodule "nat_traversal.so"
modparam("nat_traversal", "keepalive_interval", 120)
modparam("nat_traversal", "keepalive_method", "OPTIONS")
modparam("nat_traversal", "keepalive_from", "sip:pinger at mytestdomain.com")

Any suggestions please?

Thank you


On Wed, Mar 4, 2020 at 9:50 PM Callum Guy <callum.guy at x-on.co.uk> wrote:

> 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.
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20200305/0277c1de/attachment-0001.html>


More information about the Users mailing list