<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <font face="monospace">Hi,<br>
      <br>
      If an ACK is received, there is not way for is_method("invite") to
      let it pass.... I suggest using the script_trace() function, so
      you can understand the script execution.<br>
         
<a class="moz-txt-link-freetext" href="https://www.opensips.org/Documentation/Script-CoreFunctions-3-2#script_trace">https://www.opensips.org/Documentation/Script-CoreFunctions-3-2#script_trace</a><br>
      <br>
      Regards,<br>
    </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 Bootcamp 5-16 Dec 2022, online
  <a class="moz-txt-link-freetext" href="https://www.opensips.org/training/OpenSIPS_eBootcamp_2022/">https://www.opensips.org/training/OpenSIPS_eBootcamp_2022/</a></pre>
    <div class="moz-cite-prefix">On 11/15/22 11:21 PM, M S wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAEZrhoMoXgoBx3D=LVShrVnB7ciDtL9Ght-wNs5nYLui2RGKwg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hi List,
        <div>If I use a block like:</div>
        <div><br>
        </div>
        <div>if(is_method("invite") && !has_totags()) {</div>
        <div>    if(xxxx) send_reply(402, "more money");</div>
        <div>    ......</div>
        <div>}</div>
        <div><br>
        </div>
        <div>Then if an invite is received and xxxx is true, a 402 is
          sent, and then an ACK is received in response to 402, which
          has a to_tag too.</div>
        <div>This ACK strangely matches both method=invite and
          !has_totags... and therefore we (incorrectly) send another 402
          in response to ACK.</div>
        <div>Is this normal behaviour? or is this happening because I'm
          doing something wrong like I need to send 100 Trying and then
          402?</div>
        <div><br>
        </div>
        <div>Thank you!</div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-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>