<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hello,</p>
    <p>thanks for the report and digging in further to look for a fix!</p>
    <p>I pushed a slightly different version, reversing the order,
      expecting the native config file to be still the more common use
      case.</p>
    <p>It is now in the master branch, I will backport for next 5.4.x
      release.</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 13.04.21 22:41, Salah Uddin Ahmed
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAPX5VgMQV2Layv=9Qy8xFGcur0di9DGSmpEFLy4idu7g+vjzqQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hi Henning,
        <div><br>
        </div>
        <div>Thanks for your reply.</div>
        <div>I have tried this with the latest version, 5.4.4. But it
          has the same behavior as 5.4.1.</div>
        <div>Here added the simple patch we have made. Not sure is there
          any side effect of this change.</div>
        <div><br>
        </div>
        <div>===============================</div>
        <div>Index: kamailio-5.4.4/src/core/onsend.h<br>
===================================================================<br>
          --- kamailio-5.4.4.orig/src/core/onsend.h<br>
          +++ kamailio-5.4.4/src/core/onsend.h<br>
          @@ -57,7 +57,7 @@ extern onsend_info_t* p_onsend;<br>
            * WARNING: buf must be 0 terminated (to allow regex matches
          on it) */<br>
           int run_onsend(sip_msg_t* orig_msg, dest_info_t* dst, char*
          buf, int len);<br>
          <br>
          -#define onsend_route_enabled(rtype)
(onsend_rt.rlist[DEFAULT_RT]?((rtype==SIP_REPLY)?onsend_route_reply:1):0)<br>
          +#define onsend_route_enabled(rtype)
          (((kemi_onsend_route_callback.len>0 &&
          sr_kemi_eng_get()) ||
onsend_rt.rlist[DEFAULT_RT])?((rtype==SIP_REPLY)?onsend_route_reply:1):0)<br>
          <br>
           int run_onsend_evroute(onsend_info_t *sndinfo, int evrt, str
          *evcb, str *evname);<br>
        </div>
        <div>===============================</div>
        <div><br>
        </div>
        <div>Thanks,</div>
        <div>Rubel</div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Tue, Apr 13, 2021 at 6:00
          AM Henning Westerholt <<a href="mailto:hw@skalatan.de"
            moz-do-not-send="true">hw@skalatan.de</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 style="overflow-wrap: break-word;" lang="DE">
            <div class="gmail-m_285798938748627463WordSection1">
              <p class="MsoNormal"><span>Hello,</span></p>
              <p class="MsoNormal"><span> </span></p>
              <p class="MsoNormal"><span lang="EN-GB">have not looked
                  into the details, but I would suggest before you spend
                  more time debugging it to upgrade to the latest 5.4.x
                  version. You do not need to change something in your
                  cfg or db for this, and it will also contain other
                  bugfixes.</span></p>
              <p class="MsoNormal"><span lang="EN-GB"> </span></p>
              <p class="MsoNormal"><span lang="EN-GB">Cheers,</span></p>
              <p class="MsoNormal"><span lang="EN-GB"> </span></p>
              <p class="MsoNormal"><span lang="EN-GB">Henning</span></p>
              <p class="MsoNormal"><span lang="EN-GB"> </span></p>
              <p class="MsoNormal"><span lang="EN-GB">-- </span></p>
              <p class="MsoNormal"><span lang="EN-GB">Henning Westerholt
                  –
                </span><span><a href="https://skalatan.de/blog/"
                    target="_blank" moz-do-not-send="true"><span
                      style="color:rgb(5,99,193)" lang="EN-GB">https://skalatan.de/blog/</span></a></span><span
                  lang="EN-GB"></span></p>
              <p class="MsoNormal"><span lang="EN-GB">Kamailio services
                  –
                </span><span><a href="https://gilawa.com/"
                    target="_blank" moz-do-not-send="true"><span
                      style="color:rgb(5,99,193)" lang="EN-GB">https://gilawa.com</span></a></span><span>
                  <span lang="EN-GB"></span></span></p>
              <p class="MsoNormal"><span lang="EN-GB"> </span></p>
              <div
style="border-right:none;border-bottom:none;border-left:none;border-top:1pt
                solid rgb(225,225,225);padding:3pt 0cm 0cm">
                <p class="MsoNormal" style="margin-left:35.4pt"><b>From:</b>
                  sr-dev <<a
                    href="mailto:sr-dev-bounces@lists.kamailio.org"
                    target="_blank" moz-do-not-send="true">sr-dev-bounces@lists.kamailio.org</a>>
                  <b>On Behalf Of </b>Salah Uddin Ahmed<br>
                  <b>Sent:</b> Monday, April 12, 2021 11:28 PM<br>
                  <b>To:</b> <a href="mailto:sr-dev@lists.kamailio.org"
                    target="_blank" moz-do-not-send="true">sr-dev@lists.kamailio.org</a><br>
                  <b>Subject:</b> [sr-dev] onsend reply route issue with
                  KEMI</p>
              </div>
              <p class="MsoNormal" style="margin-left:35.4pt"> </p>
              <div>
                <p class="MsoNormal" style="margin-left:35.4pt">Hello,</p>
                <div>
                  <p class="MsoNormal" style="margin-left:35.4pt"> </p>
                </div>
                <div>
                  <p class="MsoNormal" style="margin-left:35.4pt">We are
                    using the Kamailio(5.4.1) with python3 KEMI
                    interpreter. Here I noticed an issue on
                    ksr_onsend_route with the reply messages. We did
                    "onsend_route_reply=1" on the kamailio.cfg. But
                    ksr_onsend_route is not triggered by any reply
                    messages. </p>
                </div>
                <div>
                  <p class="MsoNormal" style="margin-left:35.4pt">Tried
                    to dig some code and found, in t_reply.c before
                    calling "run_onsend" it tested whether the onsend_rt
                    list is empty or not by onsend_route_enabled(file:
                    onsend.h) method.</p>
                </div>
                <div>
                  <p class="MsoNormal" style="margin-left:35.4pt">But
                    presumably rt lists are always empty if we use a
                    KEMI interpreter.  We have tried the same version of
                    Kamailio without KEMI, then onsend_route works fine.</p>
                </div>
                <div>
                  <p class="MsoNormal" style="margin-left:35.4pt"> </p>
                </div>
                <div>
                  <p class="MsoNormal" style="margin-left:35.4pt">If
                    onsend_rt is not being used in case of KEMI then can
                    we replace this test with simply by testing only
                    the onsend_route_reply flag?</p>
                </div>
                <div>
                  <p class="MsoNormal" style="margin-left:35.4pt"> </p>
                </div>
                <div>
                  <p class="MsoNormal" style="margin-left:35.4pt">Please
                    advise if we are missing something.</p>
                </div>
                <div>
                  <p class="MsoNormal" style="margin-left:35.4pt"> </p>
                </div>
                <div>
                  <p class="MsoNormal" style="margin-left:35.4pt">Thank
                    you,</p>
                </div>
                <div>
                  <p class="MsoNormal" style="margin-left:35.4pt">Rubel</p>
                </div>
              </div>
            </div>
          </div>
        </blockquote>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Kamailio (SER) - Development Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-dev@lists.kamailio.org">sr-dev@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - Online
May 17-20, 2021 (Europe Timezone) - June 7-10, 2021 (America Timezone)
  * <a class="moz-txt-link-freetext" href="https://www.asipto.com/sw/kamailio-advanced-training-online/">https://www.asipto.com/sw/kamailio-advanced-training-online/</a></pre>
  </body>
</html>