I answer to myself (it may help others) as I could test successfully the configuration below. Also there is a typo (isbflagset instead of isflagset):<br><br>so when I detect a UA is behind NAT, I do:<br><br> if (nat_uac_test("19")) {<br>
if (method=="REGISTER") {<br> setbflag(7);<br>
fix_nated_register();<br> ...<br><br><br>Then when my B2BUA sends invite to this UA I do (after lookup("location") ):<br><br> lookup("location");<br> ...<br>
if (is_method("INVITE")) {<br> if (isbflagset(7)) {<br>
setflag(5);<br><br><br>Regards,<br>Pascal<br><br><div class="gmail_quote">On Mon, Jul 13, 2009 at 2:43 PM, Pascal Maugeri <span dir="ltr"><<a href="mailto:pascal.maugeri@gmail.com">pascal.maugeri@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I'm not that familiar with flag management.<br><br>so when I detect a UA is behind NAT, I do:<br>
<br> if (nat_uac_test("19")) {<br> if (method=="REGISTER") {<br> setbflag(7);<br>
fix_nated_register();<br> ...<br><br>Then when my B2BUA sends invite to this UA I do (after lookup("location") ):<br><br> if (is_method("INVITE")) {<br> if (isflagset(7)) {<br>
setflag(5);<br><br>Is that correct ?<br><br>BTW, regarding the flag number, is there a table of reserved numbers ? Can I use "7" in this case ?<br><font color="#888888"><br>-pascal</font><div>
<div></div><div class="h5"><br><br><br><br><div class="gmail_quote">
On Mon, Jul 13, 2009 at 12:00 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="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<div><br>
<br>
On 07/13/2009 11:54 AM, Pascal Maugeri wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi<br>
<br>
A quick question, when I apply a fix_nated_register() to a remote user when he/she registers, how can I know later on if this user is behind NAT ?<br>
</blockquote></div>
set a branch flag for REGISTER before save location. After lookup location that flag is recovered and you can test it in the config file.<br>
<br>
Cheers,<br>
Daniel<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>
<br>
All my calls go through a B2BUA:<br>
<br>
Caller ------> kamailio/rtpproxy ------> B2BUA ------> kamailio/rtpproxy ------> Callee<br>
<br>
When my B2BUA calls a user, I want to know if this user is behind NAT or not. For now all the calls go through rtpproxy but I would like to apply this path only when user is behind NAT.<br>
<br>
Regards,<br>
Pascal<br>
<br></div>
------------------------------------------------------------------------<br>
<br>
_______________________________________________<br>
Kamailio (OpenSER) - Users mailing list<br>
<a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a><br>
<a href="http://lists.kamailio.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.kamailio.org/cgi-bin/mailman/listinfo/users</a><br>
<a href="http://lists.openser-project.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.openser-project.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote>
<br>
-- <br>
Daniel-Constantin Mierla<br>
<a href="http://www.asipto.com/" target="_blank">http://www.asipto.com/</a><br>
<br>
</blockquote></div><br>
</div></div></blockquote></div><br>