<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <tt>I am sorry, but I don't understand your call flow. Please
      present here the call flow you have now, and the expected one.<br>
      <br>
      PS: not sure why you are looking at the Via header, that's only
      used for replies, not for requests.<br>
      <br>
      Best regards,<br>
    </tt>
    <pre class="moz-signature" cols="72">Răzvan Crainea
OpenSIPS Solutions
<a class="moz-txt-link-abbreviated" href="http://www.opensips-solutions.com">www.opensips-solutions.com</a></pre>
    <div class="moz-cite-prefix">On 12/14/2016 07:53 PM, Muhammad Naseer
      Bhatti wrote:<br>
    </div>
    <blockquote
cite="mid:CACak_yw2R1gsskhLT22K68FaC6BM3PZBYYWTh6DCZwfp8m4fhA@mail.gmail.com"
      type="cite">
      <style>body{font-family:Helvetica,Arial;font-size:13px}</style>
      <div id="bloop_customfont"
style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br>
      </div>
      <div id="bloop_customfont"
style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">Hi
        Razvan,</div>
      <div id="bloop_customfont"
style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">I
        am not using REGISTER, but I guess add_path() wont’ work for me,
        I am using record_route() for the INVITE though. </div>
      <div id="bloop_customfont"
style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">
        <div id="bloop_customfont" style="margin:0px"><br>
        </div>
        <div id="bloop_customfont" style="margin:0px">…</div>
        <div id="bloop_customfont" style="margin:0px"><span class="Apple-tab-span" style="white-space:pre"> </span>if
          (is_method("INVITE")) {</div>
        <div id="bloop_customfont" style="margin:0px"><span class="Apple-tab-span" style="white-space:pre">         </span>record_route();</div>
        <div id="bloop_customfont" style="margin:0px"><span class="Apple-tab-span" style="white-space:pre"> </span>}</div>
        <div id="bloop_customfont" style="margin:0px">…</div>
        <div id="bloop_customfont" style="margin:0px"><br>
        </div>
        <div id="bloop_customfont" style="margin:0px">On the media
          server I see the Via header,</div>
        <div id="bloop_customfont" style="margin:0px"><br>
        </div>
        <div id="bloop_customfont" style="margin:0px">
          <div id="bloop_customfont" style="margin:0px">   INVITE <a
              moz-do-not-send="true"
              href="http://sip:6054775550@64.58.228.102:3333">sip:6054775550@64.58.228.102:3333</a>
            SIP/2.0</div>
          <div id="bloop_customfont" style="margin:0px">   Record-Route:
<sip:64.58.228.102:3333;lr=on;ftag=CT60RBHd.BRAp6IAQSKwtAN3Mjj2bPKL></div>
          <div id="bloop_customfont" style="margin:0px">   Via:
            SIP/2.0/UDP
            64.58.228.102:3333;branch=z9hG4bK31d2.b8fe57fe9c7545e354a93f391a1d0704.0</div>
          <div id="bloop_customfont" style="margin:0px">   Via:
            SIP/2.0/UDP
