<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <font face="monospace">I mean, as per SIP, the UAS device must
      mirror, without any changes, the received RR into the 200 OK
      replies. And here even if Asterisk receives the RR hdr with the
      5061 port, it sends back a 200 OK with a </font><font
      face="monospace"><a rel="noreferrer">48470 port in RR :-/<br>
        <br>
        Regards,<br>
      </a></font>
    <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  <a class="moz-txt-link-freetext" href="https://www.opensips-solutions.com">https://www.opensips-solutions.com</a>
OpenSIPS eBootcamp 2021 
  <a class="moz-txt-link-freetext" href="https://opensips.org/training/OpenSIPS_eBootcamp_2021/">https://opensips.org/training/OpenSIPS_eBootcamp_2021/</a></pre>
    <div class="moz-cite-prefix">On 1/5/22 4:32 PM, Sergey Pisanko
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CANbQ6FJ9FJ_mqUOFPRR4zmRj0bUnfe8KA+Adyz+NhHdxNBmimQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="auto">Bogdan.
        <div dir="auto"><br>
        </div>
        <div dir="auto">Is it refers to the specific Asterisk behaivior
          scheme below? Asterisk's ACK of leg 2 and 200 OK of leg1 must
          be addressed to Opensips port 5061?<br>
        </div>
        <div dir="auto"><br>
        </div>
        <div dir="auto">Best Regards,</div>
        <div dir="auto">Sergey Pysanko.</div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Wed, Jan 5, 2022, 15:54
          Bogdan-Andrei Iancu <<a href="mailto:bogdan@opensips.org"
            moz-do-not-send="true">bogdan@opensips.org</a>> wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div> <font face="monospace">Hi Sergey,<br>
              <br>
              If Asterisk is the one changing (from 5061 to 48470) the
              port in the RR/Route header, that's illegal to do.<br>
              <br>
              Regards,<br>
            </font>
            <pre cols="72">Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  <a href="https://www.opensips-solutions.com" target="_blank" rel="noreferrer" moz-do-not-send="true">https://www.opensips-solutions.com</a>
OpenSIPS eBootcamp 2021 
  <a href="https://opensips.org/training/OpenSIPS_eBootcamp_2021/" target="_blank" rel="noreferrer" moz-do-not-send="true">https://opensips.org/training/OpenSIPS_eBootcamp_2021/</a></pre>
            <div>On 1/5/22 10:48 AM, Sergey Pisanko wrote:<br>
            </div>
            <blockquote type="cite">
              <div dir="ltr">
                <div dir="ltr">Hi, Bogdan.
                  <div><br>
                  </div>
                  <div>Yes, you are right. That's full call's scheme.</div>
                  <div><br>
                  </div>
                  <div>Opensips:48470                               
                     Asterisk (5062)<br>
                    1 leg ------------------INVITE
                    (RR:5061)------------><br>
<-----------------INVITE--------------------------------- 2 leg</div>
                  <div>2 leg --------------OK
                    (RR:5061)--------------------></div>
                  <div><--------------------ACK
                    (Route:48470)------------ 2 leg</div>
                  <div>< -------------------OK (RR: 48470)
                    ----------------- 1 leg</div>
                  <div>1 leg. ACK From UA1 to Asterisk through Opensips
                    (Route:48470) sent, but dropped.</div>
                  <div><br>
                  </div>
                  <div><br>
                  </div>
                  <div>Best Regards,</div>
                  <div>Sergey Pysanko.</div>
                  <div><br>
                    <br>
                  </div>
                  <br>
                  <div id="m_2723684797819790311mt-signature">
                    <table cellspacing="0" cellpadding="8" border="0">
                      <tbody>
                        <tr>
                          <td> <a
                              id="m_2723684797819790311signatureLink-logo"
href="https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11&"
                              style="text-decoration:none"
                              target="_blank" rel="noreferrer"
                              moz-do-not-send="true"> <img
