[sr-dev] git:5.1:30e2399d: core: kemi - backpup and restore old context inside sr_kemi_ctx_route()

Daniel-Constantin Mierla miconda at gmail.com
Wed Apr 10 11:22:05 CEST 2019


Module: kamailio
Branch: 5.1
Commit: 30e2399d7bbad05b1d4967056d869d8e46b33165
URL: https://github.com/kamailio/kamailio/commit/30e2399d7bbad05b1d4967056d869d8e46b33165

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2019-04-10T11:07:32+02:00

core: kemi - backpup and restore old context inside sr_kemi_ctx_route()

(cherry picked from commit 0689ac5976121d5a8edf815c0cee51da1098530f)
(cherry picked from commit cb1b346f6b815ed0fdd9644e5c208f7c2a0d9f14)

---

Modified: src/core/kemi.c

---

Diff:  https://github.com/kamailio/kamailio/commit/30e2399d7bbad05b1d4967056d869d8e46b33165.diff
Patch: https://github.com/kamailio/kamailio/commit/30e2399d7bbad05b1d4967056d869d8e46b33165.patch

---

diff --git a/src/core/kemi.c b/src/core/kemi.c
index f42005061b..e7a74f77d3 100644
--- a/src/core/kemi.c
+++ b/src/core/kemi.c
@@ -1685,6 +1685,12 @@ int sr_kemi_route(sr_kemi_eng_t *keng, sip_msg_t *msg, int rtype,
 int sr_kemi_ctx_route(sr_kemi_eng_t *keng, run_act_ctx_t *ctx, sip_msg_t *msg,
 		int rtype, str *ename, str *edata)
 {
+	run_act_ctx_t *bctx;
+	int ret;
+
+	bctx = sr_kemi_act_ctx_get();
 	sr_kemi_act_ctx_set(ctx);
-	return sr_kemi_route(keng, msg, rtype, ename, edata);
+	ret = sr_kemi_route(keng, msg, rtype, ename, edata);
+	sr_kemi_act_ctx_set(bctx);
+	return ret;
 }




More information about the sr-dev mailing list