<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hello,</p>
    <p>there seems to be something wrong in your config with loading the
      nathelper module, can you check if you have proper #!ifdef ...
      #!endif blocks?</p>
    <p>Try to run it with debug=3 and see if you can spot more hints via
      the DEBUG messages printed in the logs...</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 07.01.19 14:44, Andrew Chen wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAEytwJ2R33etfv18mzVGSr9FXQzwkQfef__iftoj-bgVtKCh8Q@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div dir="ltr">Hi Daniel,
          <div><br>
          </div>
          <div>Here is all of it:</div>
          <div><br>
          </div>
          <div>
            <div>Jan  3 18:33:01 sjomainkama55 systemd[1]: Stopped
              Kamailio (OpenSER) - the Open Source SIP Server.</div>
            <div>Jan  3 18:33:01 sjomainkama55 systemd[1]: Starting
              Kamailio (OpenSER) - the Open Source SIP Server...</div>
            <div>Jan  3 18:33:01 sjomainkama55 kamailio: ERROR:
              <core> [core/cfg.y:3309]: yyparse(): cfg. parser:
              failed to find command nat_uac_test (params 1)</div>
            <div>Jan  3 18:33:01 sjomainkama55 kamailio: CRITICAL:
              <core> [core/cfg.y:3449]: yyerror_at(): parse error
              in config file /etc/kamailio/kamailio.cfg, line 1093,
              column 28: unknown command, missing loadmodule?</div>
            <div>Jan  3 18:33:01 sjomainkama55 kamailio: ERROR:
              <core> [core/cfg.y:3309]: yyparse(): cfg. parser:
              failed to find command add_contact_alias (params 0)</div>
            <div>Jan  3 18:33:01 sjomainkama55 kamailio: CRITICAL:
              <core> [core/cfg.y:3449]: yyerror_at(): parse error
              in config file /etc/kamailio/kamailio.cfg, line 1098,
              column 35: unknown command, missing loadmodule?</div>
            <div>Jan  3 18:33:01 sjomainkama55 kamailio[12334]: ERROR:
              bad config file (2 errors)</div>
          </div>
          <div><br>
          </div>
          <div>I just realized it missed the add_contact_alias as well. 
             This is the config in the Websocket module page which I
            copy and pasted:</div>
          <div>
            <pre class="gmail-programlisting" style="background-color:rgb(252,255,252);border:1px solid rgb(153,204,204);color:rgb(0,0,0);padding-left:15pt;overflow:auto;border-radius:2.5px;font-size:15px">onreply_route[WS_REPLY] {
        if (nat_uac_test(64)) {
                # Do NAT traversal stuff for replies to a WebSocket connection
                # - even if it is not behind a NAT!
                # This won't be needed in the future if Kamailio and the
                # WebSocket client support Outbound and Path.
                add_contact_alias();
        }
}</pre>
          </div>
          <div><br>
          </div>
        </div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr">On Mon, Jan 7, 2019 at 3:42 AM Daniel-Constantin
          Mierla <<a href="mailto:miconda@gmail.com"
            moz-do-not-send="true">miconda@gmail.com</a>> wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px
          0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div bgcolor="#FFFFFF">
            <p>Hello,</p>
            <p>nat_uac_test(...) is allowed in the reply route block.
              The error is not about using the function in an invalid
              route block, but  that the function is not found by name
              and 1 parameter.</p>
            <p>Were there other error messages before the one you pasted
              in your message?</p>
            <p>Cheers,<br>
              Daniel<br>
            </p>
            <div class="gmail-m_4891972756511182309moz-cite-prefix">On
              04.01.19 01:28, Andrew Chen wrote:<br>
            </div>
            <blockquote type="cite">
              <div dir="ltr">Yup.  The default configuaration already
                have the nathelper.so loaded.  Plus, there are other
                places in the config where nat_uac_test was called but
                never error out.</div>
              <br>
              <div class="gmail_quote">
                <div dir="ltr">On Thu, Jan 3, 2019 at 5:39 PM Sergey
                  Okhapkin <<a href="mailto:sos@sokhapkin.dyndns.org"
                    target="_blank" moz-do-not-send="true">sos@sokhapkin.dyndns.org</a>>
                  wrote:<br>
                </div>
                <blockquote class="gmail_quote" style="margin:0px 0px
                  0px 0.8ex;border-left:1px solid
                  rgb(204,204,204);padding-left:1ex">
                  <div>
                    <p style="margin:0px;text-indent:0px">Did you load
                      the module?<br>
                      <br>
                      On Thursday, January 3, 2019 5:27:12 PM EST Andrew
                      Chen wrote:<br>
                    </p>
                    <p style="margin:12px 40px 0px;text-indent:0px">Hey
                      it's me again.</p>
                    <p style="margin:0px 40px;text-indent:0px"><br>
                    </p>
                    <p style="margin:0px 40px;text-indent:0px">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:</p>
                    <p style="margin:0px 40px;text-indent:0px"><br>
                    </p>
                    <p style="margin:0px 40px;text-indent:0px">onreply_route[WS_REPLY]
                      {</p>
                    <p style="margin:0px 40px;text-indent:0px">       
                      xlog("L_INFO", "[CSeq $cs] Is in WS_REPLY.");</p>
                    <p style="margin:0px 40px;text-indent:0px">       
                      xlog("L_INFO", "[CSeq $cs] Sending $rs $rr to
                      $sel(via[2].host) via $sel(via[2].transport) len:
                      $ml");</p>
                    <p style="margin:0px 40px;text-indent:0px">       
                      xlog("L_INFO", "[CSeq $cs] \n$mb \n");</p>
                    <p style="margin:0px 40px;text-indent:0px"><br>
                    </p>
                    <p style="margin:0px 40px;text-indent:0px">       
                      if(nat_uac_test("64")) {</p>
                    <p style="margin:0px 40px;text-indent:0px">         
                            # Do NAT traversal stuff for replies to a
                      WebSocket connection</p>
                    <p style="margin:0px 40px;text-indent:0px">         
                            # - even if it is not behind a NAT!</p>
                    <p style="margin:0px 40px;text-indent:0px">         
                            # This won't be needed in the future if
                      Kamailio and the</p>
                    <p style="margin:0px 40px;text-indent:0px">         
                            # WebSocket client support Outbound and
                      Path.</p>
                    <p style="margin:0px 40px;text-indent:0px">         
                            add_contact_alias();</p>
                    <p style="margin:0px 40px;text-indent:0px">        }</p>
                    <p style="margin:0px 40px;text-indent:0px">}</p>
                    <p style="margin:0px 40px;text-indent:0px"><br>
                    </p>
                    <p style="margin:0px 40px;text-indent:0px">When I
                      did this and started up Kamailio, it gave me an
                      error:</p>
                    <p style="margin:0px 40px;text-indent:0px"><br>
                    </p>
                    <p style="margin:0px 40px;text-indent:0px">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)</p>
                    <p style="margin:0px 40px;text-indent:0px"><br>
                    </p>
                    <p style="margin:0px 40px;text-indent:0px">I moved
                      that if statement to a route block and I was able
                      to start it up.</p>
                    <p style="margin:0px 40px;text-indent:0px"><br>
                    </p>
                    <p style="margin:0px 40px;text-indent:0px">The wiki
                      page for nathelper module specify this function
                      can be run in onreply_route as well:</p>
                    <p style="margin:0px 40px;text-indent:0px"><br>
                    </p>
                    <p style="margin:0px 40px;text-indent:0px"><br>
                    </p>
                    <p style="margin:24px 40px
                      18px;text-indent:0px;line-height:28px"><span
