<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <tt>Hi Rodrigo,<br>
      <br>
      The set_advertised_address() is not changing anything by itself,
      but setting (as the name says) what should be the IP when comes to
      advertising OpenSIPS in new headers like VIA or Record-Route -
      once again, when building and inserting such headers. This happens
      for requests, not for replies.<br>
      <br>
      So, I do not understand your case with calling the function for a
      200 OK :( .Do you have a trace at opensips level ?<br>
      <br>
      Regards,<br>
    </tt>
    <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
    <div class="moz-cite-prefix">On 03.08.2016 17:55, Rodrigo Pimenta
      Carvalho wrote:<br>
    </div>
    <blockquote
cite="mid:BY2PR02MB165552FCF92069AF246044E2B5060@BY2PR02MB1655.namprd02.prod.outlook.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
      <div id="divtagdefaultwrapper"
style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
        <div><br>
          <br>
          Hi.<br>
          <br>
          The function set_advertised_address() is changing the wrong IP
          in record-routs from the SIP OK message.<br>
          I need to avoid this issue. The caller is in a remote network
          and the callee is in the local network.<br>
          <br>
          <br>
          What is my situation:<br>
          ----------------------------<br>
          An UAS (the callee), running in the same hardware as OpenSIPS,
          is registered with IP 127.0.0.1. It could be 192.168.0.100
          too. However, due to some specifics requirements of our
          project, such UAS must register itself using IP 127.0.0.1, not
          192.168.0.100.<br>
          <br>
          <br>
          What is the problem:<br>
          ---------------------------<br>
          When set_advertised_address("domain")  is called, for the SIP
          OK message, this function decides to change 127.0.0.1 to
          "domain".<br>
          For example, OpenSIPS receives:<br>
          <br>
          <div><span style="color: rgb(0, 111, 201);">SIP/2.0 200 OK</span><br>
            <span style="color: rgb(0, 111, 201);">Via: SIP/2.0/TCP
XXX.YYY.240.204:61871;rport=61871;received=131.221.240.204;branch=z9hG4bKPj8bd4d5988f4a4a0ba3599eba77f42600;alias</span><br>
            <span style="color: rgb(0, 111, 201);">Record-Route:
              &lt;sip:<span style="color: rgb(255, 0, 0);">127.0.0.1</span>;transport=tcp;lr;r2=on;did=862.47466066&gt;</span><br>
            <span style="color: rgb(0, 111, 201);">Record-Route:
              &lt;sip:192.168.0.100;transport=tcp;lr;r2=on;did=862.47466066&gt;</span><br>
            <br>
            and change it to:<br>
            <br>
            <span style="color: rgb(0, 111, 201);">SIP/2.0 200 OK</span><br>
            <span style="color: rgb(0, 111, 201);">Via: SIP/2.0/TCP
XXX.YYY.240.204:61871;rport=61871;received=131.221.240.204;branch=z9hG4bKPj8bd4d5988f4a4a0ba3599eba77f42600;alias</span><br>
            <span style="color: rgb(0, 111, 201);">Record-Route:
              &lt;sip:<span style="color: rgb(255, 0, 0);">domain</span>;transport=tcp;lr;r2=on;did=862.47466066&gt;</span><br>
            <span style="color: rgb(0, 111, 201);">Record-Route:
              &lt;sip:192.168.0.100;transport=tcp;lr;r2=on;did=862.47466066&gt;</span><br>
          </div>
          <br>
          But, OpenSIPS should change the IP 192.168.0.100 to "domain",
          not the other Record-Route.<br>
          As I have this issue, the UAC can't send the SIP ACK
          confirming the SIP OK.<br>
          <br>
          <br>
          What I need to provide:<br>
          --------------------------------<br>
          I have to get/build a solution to make the <span>set_advertised_address("domain")</span>
          change the Record-Route that contains the IP 1921.168.0.100.<br>
          <br>
          Maybe, the OpenSIPS always change the top most Record-Route.
          If it is true, I need a  workaround for it.<br>
          <br>
          So, how can I fix the record-routs as I need? Does it make
          sense to do what I'm needing?<br>
          Any hint will be very helpful!<br>
          Best regards.<br>
        </div>
        <br>
        <p><br>
        </p>
        <div id="Signature">
          <div name="divtagdefaultwrapper"
            style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:; margin:0">
            <div class="BodyFragment"><font size="2">
                <div class="PlainText">RODRIGO PIMENTA CARVALHO<br>
                  Inatel Competence Center<br>
                  Software<br>
                  Ph: +55 35 3471 9200 RAMAL 979<br>
                </div>
              </font></div>
          </div>
        </div>
      </div>
      <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>