[sr-dev] git:master:d4103701: tm: implemented the execution of onreply_route callback via kemi

Daniel-Constantin Mierla miconda at gmail.com
Thu Apr 14 15:16:23 CEST 2016


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2016-04-14T14:53:27+02:00

tm: implemented the execution of onreply_route callback via kemi

---

Modified: modules/tm/t_reply.c

---

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

---

diff --git a/modules/tm/t_reply.c b/modules/tm/t_reply.c
index 6022d50..40f1d5c 100644
--- a/modules/tm/t_reply.c
+++ b/modules/tm/t_reply.c
@@ -2144,6 +2144,8 @@ int reply_received( struct sip_msg  *p_msg )
 #endif
 	struct tmcb_params onsend_params;
 	struct run_act_ctx ctx;
+	struct run_act_ctx *bctx;
+	sr_kemi_eng_t *keng = NULL;
 
 	/* make sure we know the associated transaction ... */
 	if (t_check( p_msg  , &branch )==-1)
@@ -2330,7 +2332,15 @@ int reply_received( struct sip_msg  *p_msg )
 		/* Pre- and post-script callbacks have already
 		 * been executed by the core. (Miklos)
 		 */
-		run_top_route(onreply_rt.rlist[onreply_route], p_msg, &ctx);
+		if(unlikely(keng!=NULL)) {
+			bctx = sr_kemi_act_ctx_get();
+			sr_kemi_act_ctx_set(&ctx);
+			keng->froute(p_msg, BRANCH_ROUTE,
+					sr_kemi_cbname_lookup_idx(onreply_route));
+			sr_kemi_act_ctx_set(bctx);
+		} else {
+			run_top_route(onreply_rt.rlist[onreply_route], p_msg, &ctx);
+		}
 
 		/* restore brach last_received as before executing onreply_route */
 		uac->last_received = last_uac_status;




More information about the sr-dev mailing list