Skip to content

Commit

Permalink
rtimer: support for execution of kemi callback functions
Browse files Browse the repository at this point in the history
(cherry picked from commit 1b14fde)
  • Loading branch information
miconda committed Nov 21, 2017
1 parent cc1b2c9 commit 26de610
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/modules/rtimer/rtimer_mod.c
Expand Up @@ -40,6 +40,7 @@
#include "../../core/script_cb.h"
#include "../../core/parser/parse_param.h"
#include "../../core/fmsg.h"
#include "../../core/kemi.h"


MODULE_VERSION
Expand Down Expand Up @@ -183,6 +184,8 @@ void stm_timer_exec(unsigned int ticks, void *param)
stm_timer_t *it;
stm_route_t *rt;
sip_msg_t *fmsg;
sr_kemi_eng_t *keng = NULL;
str evname = str_init("rtimer");

if(param==NULL)
return;
Expand All @@ -196,7 +199,15 @@ void stm_timer_exec(unsigned int ticks, void *param)
if (exec_pre_script_cb(fmsg, REQUEST_CB_TYPE)==0 )
continue; /* drop the request */
set_route_type(REQUEST_ROUTE);
run_top_route(main_rt.rlist[rt->route], fmsg, 0);
keng = sr_kemi_eng_get();
if(keng==NULL) {
run_top_route(main_rt.rlist[rt->route], fmsg, 0);
} else {
if(keng->froute(fmsg, EVENT_ROUTE, &rt->route_name, &evname)<0) {
LM_ERR("error running event route kemi callback [%.*s]\n",
rt->route_name.len, rt->route_name.s);
}
}
exec_post_script_cb(fmsg, REQUEST_CB_TYPE);
ksr_msg_env_reset();
}
Expand Down

0 comments on commit 26de610

Please sign in to comment.