style="font-family:"Scada,Helvetica,sans-serif";font-size:large;font-weight:600;font-style:italic;color:rgb(107,83,68)">5.5.  </span><span
style="font-family:Hack;font-size:large;font-weight:600;font-style:italic;color:rgb(107,83,68)">nat_uac_test(flags)</span></p>
                    <p style="margin:12px 40px;text-indent:0px"><span
style="font-family:"Helvetica,Arial,sans-serif";font-size:15px;color:rgb(0,0,0)">Tries
                        to guess if client's request originated behind a
                        nat. The parameter determines what heuristics is
                        used.</span></p>
                    <p style="margin:12px 40px;text-indent:0px"><span
style="font-family:"Helvetica,Arial,sans-serif";font-size:15px;color:rgb(0,0,0)">Meaning
                        of the flags is as follows:</span></p>
                    <ul
                      style="margin-top:0px;margin-bottom:0px;margin-right:0px">
                      <li
style="font-family:"Helvetica,Arial,sans-serif";font-size:15px;color:rgb(0,0,0)"><span
                          style="font-size:15px;font-style:italic">1</span><span
                          style="font-size:15px"> - The “Contact” header
                          field is searched for occurrence of RFC1918 or
                          RFC6598 addresses.</span></li>
                      <li
style="font-family:"Helvetica,Arial,sans-serif";font-size:15px;color:rgb(0,0,0)"><span
                          style="font-size:15px;font-style:italic">2</span><span
                          style="font-size:15px"> - the "received" test
                          is used: address in the “Via” header is
                          compared against source IP address of
                          signaling</span></li>
                      <li
