Hi Henning,

Thanks for your reply.
I have tried this with the latest version, 5.4.4. But it has the same behavior as 5.4.1.
Here added the simple patch we have made. Not sure is there any side effect of this change.

===============================
Index: kamailio-5.4.4/src/core/onsend.h
===================================================================
--- kamailio-5.4.4.orig/src/core/onsend.h
+++ kamailio-5.4.4/src/core/onsend.h
@@ -57,7 +57,7 @@ extern onsend_info_t* p_onsend;
  * WARNING: buf must be 0 terminated (to allow regex matches on it) */
 int run_onsend(sip_msg_t* orig_msg, dest_info_t* dst, char* buf, int len);

-#define onsend_route_enabled(rtype) (onsend_rt.rlist[DEFAULT_RT]?((rtype==SIP_REPLY)?onsend_route_reply:1):0)
+#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)

 int run_onsend_evroute(onsend_info_t *sndinfo, int evrt, str *evcb, str *evname);
===============================

Thanks,
Rubel

On Tue, Apr 13, 2021 at 6:00 AM Henning Westerholt <hw@skalatan.de> wrote:

Hello,

 

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.

 

Cheers,

 

Henning

 

--

Henning Westerholt – https://skalatan.de/blog/

Kamailio services – https://gilawa.com

 

From: sr-dev <sr-dev-bounces@lists.kamailio.org> On Behalf Of Salah Uddin Ahmed
Sent: Monday, April 12, 2021 11:28 PM
To: sr-dev@lists.kamailio.org
Subject: [sr-dev] onsend reply route issue with KEMI

 

Hello,

 

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. 

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.

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.

 

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?

 

Please advise if we are missing something.

 

Thank you,

Rubel