src="https://s3.amazonaws.com/mailtrack-signature/sender-notified-72.gif"
                                alt="Mailtrack" moz-do-not-send="true"
                                width="32" height="32"> </a> </td>
                          <td> <span style="color:#777">Sender notified
                              by</span> <br>
                            <a
                              id="m_2723684797819790311signatureLink-text"
href="https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11&"
                              style="color:#4374f7" target="_blank"
                              rel="noreferrer" moz-do-not-send="true">Mailtrack</a>
                          </td>
                          <td><span
                              style="color:transparent;font-size:0">01/05/22,
                              10:45:28 AM</span></td>
                          <td> <br>
                          </td>
                        </tr>
                      </tbody>
                    </table>
                  </div>
                </div>
                <br>
                <img alt="" style="display:flex"
src="https://mailtrack.io/trace/mail/2a0c5a183b2d62c295dd0093eb1936a40f55b060.png?u=6916461"
                  moz-do-not-send="true" width="0" height="0">
                <div class="gmail_quote">
                  <div dir="ltr" class="gmail_attr">вт, 4 янв. 2022 г. в
                    20:44, Bogdan-Andrei Iancu <<a
                      href="mailto:bogdan@opensips.org" target="_blank"
                      rel="noreferrer" moz-do-not-send="true">bogdan@opensips.org</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> <font face="monospace">Sergey,<br>
                        <br>
                        I see OpenSIPS sents to Asterisk in INVITE:<br>
                        <br>
                        Record-Route: <a rel="noreferrer"
                          moz-do-not-send="true"><sip:Opensips_IP:5061;transport=tls;lr;ftag=d8e0d49a268d4b51aa85b8f79d2dc062></a><br>
                        <br>
                        but in the 200 reply from Asterisk back to
                        OpenSIPS I see:<br>
                        <br>
                        Record-Route: <a rel="noreferrer"
                          moz-do-not-send="true"><sip:Opensips_IP:48470;transport=TLS;lr;ftag=d8e0d49a268d4b51aa85b8f79d2dc062></a><br>
                        <br>
                        Is asterisk the once changing the port there ???<br>
                        <br>
                        Regards,<br>
                      </font>
                      <pre cols="72">Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  <a href="https://www.opensips-solutions.com" target="_blank" rel="noreferrer" moz-do-not-send="true">https://www.opensips-solutions.com</a>
OpenSIPS eBootcamp 2021 
  <a href="https://opensips.org/training/OpenSIPS_eBootcamp_2021/" target="_blank" rel="noreferrer" moz-do-not-send="true">https://opensips.org/training/OpenSIPS_eBootcamp_2021/</a></pre>
                      <div>On 1/4/22 3:11 PM, Sergey Pisanko wrote:<br>
                      </div>
                      <blockquote type="cite">
                        <div dir="ltr">
                          <div dir="ltr">Hi, Bogdan.
                            <div><br>
                            </div>
                            <div>Here is my simple scenario description:</div>
                            <div><br>
                            </div>
                            <div>UA1----Opensips----Asterisk ----
                              Opensips ----UA2</div>
                            <div><br>
                            </div>
                            <div>Transport protocol doesn't change
                              during this chain and it's tls, if I
                              understand you right.</div>
                            <div><br>
                            </div>
                            <div>I attached SIP capture of the call. As
                              you can see, there is the dynamic tcp port
                              in the RR hrd of last reply to client from
                              which Opensips connected to the Asterisk.
                              Instead of one, to which UA1 connected to
                              Opensips (5061). As a result, there is a
                              media session between UAs, but only for 30
                              sec, during of which the UA1 tried to send
                              ACK to the Opensips, but unsuccessfully
                              for quite clear reason. Is there
                              the resolution how to realize this
                              scenario without rewriting RR?</div>
                            <div><br>
                            </div>
                            <div>Best Regards,</div>
                            <div>Sergey Pysanko.</div>
                            <div><br>
                            </div>
                            <div><br>
                            </div>
                            <div><br>
                              <br>
                              <br>
                              <br>
                              <div
                                id="m_2723684797819790311gmail-m_-8442432568255109599mt-signature">
                                <table cellspacing="0" cellpadding="8"
                                  border="0">
                                  <tbody>
                                    <tr>
                                      <td> <a
                                          id="m_2723684797819790311gmail-m_-8442432568255109599signatureLink-logo"
