[SR-Users] Nathelper module, FLT_NATS, FLT_NATB

Richard Brady rnbrady at gmail.com
Fri Jun 22 13:50:37 CEST 2012


Thanks guys, fantastic answers.

You mention that NAT detection happens before save() and the flag is set by
lookup() which makes much more sense. However, if Kamailio is not the
registrar, as is the case with my current project, those functions are not
called, so an alternative is needed. There are clearly several options.

The solution I have gone for is to replace fix_nated_register() with
fix_nated_contact() so that the REGISTER request is relayed with a modified
Contact header containing the external ip:port of the client. That is then
stored by the registrar (FreeSWITCH in my case) and used later to originate
calls for that user. The FreeSWITCH know to send those calls to Kamailio
through either use of the Path header and module in Kamailio, or through
static configuration of fs_path or proxy parameters in FreeSWITCH.

The works for the first INVITE to the registered client behind NAT. But
that client sends back a 200 OK with a Contact header containing its
private IP address, and so fix_nated_contact() needs to be invoked on that
response, and normally it would be due to FLB_NATB being set, but if
Kamailio was not the registrar then that flag is not set. So I need to
detect NAT on the client at the time of receiving the reply, or
alternatively by having the registrar store a cookie and setting it based
on that.

I suppose then my next question then is can I call nat_uac_test() on a UAS?

Thanks again for the great answers.

Regards,
Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20120622/3a691eef/attachment.htm>


More information about the sr-users mailing list