I had this thread already starred here in inbox, a wiki page is definitely going to be bookmarked.<br><br><div class="gmail_quote">On Mon, Jun 25, 2012 at 9:44 PM, Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"><div class="im">
<br>
<div>On 6/25/12 3:34 PM, SamyGo wrote:<br>
</div>
<blockquote type="cite">This is a great thread, really full of answers and
concepts for me atleast.
<div>:)<br>
</div>
</blockquote>
<br></div>
looks like we will have a new wiki page with the digested content of
this thread :-)<br>
<br>
Cheers,<br>
Daniel<div><div class="h5"><br>
<blockquote type="cite">
<div><br>
<div class="gmail_quote">On Mon, Jun 25, 2012 at 5:57 PM,
Richard Brady <span dir="ltr"><<a href="mailto:rnbrady@gmail.com" target="_blank">rnbrady@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Klaus /
Daniel<br>
<br>
Thanks again for assistance with this.<br>
<br>
I've tried the solution based on add_contact_alias() and<br>
handle_ruri_alias() and it works perfectly.<br>
<span><font color="#888888"><br>
Richard<br>
</font></span>
<div>
<div><br>
On 22 June 2012 13:47, Klaus Darilion <<a href="mailto:klaus.mailinglists@pernau.at" target="_blank">klaus.mailinglists@pernau.at</a>>
wrote:<br>
><br>
><br>
> On 22.06.2012 13:50, Richard Brady wrote:<br>
>><br>
>> Thanks guys, fantastic answers.<br>
>><br>
>> You mention that NAT detection happens before
save() and the flag is set<br>
>> by lookup() which makes much more sense.
However, if Kamailio is not the<br>
>> registrar, as is the case with my current
project, those functions are<br>
>> not called, so an alternative is needed. There
are clearly several<br>
>> options.<br>
>><br>
>> The solution I have gone for is to replace
fix_nated_register() with<br>
>> fix_nated_contact() so that the REGISTER
request is relayed with a<br>
>> modified Contact header containing the external
ip:port of the client.<br>
><br>
><br>
> The cleanest solution would be to use
add_contact_alias() and<br>
> handle_ruri_alias(). The do not change the contact
but put the public<br>
> address into a uri parameter. Thus, the URI seen by
the client is always the<br>
> one it sends:<br>
> <a href="http://www.kamailio.org/docs/modules/3.2.x/modules_k/nathelper.html#id2550431" target="_blank">http://www.kamailio.org/docs/modules/3.2.x/modules_k/nathelper.html#id2550431</a><br>
><br>
><br>
>> That is then stored by the registrar
(FreeSWITCH in my case) and used<br>
>> later to originate calls for that user. The
FreeSWITCH know to send<br>
>> those calls to Kamailio through either use of
the Path header and module<br>
>> in Kamailio, or through static configuration of
fs_path or proxy<br>
>> parameters in FreeSWITCH.<br>
><br>
><br>
> This is fine.<br>
><br>
><br>
>> The works for the first INVITE to the
registered client behind NAT. But<br>
>> that client sends back a 200 OK with a Contact
header containing its<br>
>> private IP address, and so fix_nated_contact()
needs to be invoked on<br>
>> that response, and normally it would be due to
FLB_NATB being set, but<br>
>> if Kamailio was not the registrar then that
flag is not set. So I need<br>
>> to detect NAT on the client at the time of
receiving the reply, or<br>
>> alternatively by having the registrar store a
cookie and setting it<br>
>> based on that.<br>
><br>
><br>
> You are correct. For in-dialog messages received
from SIP clients I would<br>
> always use add_contact_alias() and remove the NAT
flags completely.<br>
><br>
>><br>
>> I suppose then my next question then is can I
call nat_uac_test() on a<br>
>> UAS?<br>
><br>
><br>
> Today, almost any SIP clients are SIP symmetric.
This means, that they<br>
> receive SIP from the some port/connection where
they send. Thus, skip the<br>
> NAT tests completely and always use
add_contact_alias() for messages receive<br>
> from SIP clients and handle_ruri_alias() for
messages sent to SIP clients.<br>
><br>
> Depending on if you use Freeswitch also as media
relay you can also remove<br>
> the media proxy stuff from the Kamailio config.<br>
><br>
> On important thing is NAT-keep-alive. This is
usually done by nathelper<br>
> module by querying the location table for contact
with NAT-flag set. Thus,<br>
> either you do NAT keep-alive by freeswitch (e.g
sending OPTIONS requests) or<br>
> do it in your Kamailio proxy (e.g. set the
nat_bflag<br>
> <a href="http://www.kamailio.org/docs/modules/3.2.x/modules_k/usrloc.html#id2541477" target="_blank">http://www.kamailio.org/docs/modules/3.2.x/modules_k/usrloc.html#id2541477</a><br>
> and call save("location","0x02") before relaying
REGISTER to freeswitch.<br>
> Then Kamailio will do NAT-pinging. Note, if you
want to keep-alive only for<br>
> successfully registered clients, you man want to
call save() in the<br>
> reply-route of the REGISTER request).<br>
><br>
> regards<br>
> Klaus<br>
<br>
_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) -
sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset></fieldset>
<br>
<pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<br>
</div></div><div class="im"><pre cols="72">--
Daniel-Constantin Mierla - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
<a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
Kamailio Advanced Training, Seattle, USA, Sep 23-26, 2012 - <a href="http://asipto.com/u/katu" target="_blank">http://asipto.com/u/katu</a>
Kamailio Practical Workshop, Netherlands, Sep 10-12, 2012 - <a href="http://asipto.com/u/kpw" target="_blank">http://asipto.com/u/kpw</a></pre>
</div></div>
</blockquote></div><br>