172.16.0.101:52207;received=172.16.0.101;rport=52207;branch=z9hG4bKPjyGufepGSH2zMGfp6J.CIKvEgl87YIPFN</div>
          <div id="bloop_customfont" style="margin:0px"><br>
          </div>
          <div id="bloop_customfont" style="margin:0px">but when the
            media server sends </div>
          <div id="bloop_customfont" style="margin:0px"><br>
          </div>
          <div id="bloop_customfont" style="margin:0px">
            <div id="bloop_customfont" style="margin:0px">recv 1432
              bytes from udp/[64.58.228.89]:3333 at 12:44:12.709234:</div>
            <div id="bloop_customfont" style="margin:0px"> 
 ------------------------------------------------------------------------</div>
            <div id="bloop_customfont" style="margin:0px">   INVITE <a
                moz-do-not-send="true"
                href="http://sip:6054775550@23.29.112.144:15080">sip:6054775550@23.29.112.144:15080</a>
              SIP/2.0</div>
            <div id="bloop_customfont" style="margin:0px">   Via:
              SIP/2.0/UDP
              64.58.228.89:3333;rport;branch=z9hG4bKF8jFHt4maUBeQ</div>
            <div id="bloop_customfont" style="margin:0px"> 
               Max-Forwards: 68</div>
            <div id="bloop_customfont" style="margin:0px">   From:
              "Naseer" <<a moz-do-not-send="true"
                href="mailto:sip%3A1234@64.58.228.89">sip:1234@64.58.228.89</a>>;tag=45yZ9S13S47HF</div>
            <div id="bloop_customfont" style="margin:0px"><br>
            </div>
            <div id="bloop_customfont" style="margin:0px">Not sure what
              I am doing wrong. Here is my script, <a
                moz-do-not-send="true"
                href="http://pastebin.com/Cmnxnf4c">http://pastebin.com/Cmnxnf4c</a></div>
            <div id="bloop_customfont" style="margin:0px"><br>
            </div>
          </div>
        </div>
      </div>
      <br>
      <div id="bloop_sign_1481736925575387904" class="bloop_sign">
        <div style="font-family:helvetica,arial;font-size:13px">-- <br>
          <br>
          Sent with Airmail</div>
      </div>
      <div class="airmail_ext_on" style="color:black"><br>
        From: <span style="color:black">Răzvan Crainea</span> <a
          moz-do-not-send="true" href="mailto:razvan@opensips.org"><razvan@opensips.org></a><br>
        Reply: <span style="color:black">OpenSIPS users mailling list</span>
        <a moz-do-not-send="true" href="mailto:users@lists.opensips.org"><users@lists.opensips.org></a><br>
        Date: <span style="color:black">December 14, 2016 at 8:34:22 PM</span><br>
        To: <span style="color:black"><a moz-do-not-send="true"
            href="mailto:users@lists.opensips.org">users@lists.opensips.org</a></span>
        <a moz-do-not-send="true" href="mailto:users@lists.opensips.org"><users@lists.opensips.org></a><br>
        Subject: <span style="color:black"> Re: [OpenSIPS-Users] How to
          Keep OpenSIPS in reverse path <br>
        </span></div>
      <br>
      <blockquote type="cite" class="clean_bq"><span>
          <div bgcolor="#FFFFFF" text="#000000">
            <div>
              <title></title>
              <tt>Hi, Muhammad!<br>
                <br>
                The add_path() function should only be called on
                REGISTER messages,
                and it adds a Path header (not a Via). Do you see this
                header in
                your REGISTER message?<br>
                For sequential requests, you should use the
                record_route()
                mechanism.<br>
                <br>
                Best regards,<br>
              </tt>
              <pre class="moz-signature" cols="72">Răzvan Crainea
OpenSIPS Solutions
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="http://www.opensips-solutions.com">www.opensips-solutions.com</a></pre>
              <div class="moz-cite-prefix">On 12/14/2016 06:39 PM,
                Muhammad
                Naseer Bhatti wrote:<br>
              </div>
              <blockquote
cite="mid:CACak_ywiVJ0GHw66bteg_XiTcA07xk1jJ911JCjqZG6Jtn8mhQ@mail.gmail.com"
                type="cite">
                <div id="bloop_customfont"
style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br>
                </div>
                <div id="bloop_customfont"
style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">I
                  am using dispatcher to distribute calls to multiple
                  media
                  servers, but also want the reply to go through
                  OpenSIPS. So far I
                  have tried add_path() function which add the Via
                  header but
                  FreeSWITCH sends the call directly to the gateway not
                  sending the
                  call back through OpenSIPS. I am not sure if I am
                  doing something
                  wrong, how can I achieve that?</div>
                <div id="bloop_customfont"
style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br>
                </div>
                <div class="bloop_container">
                </div>
                <br>
                <div id="bloop_sign_1481732893972313856"
                  class="bloop_sign">
                  <div
                    style="font-family:helvetica,arial;font-size:13px">
                    -- <br>
                    <br>
                    Sent with Airmail</div>
                </div>
                <br>
                <fieldset class="mimeAttachmentHeader"></fieldset>
                <br>
                <pre>_______________________________________________
Users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
              </blockquote>
              <br>
              _______________________________________________<br>
              Users mailing list<br>
              <a moz-do-not-send="true"
                href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
              <a moz-do-not-send="true"
                href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
            </div>
          </div>
        </span></blockquote>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>