href="https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11&"
                                          style="text-decoration:none"
                                          target="_blank"
                                          rel="noreferrer"
                                          moz-do-not-send="true"> <img
src="https://s3.amazonaws.com/mailtrack-signature/sender-notified-72.gif"
                                            alt="Mailtrack"
                                            moz-do-not-send="true"
                                            width="32" height="32"> </a>
                                      </td>
                                      <td> <span
                                          style="color:rgb(119,119,119)">Sender
                                          notified by</span> <br>
                                        <a
                                          id="m_2723684797819790311gmail-m_-8442432568255109599signatureLink-text"
href="https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11&"
                                          style="color:rgb(67,116,247)"
                                          target="_blank"
                                          rel="noreferrer"
                                          moz-do-not-send="true">Mailtrack</a>
                                      </td>
                                      <td><span
                                          style="color:transparent;font-size:0px">01/04/22,
                                          01:46:49 PM</span></td>
                                      <td> <br>
                                      </td>
                                    </tr>
                                  </tbody>
                                </table>
                              </div>
                            </div>
                          </div>
                          <br>
                          <img alt="" style="display:flex"
                            moz-do-not-send="true" width="0" height="0">
                          <div class="gmail_quote">
                            <div dir="ltr" class="gmail_attr">вт, 4 янв.
                              2022 г. в 11:47, Bogdan-Andrei Iancu <<a
                                href="mailto:bogdan@opensips.org"
                                target="_blank" rel="noreferrer"
                                moz-do-not-send="true">bogdan@opensips.org</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> <font face="monospace">Hi Sergey,<br>
                                  <br>
                                  Manually altering the RR hdr is a
                                  receipt for disaster :). Somehow I
                                  suspect you do not do double RR (as
                                  the protocol changes for the call).
                                  This double RR is automatically done
                                  (by default) when doing
                                  `record_route()`. Do you get 2 RR hdrs
                                  when routing the initial INVITE ?<br>
                                  <br>
                                  Regards,<br>
                                </font>
                                <pre cols="72">Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  <a href="https://www.opensips-solutions.com" target="_blank" rel="noreferrer" moz-do-not-send="true">https://www.opensips-solutions.com</a>
OpenSIPS eBootcamp 2021 
  <a href="https://opensips.org/training/OpenSIPS_eBootcamp_2021/" target="_blank" rel="noreferrer" moz-do-not-send="true">https://opensips.org/training/OpenSIPS_eBootcamp_2021/</a></pre>
                                <div>On 1/4/22 11:27 AM, Sergey Pisanko
                                  wrote:<br>
                                </div>
                                <blockquote type="cite">
                                  <div dir="ltr">
                                    <div dir="ltr">Hello, Bogdan, .<br>
                                      <br>
                                      Thank you for your answer. I've
                                      solved my issue recently just
                                      rewriting Record - Route header
                                      with appropriate port within
                                      "onreply route block" by subst
                                      function.<br>
                                      <br>
                                      Best Regards,<br>
                                      Sergey Pysanko.<br>
                                      <br>
                                      <br>
                                      <br>
                                      <div
id="m_2723684797819790311gmail-m_-8442432568255109599gmail-m_-410283401214300640mt-signature">
                                        <table cellspacing="0"
                                          cellpadding="8" border="0">
                                          <tbody>
                                            <tr>
                                              <td> <a
