Module: kamailio Branch: 5.0 Commit: 8311b2ef9dd604ba86ede7d9ca34710762095162 URL: https://github.com/kamailio/kamailio/commit/8311b2ef9dd604ba86ede7d9ca347107...
Author: lazedo luis.azedo@factorlusitano.com Committer: Luis Azedo luis@2600hz.com Date: 2017-06-02T14:28:47+01:00
kazoo: add ksr_msg_env_reset after processing events
(cherry picked from commit afed885f8591ebb505511dba750d9671081c5d64)
---
Modified: src/modules/kazoo/kz_amqp.c
---
Diff: https://github.com/kamailio/kamailio/commit/8311b2ef9dd604ba86ede7d9ca347107... Patch: https://github.com/kamailio/kamailio/commit/8311b2ef9dd604ba86ede7d9ca347107...
---
diff --git a/src/modules/kazoo/kz_amqp.c b/src/modules/kazoo/kz_amqp.c index da310893c9..ca3a86a19c 100644 --- a/src/modules/kazoo/kz_amqp.c +++ b/src/modules/kazoo/kz_amqp.c @@ -42,6 +42,10 @@ #include "../../core/mod_fix.h" #include "../../core/lvalue.h" #include "../tm/tm_load.h" +#include "../../core/route.h" +#include "../../core/receive.h" +#include "../../core/action.h" +#include "../../core/script_cb.h"
#include "kz_amqp.h" @@ -2280,11 +2284,14 @@ int kz_amqp_consumer_fire_event(char *eventkey) fmsg = faked_msg_get_next(); rtb = get_route_type(); set_route_type(REQUEST_ROUTE); - init_run_actions_ctx(&ctx); - run_top_route(event_rt.rlist[rt], fmsg, 0); + if (exec_pre_script_cb(fmsg, REQUEST_CB_TYPE)!=0 ) { + init_run_actions_ctx(&ctx); + run_top_route(event_rt.rlist[rt], fmsg, 0); + exec_post_script_cb(fmsg, REQUEST_CB_TYPE); + ksr_msg_env_reset(); + } set_route_type(rtb); return 0; - }
void kz_amqp_consumer_event(char *payload, char* event_key, char* event_subkey) @@ -2408,6 +2415,7 @@ void kz_amqp_cb_ok(kz_amqp_cmd_ptr cmd) } struct action *a = main_rt.rlist[n]; tmb.t_continue(cmd->t_hash, cmd->t_label, a); + ksr_msg_env_reset(); }
void kz_amqp_cb_error(kz_amqp_cmd_ptr cmd) @@ -2419,6 +2427,7 @@ void kz_amqp_cb_error(kz_amqp_cmd_ptr cmd) } struct action *a = main_rt.rlist[n]; tmb.t_continue(cmd->t_hash, cmd->t_label, a); + ksr_msg_env_reset(); }
int kz_send_worker_error_event(kz_amqp_cmd_ptr cmd)