core: updated onsend_route_enabled() macro condtition
authorDaniel-Constantin Mierla <miconda@gmail.com>
Wed, 14 Apr 2021 13:14:10 +0000 (15:14 +0200)
committerDaniel-Constantin Mierla <miconda@gmail.com>
Thu, 15 Apr 2021 06:35:32 +0000 (08:35 +0200)
- detect when the kemi callbacks need to be executed for tm replies

(cherry picked from commit 0640645efdbc1f7ce36750d5a784a4cfedc3f02f)

src/core/onsend.h

index 744bece..a78927c 100644 (file)
@@ -57,7 +57,9 @@ 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) ((onsend_rt.rlist[DEFAULT_RT]? \
+                       ((rtype==SIP_REPLY)?onsend_route_reply:1):0) \
+                       || (kemi_onsend_route_callback.len>0 && sr_kemi_eng_get()))
 
 int run_onsend_evroute(onsend_info_t *sndinfo, int evrt, str *evcb, str *evname);