Browse code

core: updated onsend_route_enabled() macro condtition

- detect when the kemi callbacks need to be executed for tm replies

Daniel-Constantin Mierla authored on 14/04/2021 13:14:10
Showing 1 changed files
... ...
@@ -57,7 +57,9 @@ extern onsend_info_t* p_onsend;
57 57
  * WARNING: buf must be 0 terminated (to allow regex matches on it) */
58 58
 int run_onsend(sip_msg_t* orig_msg, dest_info_t* dst, char* buf, int len);
59 59
 
60
-#define onsend_route_enabled(rtype) (onsend_rt.rlist[DEFAULT_RT]?((rtype==SIP_REPLY)?onsend_route_reply:1):0)
60
+#define onsend_route_enabled(rtype) ((onsend_rt.rlist[DEFAULT_RT]? \
61
+			((rtype==SIP_REPLY)?onsend_route_reply:1):0) \
62
+			|| (kemi_onsend_route_callback.len>0 && sr_kemi_eng_get()))
61 63
 
62 64
 int run_onsend_evroute(onsend_info_t *sndinfo, int evrt, str *evcb, str *evname);
63 65