Module: kamailio
Branch: 5.0
Commit: a5e68b5697688f82edbc48e64f32e15f89c8b357
URL:
https://github.com/kamailio/kamailio/commit/a5e68b5697688f82edbc48e64f32e15…
Author: lazedo <luis.azedo(a)factorlusitano.com>
Committer: Luis Azedo <luis(a)2600hz.com>
Date: 2017-05-19T16:08:53+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/a5e68b5697688f82edbc48e64f32e15…
Patch:
https://github.com/kamailio/kamailio/commit/a5e68b5697688f82edbc48e64f32e15…
---
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)