Browse code

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

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

Daniel-Constantin Mierla authored on 10/04/2019 07:56:20
Showing 1 changed files
... ...
@@ -1685,6 +1685,12 @@ int sr_kemi_route(sr_kemi_eng_t *keng, sip_msg_t *msg, int rtype,
1685 1685
 int sr_kemi_ctx_route(sr_kemi_eng_t *keng, run_act_ctx_t *ctx, sip_msg_t *msg,
1686 1686
 		int rtype, str *ename, str *edata)
1687 1687
 {
1688
+	run_act_ctx_t *bctx;
1689
+	int ret;
1690
+
1691
+	bctx = sr_kemi_act_ctx_get();
1688 1692
 	sr_kemi_act_ctx_set(ctx);
1689
-	return sr_kemi_route(keng, msg, rtype, ename, edata);
1693
+	ret = sr_kemi_route(keng, msg, rtype, ename, edata);
1694
+	sr_kemi_act_ctx_set(bctx);
1695
+	return ret;
1690 1696
 }