[OpenSIPS-Users] nathelper and mid_register

Jim DeVito jim at devito.cc
Fri Oct 27 10:23:11 EDT 2017


HI Liviu,

I am trying to deal with NAT while OpenSIPS is acting as the mid-register.
The problem is that unless I use fix_nated_contact() mid_register saves the
private IP address in the location "table" so when an INVITE comes from the
main registrar OpenSIPS is unable to route it. Still trying to figure out
how to make that work.

Thanks!!

On Fri, Oct 27, 2017 at 4:40 AM, Liviu Chircu <liviu at opensips.org> wrote:

> Hi Jim,
>
> Both functions attempt to rewrite the Contact - the former with
> SOURCE_IP:SOURCE_PORT, while the latter attempts to do it with
> ADV_IP:ADV_PORT. Due to the "lazy changes" optimization of the OpenSIPS
> stack, you cannot serialize these two function calls, rather you are forced
> to pick one of them.
>
> Fortunately, there is another way around the above: you can have the
> mid-registrar insert itself through a Path header, rather than rewriting
> the Contact to point to its interface. So just switch the mid_registrar to
> "insertion_mode = 1" and you should be good.
>
> PS: can you elaborate on what you are trying to achieve? IIRC,
> fix_nated_contact() should not be called on a REGISTER, rather you should
> use the fix_nated_register() which forces a ";received=" param into the
> Contact. Conceptually, at least - I'm pretty sure this also won't work well
> with mid_registrar_save().
>
> Best regards,
>
> Liviu Chircu
> OpenSIPS Developerhttp://www.opensips-solutions.com
>
> On 26.10.2017 17:08, Jim DeVito wrote:
>
> Hi All,
>
> So if I call fix_nated_contact(); before mid_registrar_save(); It will
> correctly rewrite the Contact URI with the recived IP:PORT however it
> mid_register is then not able to append the contact_match_param to the new
> Contact URI.
>
> The script looks like this...
>
> if (is_method("REGISTER")) {
>                 fix_nated_contact();
>                 mid_registrar_save("location");
>
> It fails with this error.
>
> ERROR:mid_registrar:overwrite_all_contact_hostports: SCRIPT BUG - second
> attempt to change URI Contact
>
> ERROR:mid_registrar:mid_reg_req_fwded: failed to overwrite Contact URI
>
> Thoughts? And Thanks!!
>
> -------------
> Jim DeVito
>
>
> _______________________________________________
> Users mailing listUsers at lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>


-- 
-------------
Jim DeVito
Mobile 216.507.9497
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20171027/e3e4e930/attachment-0001.html>


More information about the Users mailing list