id="m_2723684797819790311gmail-m_-8442432568255109599gmail-m_-410283401214300640signatureLink-logo"
href="https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11&"
style="text-decoration:none" target="_blank" rel="noreferrer"
                                                  moz-do-not-send="true">
                                                  <img
src="https://s3.amazonaws.com/mailtrack-signature/sender-notified-72.gif"
                                                    alt="Mailtrack"
                                                    moz-do-not-send="true"
                                                    width="32"
                                                    height="32"> </a> </td>
                                              <td> <span
                                                  style="color:rgb(119,119,119)">Sender
                                                  notified by</span> <br>
                                                <a
id="m_2723684797819790311gmail-m_-8442432568255109599gmail-m_-410283401214300640signatureLink-text"
href="https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11&"
style="color:rgb(67,116,247)" target="_blank" rel="noreferrer"
                                                  moz-do-not-send="true">Mailtrack</a>
                                              </td>
                                              <td><span
                                                  style="color:transparent;font-size:0px">01/04/22,
                                                  11:27:07 AM</span></td>
                                              <td> <br>
                                              </td>
                                            </tr>
                                          </tbody>
                                        </table>
                                      </div>
                                    </div>
                                    <br>
                                    <img alt="" style="display:flex"
                                      moz-do-not-send="true" width="0"
                                      height="0">
                                    <div class="gmail_quote">
                                      <div dir="ltr" class="gmail_attr">пн,
                                        3 янв. 2022 г. в 17:59,
                                        Bogdan-Andrei Iancu <<a
                                          href="mailto:bogdan@opensips.org"
                                          target="_blank"
                                          rel="noreferrer"
                                          moz-do-not-send="true">bogdan@opensips.org</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> <font face="monospace">Hello
                                            Sergey,<br>
                                            <br>
                                            Could you provide a SIP
                                            capture (and calling
                                            scenario) to underline the
                                            issue you have ?<br>
                                            <br>
                                            Best regards,<br>
                                          </font>
                                          <pre cols="72">Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  <a href="https://www.opensips-solutions.com" target="_blank" rel="noreferrer" moz-do-not-send="true">https://www.opensips-solutions.com</a>
OpenSIPS eBootcamp 2021 
  <a href="https://opensips.org/training/OpenSIPS_eBootcamp_2021/" target="_blank" rel="noreferrer" moz-do-not-send="true">https://opensips.org/training/OpenSIPS_eBootcamp_2021/</a></pre>
                                          <div>On 12/30/21 2:50 PM,
                                            Sergey Pisanko wrote:<br>
                                          </div>
                                          <blockquote type="cite">
                                            <div dir="ltr">Hello!<br>
                                              <br>
                                              I try to realize the next
                                              scenario with UAs,
                                              Opensips-2.4 and Asterisk.<br>
                                              UAs are registered onto
                                              Asterisk through Opensips
                                              and also - on Opensips if
                                              the 200 OK is came back
                                              from Asterisk.<br>
                                              Calls between UAs are
                                              relayed to Asterisk by
                                              Opensips.<br>
                                              This scenario works fine
                                              with udp. But it needs to
                                              do with tls. And here I
                                              have the problem. What
                                              happens.<br>
                                              Unlike udp, tcp cannot
                                              listen its port and
                                              create clients connection
                                              at the same time. Opensips
                                              listens tls port for
                                              clients connection <br>
                                              whereas it creates dynamic
                                              tcp port to connect to
                                              Asterisk. As a result, I
                                              see that port in
                                              Record-Route header in 200
                                              OK addressed to caller.<br>
                                              Thus, callers ACK comes to
                                              that dynamic port instead
                                              of Opensips listened port
                                              and Opensips dropped it.<br>
                                              And question is how to
                                              force Opensips to put
                                              right port for caller?
                                              <div><br>
                                              </div>
                                              <div>Regards,</div>
                                              <div>Serhii Pysanko.<br>
                                                <br>
                                                <br>
                                                <br>
                                                <div