style="font-family:"Helvetica,Arial,sans-serif";font-size:15px;color:rgb(0,0,0)"><span
                          style="font-size:15px;font-style:italic">4</span><span
                          style="font-size:15px"> - The Top
                          Most “Via” is searched for occurrence of
                          RFC1918 or RFC6598 addresses</span></li>
                      <li
style="font-family:"Helvetica,Arial,sans-serif";font-size:15px;color:rgb(0,0,0)"><span
                          style="font-size:15px;font-style:italic">8</span><span
                          style="font-size:15px"> - The SDP is searched
                          for occurrence of RFC1918 or RFC6598 addresses</span></li>
                      <li
style="font-family:"Helvetica,Arial,sans-serif";font-size:15px;color:rgb(0,0,0)"><span
                          style="font-size:15px;font-style:italic">16</span><span
                          style="font-size:15px"> - Test if the source
                          port is different from the port in
                          the “Via” header</span></li>
                      <li
style="font-family:"Helvetica,Arial,sans-serif";font-size:15px;color:rgb(0,0,0)"><span
                          style="font-size:15px;font-style:italic">32</span><span
                          style="font-size:15px"> - Test if the source
                          IP address of signaling is a RFC1918 or
                          RFC6598 address</span></li>
                      <li
style="font-family:"Helvetica,Arial,sans-serif";font-size:15px;color:rgb(0,0,0)"><span
                          style="font-size:15px;font-style:italic">64</span><span
                          style="font-size:15px"> - Test if the source
                          connection of signaling is a WebSocket</span></li>
                      <li
style="font-family:"Helvetica,Arial,sans-serif";font-size:15px;color:rgb(0,0,0)"><span
                          style="font-size:15px;font-style:italic">128</span><span
                          style="font-size:15px"> - Test if
                          the “Contact” 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)</span></li>
                    </ul>
                    <p style="margin:12px 40px;text-indent:0px"><span
style="font-family:"Helvetica,Arial,sans-serif";font-size:15px;color:rgb(0,0,0)">All
                        flags can be bitwise combined, the test returns
                        true if any of the tests identified a NAT.</span></p>
                    <p style="margin:12px 40px;text-indent:0px"><span
style="font-family:"Helvetica,Arial,sans-serif";font-size:15px;color:rgb(0,0,0)">This
                        function can be used from REQUEST_ROUTE,
                        ONREPLY_ROUTE, FAILURE_ROUTE, BRANCH_ROUTE.</span></p>
                    <p style="margin:12px 40px;text-indent:0px"><span
style="font-family:"Helvetica,Arial,sans-serif";font-size:15px;color:rgb(0,0,0)"><br>
                      </span></p>
                    <p style="margin:12px 40px;text-indent:0px"><span
style="font-family:"Helvetica,Arial,sans-serif";font-size:15px;color:rgb(0,0,0)">is
                        this some known bug in 5.1.x?</span></p>
                    <p style="margin:12px 40px;text-indent:0px"><span
style="font-family:"Helvetica,Arial,sans-serif";font-size:15px;color:rgb(0,0,0)">Thanks</span></p>
                    <p style="margin:0px 40px;text-indent:0px"><br>
                      -- <br>
                    </p>
                    <p style="margin:0px 40px;text-indent:0px">Andy Chen</p>
                    <p style="margin:0px 40px;text-indent:0px"><a
                        href="mailto:achen@thinkingphones.com"
                        target="_blank" moz-do-not-send="true"><span
                          style="text-decoration:underline;color:rgb(41,128,185)">achen@</span></a><a
                        href="http://fuze.com" target="_blank"
                        moz-do-not-send="true"><span
                          style="text-decoration:underline;color:rgb(41,128,185)">fuze.com</span></a><br>
                    </p>
                    <p style="margin:0px 40px;text-indent:0px"><br>
                      <br>
                      <br>
                      <span
