<div dir="ltr">Well, I don't have your script, cannot help further. If you are proxying, you should proxy every message.<div><br></div><div>Maybe you are mixing stateful and stateless forwarding and are not handling all scenarios? </div><div><br></div><div>It could be an Opensips problem, but again, don't know what you are doing internally.</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 4, 2022 at 2:19 PM Yannick LE COENT <<a href="mailto:yannick.lecoent@nexcom.fr">yannick.lecoent@nexcom.fr</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>
    Hi Daniel,<br>
    <br>
    I do not think the ACK is sent by my script. It is sent by the TM
    module since it is a negative response.<br>
    Am I wrong ?<br>
    <br>
    Thanks,<br>
    Yannick<br>
    <br>
    <div>Le 04/05/2022 à 18:48, Daniel Zanutti a
      écrit :<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">Hi Yannick
        <div><br>
        </div>
        <div>I think you should not reply with ACK to the 407 from
          destination. Just forward 407 to origin and wait for ACK. As
          soon you receive ACK from origin, you forward to destination.</div>
        <div><br>
        </div>
        <div>It's more like a stateless but I believe it's the only way.</div>
        <div><br>
        </div>
        <div>Regards</div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Tue, May 3, 2022 at 12:16
          PM Yannick LE COENT <<a href="mailto:yannick.lecoent@nexcom.fr" target="_blank">yannick.lecoent@nexcom.fr</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> Hello Daniel,<br>
            <br>
            This is not what I looking for.<br>
            My OpenSIPS instance is working as a relay between the
            softphone and another proxy (proxy#2 in the call).<br>
            So it does not handle authentication.<br>
            <br>
            <font face="monospace">Alice           OpenSIPS         
              Proxy#2</font><br>
            <font face="monospace">   | INVITE         |               
              |</font><br>
            <font face="monospace"> </font><font face="monospace">  
              |--------------->| INVITE         |</font><br>
            <font face="monospace"> </font><font face="monospace">  
              |      100 Tring |--------------->|</font><br>
            <font face="monospace"> </font><font face="monospace">  
              |<---------------|            407 |</font><br>
            <font face="monospace"> </font><font face="monospace">  
              |                |<---------------|</font><br>
            <font face="monospace"> </font><font face="monospace">  
              |                | ACK            |</font><br>
            <font face="monospace"> </font><font face="monospace">  
              |                |--------------->|</font><br>
            <font face="monospace"> </font><font face="monospace">  
              |            407 |                |</font><br>
            <font face="monospace"> </font><font face="monospace">  
              |     X<---------|                |</font><br>
            <font face="monospace">    |  (no retrans.) |               
              |</font><br>
            <br>
            When the 407 is lost between OpenSIPS and Alice, it is not
            retransmitted by OpenSIPS.<br>
            <br>
            I would like to force retransmission.<br>
            <br>
            Thanks,<br>
            Yannick<br>
            <br>
            <div>Le 03/05/2022 à 15:16, Daniel Zanutti a écrit :<br>
            </div>
            <blockquote type="cite">
              <div dir="ltr">Generate in Stateful -> www_challenge or
                proxy_challenge?
                <div><a href="https://opensips.org/html/docs/modules/3.2.x/auth.html" target="_blank">https://opensips.org/html/docs/modules/3.2.x/auth.html</a><br>
                </div>
                <div><br>
                </div>
                <div>Is this what you are looking for?</div>
                <div><br>
                </div>
              </div>
              <br>
              <div class="gmail_quote">
                <div dir="ltr" class="gmail_attr">On Tue, May 3, 2022 at
                  3:50 AM Yannick LE COENT <<a href="mailto:yannick.lecoent@nexcom.fr" target="_blank">yannick.lecoent@nexcom.fr</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> Hello all,<br>
                    <br>
                    Could you tell if there is a way to enable 407 in
                    stateful mode ?<br>
                    <br>
                    Thanks,<br>
                    Yannick<br>
                    <br>
                    <div>Le 30/04/2022 à 18:14, Yannick LE COENT a
                      écrit :<br>
                    </div>
                    <blockquote type="cite"> Hello Ben,<br>
                      <br>
                      Thanks for your answer.<br>
                      <br>
                      This problem occurs when OpenSIPS is not in charge
                      of authenticating the INVITE request, but this is
                      done downstream.<br>
                      I've sent this question to know if somebody has
                      already solved this kind of problem.<br>
                      <br>
                      Best regards,<br>
                      Yannick<br>
                      <br>
                      <div>Le 30/04/2022 à 16:15, Ben Newlin a écrit :<br>
                      </div>
                      <blockquote type="cite">
                        <div>
                          <p class="MsoNormal">I see. Apologies, I
                            misunderstood the problem scenario.</p>
                          <p class="MsoNormal"> </p>
                          <p class="MsoNormal"><span style="color:black">Ben
                              Newlin </span></p>
                          <p class="MsoNormal"> </p>
                          <div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(181,196,223);padding:3pt 0in 0in">
                            <p class="MsoNormal" style="margin-bottom:12pt"><b><span style="font-size:12pt;color:black">From:
                                </span></b><span style="font-size:12pt;color:black">Users
                                <a href="mailto:users-bounces@lists.opensips.org" target="_blank"><users-bounces@lists.opensips.org></a>
                                on behalf of Yannick LE COENT <a href="mailto:yannick.lecoent@nexcom.fr" target="_blank"><yannick.lecoent@nexcom.fr></a><br>
                                <b>Date: </b>Saturday, April 30, 2022
                                at 5:46 AM<br>
                                <b>To: </b>OpenSIPS users mailling list
                                <a href="mailto:users@lists.opensips.org" target="_blank"><users@lists.opensips.org></a><br>
                                <b>Subject: </b>Re: [OpenSIPS-Users]
                                OpenSIPS : no 407 retransmission</span></p>
                          </div>
                          <div>
                            <div>
                              <table cellpadding="0" border="0">
                                <tbody>
                                  <tr>
                                    <td style="background:rgb(182,0,0);padding:0.75pt">
                                      <p class="MsoNormal"><b><span style="font-size:12pt;color:white">EXTERNAL
                                            EMAIL - Please use caution
                                            with links and attachments </span></b></p>
                                    </td>
                                  </tr>
                                </tbody>
                              </table>
                            </div>
                            <p class="MsoNormal"><span style="font-size:9pt;font-family:Helvetica;color:black"> </span></p>
                            <div class="MsoNormal" style="text-align:center" align="center">
                              <hr width="100%" size="0" align="center">
                            </div>
                          </div>
                          <p class="MsoNormal">Hello Ben,<br>
                            <br>
                            The 407 is sent upstream, but when it is
                            lost, it is not retransmitted by OpenSIPS.<br>
                            I do not have this problem with other
                            negative status codes (e.g. 486).<br>
                            <br>
                            This is clearly explained in <a href="https://opensips.org/pub/opensips/1.8.6/src/ChangeLog" target="_blank">
                              https://opensips.org/pub/opensips/1.8.6/src/ChangeLog</a></p>
                          <blockquote style="margin-top:5pt;margin-bottom:5pt">
                            <p class="MsoNormal"><span>2012-03-21
                                18:36:58  Bogdan-Andrei Iancu,
                                <bogdan at opensips dot org> </span><br>
                              <span>    * [8811] :</span><br>
                              <br>
                              <span>    TM will no longer do
                                retransmission for the 407/401 replies
                                (if no ACK is received) for both local
                                or proxied replies.</span><br>
                              <br>
                              <span>    According to RFC 3261,
                                retransmitting 407s/401s is probably a
                                bad idea:</span><br>
                              <br>
                              <span>    26.3.2.4 DoS Protection</span></p>
                          </blockquote>
                          <p class="MsoNormal">At the moment, my only
                            solution is to use forward() instead of
                            t_relay() in order to use the stateless
                            mode.<br>
                            <br>
                            Yannick<br>
                            <br>
                            <br>
                          </p>
                          <blockquote style="margin-top:5pt;margin-bottom:5pt">
                            <pre>Yannick,</pre>
                            <pre> </pre>
                            <pre>The default behavior of OpenSIPS is to relay any received responses back upstream. If it is not doing that it would have to be because you are stopping it in the script. Take a look at the documentation for failure_route [1] which explains this. Check your own failure_route in your script; you must be doing something there that is telling OpenSIPS not to relay the 401/407 back upstream.</pre>
                            <pre> </pre>
                            <pre>[1] <a href="https://www.opensips.org/Documentation/Script-Routes-2-4#toc3" target="_blank">https://www.opensips.org/Documentation/Script-Routes-2-4#toc3</a></pre>
                            <pre> </pre>
                            <pre>Ben Newlin</pre>
                            <pre> </pre>
                            <pre>From: Users <a href="mailto:users-bounces@lists.opensips.org" target="_blank"><users-bounces@lists.opensips.org></a> on behalf of Yannick LE COENT <a href="mailto:yannick.lecoent@nexcom.fr" target="_blank"><yannick.lecoent@nexcom.fr></a></pre>
                            <pre>Date: Friday, April 29, 2022 at 6:44 PM</pre>
                            <pre>To: <a href="mailto:users@lists.opensips.org" target="_blank">users@lists.opensips.org</a> <a href="mailto:users@lists.opensips.org" target="_blank"><users@lists.opensips.org></a></pre>
                            <pre>Subject: [OpenSIPS-Users] OpenSIPS : no 407 retransmission</pre>
                            <pre>EXTERNAL EMAIL - Please use caution with links and attachments</pre>
                            <pre> </pre>
                            <pre>Hello,</pre>
                            <pre> </pre>
                            <pre>I'm using OpenSIPS as a proxy in front of another proxy. The 2nd proxy</pre>
                            <pre>is in charge of authenticating the request.</pre>
                            <pre> </pre>
                            <pre>This is the callflow:</pre>
                            <pre> </pre>
                            <pre>Alice           OpenSIPS          Proxy#2</pre>
                            <pre>   | INVITE         |                |</pre>
                            <pre>   |--------------->| INVITE         |</pre>
                            <pre>   |      100 Tring |--------------->|</pre>
                            <pre>   |<---------------|            407 |</pre>
                            <pre>   |                |<---------------|</pre>
                            <pre>   |                | ACK            |</pre>
                            <pre>   |                |--------------->|</pre>
                            <pre>   |            407 |                |</pre>
                            <pre>   |     X<---------|                |</pre>
                            <pre>   |                |                |</pre>
                            <pre> </pre>
                            <pre>Since OpenSIPS does not retransmit 401/407, the call setup gets stuck.</pre>
                            <pre> </pre>
                            <pre>What can I do ?</pre>
                            <pre>If I set auto_100trying=1, that works, but this increases the number of</pre>
                            <pre>INVITE retransmissions since 180Ringing are not received instantly.</pre>
                            <pre> </pre>
                            <pre>Do you have any suggestion ?</pre>
                            <pre> </pre>
                            <pre>Thanks,</pre>
                            <pre>Yannick</pre>
                          </blockquote>
                        </div>
                        <br>
                        <fieldset></fieldset>
                        <pre>_______________________________________________
Users mailing list
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
                      </blockquote>
                      <br>
                      <br>
                      <fieldset></fieldset>
                      <pre>_______________________________________________
Users mailing list
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">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">Users@lists.opensips.org</a><br>
                  <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
                </blockquote>
              </div>
              <br>
              <fieldset></fieldset>
              <pre>_______________________________________________
Users mailing list
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">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">Users@lists.opensips.org</a><br>
          <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
        </blockquote>
      </div>
      <br>
      <fieldset></fieldset>
      <pre>_______________________________________________
Users mailing list
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">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">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div>