<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hello,</p>
    <p>if you want to send the reply to the source ip/port, not the
      address in the top Via header, then do:</p>
    <p>force_rport();</p>
    <p>sl_send_reply(...);</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 05.07.19 10:27, George
      Diamantopoulos wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAPcKEYNh_rNq504Fvpv=m_LBz_urLoXCXvH8e_2xQcEKP9iT0Q@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div>Thank you for the reply Karsten!</div>
        <div><br>
        </div>
        <div>I'm afraid the options_reply() function won't work for me.
          The reason is that it seems to only handle OPTIONS where the
          RURI username is not set, and in my case I need to be able to
          handle these cases.</div>
        <div><br>
        </div>
        <div>Moreover, it is not evident from the siputils module
          documentation if it will perform NAT traversal on the side of
          kamailio, which is my original problem. I'm beginning to think
          I can't serve NATted endpoints' requests statelessly and that
          I'd have to handle the reply statefully, am I right in
          thinking that?</div>
        <div><br>
        </div>
        <div>BR,</div>
        <div>George<br>
        </div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Fri, 5 Jul 2019 at 09:37,
          Karsten Horsmann <<a href="mailto:khorsmann@gmail.com"
            moz-do-not-send="true">khorsmann@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 dir="ltr">Hi George,
            <div><br>
            </div>
            <div>i use something like that (shameless stolen from other
              configuration files within request-route).</div>
            <div><br>
            </div>
            <div>Thats for answering options to my internal kamailio.</div>
            <div>But Alex Balashov wrote an nice blog poste about
              NAT/OPTION Pings </div>
            <div>with kamailio: <a
href="http://www.evaristesys.com/blog/server-side-nat-traversal-with-kamailio-the-definitive-guide/"
                target="_blank" moz-do-not-send="true">http://www.evaristesys.com/blog/server-side-nat-traversal-with-kamailio-the-definitive-guide/</a></div>
            <div><br>
            </div>
            <div>    ### only initial requests (no To tag)<br>
                  if (is_method("OPTIONS"))<br>
                  {<br>
                      if (uri=~<a class="moz-txt-link-rfc2396E" href="sip:.*[@]+.*">"sip:.*[@]+.*"</a>)  {<br>
                          sl_send_reply("501", "Not Implemented");<br>
                      }<br>
                      else {<br>
                          options_reply();<br>
                          exit;<br>
                      }<br>
                  }<br>
            </div>
            <div><br>
            </div>
            <div>Cheers Karsten</div>
          </div>
          <br>
          <div class="gmail_quote">
            <div dir="ltr" class="gmail_attr">Am Do., 4. Juli 2019 um
              10:29 Uhr schrieb George Diamantopoulos <<a
                href="mailto:georgediam@gmail.com" target="_blank"
                moz-do-not-send="true">georgediam@gmail.com</a>>:<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 dir="ltr">
                <div>Hello all,</div>
                <div><br>
                </div>
                <div>I've been trying to handle OPTIONS statelessly, but
                  proper handling fails for UACs behind NAT without ALG.
                  I thought I'd overcome this by setting the $du
                  pseudovariable, but apparently I'm missing something.
                  The following does not work:</div>
                <div><br>
                </div>
                <div>        if ($Rp == "6050") {<br>
                </div>
                <div>            force_send_socket(udp:<a
                    href="http://10.10.10.10:6050" target="_blank"
                    moz-do-not-send="true">10.10.10.10:6050</a>);</div>
                <div>        }</div>
                <div>        $du = "sip:" + $si + ":" + $sp;<br>
                          sl_send_reply("200","OK");</div>
                <div>        exit;</div>
                <div><br>
                </div>
                <div>I'm now realising that I put this in
                  request_route() so force_send_socket() and $du have no
                  use whatsoever, since the request is not forwarded
                  anywhere. Is this the reason?<br>
                </div>
                <div><br>
                </div>
                <div>So the question is, how can I do the following
                  things for a stateless reply: a) choose a sending
                  socket for the reply and b) change the destination for
                  the reply to something other than the URI in the first
                  Via header.</div>
                <div><br>
                </div>
                <div>Thanks!</div>
                <div><br>
                </div>
                <div>BR,</div>
                <div>George<br>
                </div>
              </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_-8609533405661929171gmail_signature">Mit
            freundlichen Grüßen<br>
            *Karsten Horsmann*<br>
          </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>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </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></pre>
  </body>
</html>