Module: kamailio
Branch: master
Commit: 0689ac5976121d5a8edf815c0cee51da1098530f
URL: 
https://github.com/kamailio/kamailio/commit/0689ac5976121d5a8edf815c0cee51da1098530f

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2019-04-10T09:56:20+02:00

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

---

Modified: src/core/kemi.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/0689ac5976121d5a8edf815c0cee51da1098530f.diff
Patch: 
https://github.com/kamailio/kamailio/commit/0689ac5976121d5a8edf815c0cee51da1098530f.patch

---

diff --git a/src/core/kemi.c b/src/core/kemi.c
index deb9285b9d..039ba1557f 100644
--- a/src/core/kemi.c
+++ b/src/core/kemi.c
@@ -2429,6 +2429,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;
 }


_______________________________________________
Kamailio (SER) - Development Mailing List
[email protected]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to