Sorry, I'm typed wrong, not Via line but Route line :P<br><br>Regards,<br><br>Halomoan<br><br><div><span class="gmail_quote">On 9/12/07, <b class="gmail_sendername">Halomoan Chow</b> <<a href="mailto:halomoan@gmail.com">
halomoan@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I copy and paste the logic example generated from sipwise below.
<br>I can see for first request, it marked the sender is behind nat with record_route(";nat=yes")<br><br>In the loose route block, it tries to identify sender if they are behind nat with search("^Route:.*;nat=yes").
<br><br>In one sip proxy architecture, after you enter loose_route() function, the Via with ;nat has gone, right? and the search("^Route:.*;nat=yes") test would always return false. <br>Please correct me if i'm wrong. Thank you.
<br><br><br> if(!is_method("REGISTER"))<br> {<br> if(nat_uac_test("19"))<br> {<br> record_route(";nat=yes");<br> }
<br> else<br> {<br> record_route();<br> }<br> }<br> if(is_method("CANCEL") || is_method("BYE"))<br> {<br> end_media_session();
<br> }<br><br> if(loose_route())<br> {<br> if(!has_totag())<br> {<br><br> xlog("L_INFO", "Initial loose-routing rejected - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
<br> sl_send_reply("403", "Initial Loose-Routing Rejected");<br> exit;<br> }<br> if(nat_uac_test("19") || search("^Route:.*;nat=yes"))
<br> {<br> fix_nated_contact();<br> setbflag(6);<br> }<br><br> route(3);<div><span class="e" id="q_114f8ba0d915b76e_1"><br> }
<br><br><br><div><span class="gmail_quote">On 9/12/07,
<b class="gmail_sendername">Bogdan-Andrei Iancu</b> <<a href="mailto:bogdan@voice-system.ro" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">bogdan@voice-system.ro</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Halomoan,<br><br>Mainly because the NAT detection on SIP replied is very poor - you can<br>check only if the contact address is a private one or not. The other nat<br>test are not applicable for replies (but only for requests).
<br><br>Anthow, when you process the request, you learn that the calee is behind<br>NAT, so you can simple remember this (in RR) than detecting it each time<br>when receiving a reply.<br><br>regards,<br>bogdan<br><br>Halomoan Chow wrote:
<br>> Dear All<br>><br>> I don't understand why in the Openser+MediaProxy i need<br>> record_route_preset("x.x.x.x:5060;nat=yes"); and<br>> search("^Route:.*;nat=yes")<br>> What is the purpose while I can do client_nat_test to see if the
<br>> request is come from a nat-ed client.<br>><br>> If I remove search("^Route:.*;nat=yes") from below statement, I can do<br>> re-INVITE without any problem because it still have client_nat_test to
<br>> find out the nat in between.<br>><br>> if (client_nat_test("3") || search("^Route:.*;nat=yes")) {<br>> setbflag(6);<br>> use_media_proxy();<br>> };<br>><br>><br>> Hope someone can give me a clue.
<br>><br>> Thank you.<br>><br>> Regards,<br>><br>> Halomoan<br>> ------------------------------------------------------------------------<br>><br>> _______________________________________________
<br>> Users mailing list<br>> <a href="mailto:Users@openser.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Users@openser.org</a><br>> <a href="http://openser.org/cgi-bin/mailman/listinfo/users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://openser.org/cgi-bin/mailman/listinfo/users</a><br>>
<br><br></blockquote></div><br>
</span></div></blockquote></div><br>