style="font-family:"Arial,sans-serif";font-size:14px;color:rgb(51,51,51);background-color:rgb(255,255,255)">*Confidentiality
                        Notice: The information contained in this e-mail
                        and any<br>
                        attachments may be confidential. If you are not
                        an intended recipient, you<br>
                        are hereby notified that any dissemination,
                        distribution or copying of this<br>
                        e-mail is strictly prohibited. If you have
                        received this e-mail in error,<br>
                        please notify the sender and permanently delete
                        the e-mail and any<br>
                        attachments immediately. You should not retain,
                        copy or use this e-mail or<br>
                        any attachment for any purpose, nor disclose all
                        or any part of the<br>
                        contents to any other person. Thank you.*</span>
                    </p>
                    <p style="margin:0px;text-indent:0px"><br>
                      <br>
                    </p>
                  </div>
                  _______________________________________________<br>
                  Kamailio (SER) - Users Mailing List<br>
                  <a href="mailto:sr-users@lists.kamailio.org"
                    target="_blank" moz-do-not-send="true">sr-users@lists.kamailio.org</a><br>
                  <a
                    href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
                    rel="noreferrer" target="_blank"
                    moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
                </blockquote>
              </div>
              <br clear="all">
              <div><br>
              </div>
              -- <br>
              <div dir="ltr"
                class="gmail-m_4891972756511182309gmail_signature">
                <div dir="ltr">
                  <div>
                    <div dir="ltr">
                      <div dir="ltr" style="font-size:12.8px">Andy Chen</div>
                      <div dir="ltr" style="font-size:12.8px">
                        <div>Sr. Telephony Lead Engineer</div>
                        <div>415 516 5535 (M)</div>
                        <div><a href="mailto:achen@thinkingphones.com"
                            target="_blank" moz-do-not-send="true">achen@</a><a
                            href="http://fuze.com" target="_blank"
                            moz-do-not-send="true">fuze.com</a></div>
                        <div><br>
                        </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> <br>
              <fieldset
                class="gmail-m_4891972756511182309mimeAttachmentHeader"></fieldset>
              <pre class="gmail-m_4891972756511182309moz-quote-pre">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="gmail-m_4891972756511182309moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org" target="_blank" moz-do-not-send="true">sr-users@lists.kamailio.org</a>
<a class="gmail-m_4891972756511182309moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank" moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
            </blockquote>
            <pre class="gmail-m_4891972756511182309moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="gmail-m_4891972756511182309moz-txt-link-abbreviated" href="http://www.asipto.com" target="_blank" moz-do-not-send="true">www.asipto.com</a>
<a class="gmail-m_4891972756511182309moz-txt-link-abbreviated" href="http://www.twitter.com/miconda" target="_blank" moz-do-not-send="true">www.twitter.com/miconda</a> -- <a class="gmail-m_4891972756511182309moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda" target="_blank" moz-do-not-send="true">www.linkedin.com/in/miconda</a>
Kamailio World Conference - May 6-8, 2019 -- <a class="gmail-m_4891972756511182309moz-txt-link-abbreviated" href="http://www.kamailioworld.com" target="_blank" moz-do-not-send="true">www.kamailioworld.com</a>
Kamailio Advanced Training - Mar 4-6, 2019 in Berlin; Mar 25-27, 2019, in Washington, DC, USA -- <a class="gmail-m_4891972756511182309moz-txt-link-abbreviated" href="http://www.asipto.com" target="_blank" moz-do-not-send="true">www.asipto.com</a></pre>
          </div>
        </blockquote>
      </div>
      <br clear="all">
      <div><br>
      </div>
      -- <br>
      <div dir="ltr" class="gmail_signature">
        <div dir="ltr">
          <div>
            <div dir="ltr">
              <div dir="ltr" style="font-size:12.8px">Andy Chen</div>
              <div dir="ltr" style="font-size:12.8px">
                <div>Sr. Telephony Lead Engineer</div>
                <div>415 516 5535 (M)</div>
                <div><a href="mailto:achen@thinkingphones.com"
                    target="_blank" moz-do-not-send="true">achen@</a><a
                    href="http://fuze.com" target="_blank"
                    moz-do-not-send="true">fuze.com</a></div>
                <div><br>
                </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>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio World Conference - May 6-8, 2019 -- <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a>
Kamailio Advanced Training - Mar 4-6, 2019 in Berlin; Mar 25-27, 2019, in Washington, DC, USA -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a></pre>
  </body>
</html>