id="m_2723684797819790311gmail-m_-8442432568255109599gmail-m_-410283401214300640gmail-m_-5447805212921776049mt-signature">
                                                  <table cellspacing="0"
                                                    cellpadding="8"
                                                    border="0">
                                                    <tbody>
                                                      <tr>
                                                        <td> <a
id="m_2723684797819790311gmail-m_-8442432568255109599gmail-m_-410283401214300640gmail-m_-5447805212921776049signatureLink-logo"
href="https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11&"
style="text-decoration:none" target="_blank" rel="noreferrer"
                                                          moz-do-not-send="true">
                                                          <img
src="https://s3.amazonaws.com/mailtrack-signature/sender-notified-72.gif"
alt="Mailtrack" moz-do-not-send="true" width="32" height="32"> </a> </td>
                                                        <td> <span
                                                          style="color:rgb(119,119,119)">Sender
                                                          notified by</span>
                                                          <br>
                                                          <a
id="m_2723684797819790311gmail-m_-8442432568255109599gmail-m_-410283401214300640gmail-m_-5447805212921776049signatureLink-text"
href="https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11&"
style="color:rgb(67,116,247)" target="_blank" rel="noreferrer"
                                                          moz-do-not-send="true">Mailtrack</a>
                                                        </td>
                                                        <td><span
                                                          style="color:transparent;font-size:0px">12/30/21,
                                                          02:49:47 PM</span></td>
                                                        <td> <br>
                                                        </td>
                                                      </tr>
                                                    </tbody>
                                                  </table>
                                                </div>
                                              </div>
                                              <img alt=""
                                                style="display:flex"
                                                moz-do-not-send="true"
                                                width="0" height="0"></div>
                                            <br>
                                            <fieldset></fieldset>
                                            <pre>_______________________________________________
Users mailing list
<a href="mailto:Users@lists.opensips.org" target="_blank" rel="noreferrer" moz-do-not-send="true">Users@lists.opensips.org</a>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank" rel="noreferrer" moz-do-not-send="true">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
                                          </blockquote>
                                          <br>
                                        </div>
                                      </blockquote>
                                    </div>
                                  </div>
                                </blockquote>
                                <br>
                              </div>
_______________________________________________<br>
                              Users mailing list<br>
                              <a href="mailto:Users@lists.opensips.org"
                                target="_blank" rel="noreferrer"
                                moz-do-not-send="true">Users@lists.opensips.org</a><br>
                              <a
                                href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
                                rel="noreferrer noreferrer"
                                target="_blank" moz-do-not-send="true">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
                            </blockquote>
                          </div>
                        </div>
                        <br>
                        <fieldset></fieldset>
                        <pre>_______________________________________________
Users mailing list
<a href="mailto:Users@lists.opensips.org" target="_blank" rel="noreferrer" moz-do-not-send="true">Users@lists.opensips.org</a>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank" rel="noreferrer" moz-do-not-send="true">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
                      </blockquote>
                      <br>
                    </div>
                    _______________________________________________<br>
                    Users mailing list<br>
                    <a href="mailto:Users@lists.opensips.org"
                      target="_blank" rel="noreferrer"
                      moz-do-not-send="true">Users@lists.opensips.org</a><br>
                    <a
                      href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
                      rel="noreferrer noreferrer" target="_blank"
                      moz-do-not-send="true">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
                  </blockquote>
                </div>
              </div>
              <br>
              <fieldset></fieldset>
              <pre>_______________________________________________
Users mailing list
<a href="mailto:Users@lists.opensips.org" target="_blank" rel="noreferrer" moz-do-not-send="true">Users@lists.opensips.org</a>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank" rel="noreferrer" moz-do-not-send="true">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
            </blockquote>
            <br>
          </div>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </body>
</html>