<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hello,</p>
    <p>I did a quick test and all looks fine, ports are set in via and
      record-route, in my config I have:</p>
    <p>    record_route();<br>
      <br>
          $fs="udp:127.0.0.1:5080";<br>
          $du = <a class="moz-txt-link-rfc2396E" href="sip:127.0.0.1:9">"sip:127.0.0.1:9"</a>;<br>
          t_relay();<br>
          exit;<br>
    </p>
    <p>Then sending an OPTIONS resulted in the trace shown below.</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <p>U 2017/12/11 17:14:47.108430 127.0.0.1:56729 -> 127.0.0.1:5060<br>
      OPTIONS <a class="moz-txt-link-freetext" href="sip:test@127.0.0.1">sip:test@127.0.0.1</a> SIP/2.0.<br>
      Via: SIP/2.0/UDP
      192.168.178.84:62516;branch=z9hG4bK.3aaddf68;rport;alias.<br>
      From: <a class="moz-txt-link-freetext" href="sip:sipsak@192.168.178.84:62516;tag=16d1c24">sip:sipsak@192.168.178.84:62516;tag=16d1c24</a>.<br>
      To: <a class="moz-txt-link-freetext" href="sip:test@127.0.0.1">sip:test@127.0.0.1</a>.<br>
      Call-ID: <a class="moz-txt-link-abbreviated" href="mailto:23927844@192.168.178.84">23927844@192.168.178.84</a>.<br>
      CSeq: 1 OPTIONS.<br>
      Contact: <a class="moz-txt-link-freetext" href="sip:sipsak@192.168.178.84:62516">sip:sipsak@192.168.178.84:62516</a>.<br>
      Content-Length: 0.<br>
      Max-Forwards: 70.<br>
      User-Agent: sipsak 0.9.7pre.<br>
      Accept: text/plain.<br>
      .<br>
      <br>
      <br>
      U 2017/12/11 17:14:51.010251 127.0.0.1:5080 -> 127.0.0.1:9<br>
      OPTIONS <a class="moz-txt-link-freetext" href="sip:test@127.0.0.1">sip:test@127.0.0.1</a> SIP/2.0.<br>
      Record-Route: <a class="moz-txt-link-rfc2396E" href="sip:127.0.0.1:5080;r2=on;lr"><sip:127.0.0.1:5080;r2=on;lr></a>.<br>
      Record-Route: <a class="moz-txt-link-rfc2396E" href="sip:127.0.0.1;r2=on;lr"><sip:127.0.0.1;r2=on;lr></a>.<br>
      Via: SIP/2.0/UDP
      127.0.0.1:5080;branch=z9hG4bK61bd.b2882fea15c488761489f8ef588efbe1.0.<br>
      Via: SIP/2.0/UDP
192.168.178.84:62516;received=127.0.0.1;branch=z9hG4bK.3aaddf68;rport=56729;alias.<br>
      From: <a class="moz-txt-link-freetext" href="sip:sipsak@192.168.178.84:62516;tag=16d1c24">sip:sipsak@192.168.178.84:62516;tag=16d1c24</a>.<br>
      To: <a class="moz-txt-link-freetext" href="sip:test@127.0.0.1">sip:test@127.0.0.1</a>.<br>
      Call-ID: <a class="moz-txt-link-abbreviated" href="mailto:23927844@192.168.178.84">23927844@192.168.178.84</a>.<br>
      CSeq: 1 OPTIONS.<br>
      Contact: <a class="moz-txt-link-freetext" href="sip:sipsak@192.168.178.84:62516">sip:sipsak@192.168.178.84:62516</a>.<br>
      Content-Length: 0.<br>
      Max-Forwards: 69.<br>
      User-Agent: sipsak 0.9.7pre.<br>
      Accept: text/plain.<br>
      .<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 11.12.17 16:37, George
      Diamantopoulos wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAPcKEYMtgJ953g29ZYhUHpvoqHbESMbLjBW9tadBMjn-fe+uZw@mail.gmail.com">
      <div dir="ltr">
        <div>
          <div>
            <div>Hello all,<br>
              <br>
            </div>
            I have the following issue in my configuration, tested with
            5.2.0-rc1 so far:<br>
            <br>
          </div>
          At some point, I set the $fs pseudovariable to force a request
          to be relayed through a specific socket. Although this is
          honoured by kamailio (i.e. the request does indeed leave the
          kamailio host from the respective socket), the port number is
          not added to the Via and RR headers. As a result, all replies
          to the request, as well as all subsequent requests from the
          other SIP UA are relayed to the default port, 5060. Here's an
          example:</div>
        <div><br>
        </div>
        <div>SIP UAC to kamailio:</div>
        <div style="margin-left:40px">INVITE <a
            href="http://192.168.1.1:5060" moz-do-not-send="true">192.168.1.1:5060</a>
          ---> <a href="http://192.168.1.254:5060"
            moz-do-not-send="true">192.168.1.254:5060</a></div>
        <div>Kamailio to UAS ($fs is set):</div>
        <div style="margin-left:40px">INVITE <a
            href="http://2.2.2.2:5066" moz-do-not-send="true">2.2.2.2:5066</a>
          ---> <a href="http://3.3.3.3:5060" moz-do-not-send="true">3.3.3.3:5060</a></div>
        <div style="margin-left:40px">Topmost Via in request relayed by
          kamailio is:</div>
        <div style="margin-left:80px">SIP/2.0/UDP
          2.2.2.2;branch=aaaaaaaaaaaaaa    <- port 5066 is not added<br>
        </div>
        <div style="margin-left:40px">Topmost RR in request relayed by
          kamailio is:</div>
        <div style="margin-left:80px"><a class="moz-txt-link-rfc2396E" href="sip:2.2.2.2;r2=on;lr;did=bbbbbbb;nat=yes"><sip:2.2.2.2;r2=on;lr;did=bbbbbbb;nat=yes></a>   
          <- port 5066 is not added</div>
        RESULT: Reply from UAS is sent to <a href="http://2.2.2.2:5060"
          moz-do-not-send="true">2.2.2.2:5060</a><br>
        <div>
          <div>
            <div><br>
            </div>
            Is this behaviour valid? Am I missing anything? Kamailio is
            configured to listen on both sockets on IP 2.2.2.2, namely:
            a) udp:<a href="http://2.2.2.2:5060" moz-do-not-send="true">2.2.2.2:5060</a>
            and b) <a href="http://2.2.2.2:5066" moz-do-not-send="true">2.2.2.2:5066</a>.
            Thanks.</div>
          <div><br>
          </div>
          <div>BR,</div>
          <div>George<br>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <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>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<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 Advanced Training - <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
Kamailio World Conference - May 14-16, 2018 - <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a></pre>
  </body>
</html>