<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">On 6/25/12 3:34 PM, SamyGo wrote:<br>
</div>
<blockquote
cite="mid:CAJUJwtg5pmwbYV52VdQvB0QZ7XEhEVUgftaermWzeQhWVj=nLQ@mail.gmail.com"
type="cite">This is a great thread, really full of answers and
concepts for me atleast.
<div>:)<br>
</div>
</blockquote>
<br>
looks like we will have a new wiki page with the digested content of
this thread :-)<br>
<br>
Cheers,<br>
Daniel<br>
<blockquote
cite="mid:CAJUJwtg5pmwbYV52VdQvB0QZ7XEhEVUgftaermWzeQhWVj=nLQ@mail.gmail.com"
type="cite">
<div><br>
<div class="gmail_quote">On Mon, Jun 25, 2012 at 5:57 PM,
Richard Brady <span dir="ltr"><<a moz-do-not-send="true"
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 class="HOEnZb"><font color="#888888"><br>
Richard<br>
</font></span>
<div class="HOEnZb">
<div class="h5"><br>
On 22 June 2012 13:47, Klaus Darilion <<a
moz-do-not-send="true"
href="mailto:klaus.mailinglists@pernau.at">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 moz-do-not-send="true"
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 moz-do-not-send="true"
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 moz-do-not-send="true"
href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a moz-do-not-send="true"
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 class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Kamailio Advanced Training, Seattle, USA, Sep 23-26, 2012 - <a class="moz-txt-link-freetext" href="http://asipto.com/u/katu">http://asipto.com/u/katu</a>
Kamailio Practical Workshop, Netherlands, Sep 10-12, 2012 - <a class="moz-txt-link-freetext" href="http://asipto.com/u/kpw">http://asipto.com/u/kpw</a></pre>
</body>
</html>