<div dir="ltr"><div dir="ltr"><div dir="ltr">Hey it's me again.<div><br></div><div>So I'm following the instructions in the Kamailio 5.1.x wiki module page for websocket configuration and it specifically mention to set this block:</div><div><br></div><div><div>onreply_route[WS_REPLY] {</div><div>        xlog("L_INFO", "[CSeq $cs] Is in WS_REPLY.");</div><div>        xlog("L_INFO", "[CSeq $cs] Sending $rs $rr to $sel(via[2].host) via $sel(via[2].transport) len: $ml");</div><div>        xlog("L_INFO", "[CSeq $cs] \n$mb \n");</div><div><br></div><div>        if(nat_uac_test("64")) {</div><div>                # Do NAT traversal stuff for replies to a WebSocket connection</div><div>                # - even if it is not behind a NAT!</div><div>                # This won't be needed in the future if Kamailio and the</div><div>                # WebSocket client support Outbound and Path.</div><div>                add_contact_alias();</div><div>        }</div><div>}</div><div><br></div><div>When I did this and started up Kamailio, it gave me an error:</div><div><br></div><div><div>Jan  3 22:19:43 sjomainkama55 kamailio: ERROR: <core> [core/cfg.y:3309]: yyparse(): cfg. parser: failed to find command nat_uac_test (params 1)</div></div><div><br></div><div>I moved that if statement to a route block and I was able to start it up.</div><div><br></div><div>The wiki page for nathelper module specify this function can be run in onreply_route as well:</div><div><br></div><div><br></div><div><div class="gmail-titlepage" style="color:rgb(0,0,0);font-family:Helvetica,Arial,sans-serif;font-size:15px"><div><div><h3 class="gmail-title" style="margin:1em 0px 0.75em;padding:0px 0px 5px 5px;color:rgb(107,83,68);font-family:Scada,Helvetica,sans-serif;font-size:20px;line-height:28px;font-style:italic">5.5.  <code class="gmail-function">nat_uac_test(flags)</code></h3></div></div></div><p style="font-family:Helvetica,Arial,sans-serif;text-align:justify;color:rgb(0,0,0);font-size:15px">Tries to guess if client's request originated behind a nat. The parameter determines what heuristics is used.</p><p style="font-family:Helvetica,Arial,sans-serif;text-align:justify;color:rgb(0,0,0);font-size:15px">Meaning of the flags is as follows:</p><div class="gmail-itemizedlist" style="color:rgb(0,0,0);font-family:Helvetica,Arial,sans-serif;font-size:15px"><ul class="gmail-itemizedlist" type="disc"><li class="gmail-listitem"><p style="text-align:justify"><span class="emphasis"><em>1</em></span> - The <span class="gmail-quote">“<span class="gmail-quote">Contact</span>”</span> header field is searched for occurrence of RFC1918 or RFC6598 addresses.</p></li><li class="gmail-listitem"><p style="text-align:justify"><span class="emphasis"><em>2</em></span> - the "received" test is used: address in the <span class="gmail-quote">“<span class="gmail-quote">Via</span>”</span> header is compared against source IP address of signaling</p></li><li class="gmail-listitem"><p style="text-align:justify"><span class="emphasis"><em>4</em></span> - The Top Most <span class="gmail-quote">“<span class="gmail-quote">Via</span>”</span> is searched for occurrence of RFC1918 or RFC6598 addresses</p></li><li class="gmail-listitem"><p style="text-align:justify"><span class="emphasis"><em>8</em></span> - The SDP is searched for occurrence of RFC1918 or RFC6598 addresses</p></li><li class="gmail-listitem"><p style="text-align:justify"><span class="emphasis"><em>16</em></span> - Test if the source port is different from the port in the <span class="gmail-quote">“<span class="gmail-quote">Via</span>”</span> header</p></li><li class="gmail-listitem"><p style="text-align:justify"><span class="emphasis"><em>32</em></span> - Test if the source IP address of signaling is a RFC1918 or RFC6598 address</p></li><li class="gmail-listitem"><p style="text-align:justify"><span class="emphasis"><em>64</em></span> - Test if the source connection of signaling is a WebSocket</p></li><li class="gmail-listitem"><p style="text-align:justify"><span class="emphasis"><em>128</em></span> - Test if the <span class="gmail-quote">“<span class="gmail-quote">Contact</span>”</span> header URI port differs from the source port of the request (Warning: this is might be legal or even intended combination in non NATted scenarios)</p></li></ul></div><p style="font-family:Helvetica,Arial,sans-serif;text-align:justify;color:rgb(0,0,0);font-size:15px">All flags can be bitwise combined, the test returns true if any of the tests identified a NAT.</p><p style="font-family:Helvetica,Arial,sans-serif;text-align:justify;color:rgb(0,0,0);font-size:15px">This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE, FAILURE_ROUTE, BRANCH_ROUTE.</p><p style="font-family:Helvetica,Arial,sans-serif;text-align:justify;color:rgb(0,0,0);font-size:15px"><br></p><p style="font-family:Helvetica,Arial,sans-serif;text-align:justify;color:rgb(0,0,0);font-size:15px">is this some known bug in 5.1.x?</p><p style="font-family:Helvetica,Arial,sans-serif;text-align:justify;color:rgb(0,0,0);font-size:15px">Thanks</p></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr" style="font-size:12.8px">Andy Chen</div><div dir="ltr" style="font-size:12.8px"><div><a href="mailto:achen@thinkingphones.com" target="_blank" style="font-size:12.8px">achen@</a><a href="http://fuze.com" target="_blank" style="font-size:12.8px">fuze.com</a><br></div><div><br><br></div></div></div></div></div></div></div></div></div>

<br>
<span style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">*Confidentiality Notice: The information contained in this e-mail and any</span><br style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)"><span style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">attachments may be confidential. If you are not an intended recipient, you</span><br style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)"><span style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">are hereby notified that any dissemination, distribution or copying of this</span><br style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)"><span style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">e-mail is strictly prohibited. If you have received this e-mail in error,</span><br style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)"><span style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">please notify the sender and permanently delete the e-mail and any</span><br style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)"><span style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">attachments immediately. You should not retain, copy or use this e-mail or</span><br style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)"><span style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">any attachment for any purpose, nor disclose all or any part of the</span><br style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)"><span style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">contents to any other person. Thank you.*</span>