[sr-dev] git:master:31586e9e: tm: use kemi wrapper to execute routing functions

Daniel-Constantin Mierla miconda at gmail.com
Tue Feb 26 19:12:04 CET 2019


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2019-02-26T18:59:16+01:00

tm: use kemi wrapper to execute routing functions

---

Modified: src/modules/tm/t_fwd.c
Modified: src/modules/tm/t_reply.c
Modified: src/modules/tm/t_suspend.c
Modified: src/modules/tm/uac.c

---

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

---

diff --git a/src/modules/tm/t_fwd.c b/src/modules/tm/t_fwd.c
index 985b96f190..398c27a844 100644
--- a/src/modules/tm/t_fwd.c
+++ b/src/modules/tm/t_fwd.c
@@ -347,7 +347,7 @@ static int prepare_new_uac( struct cell *t, struct sip_msg *i_req,
 					bctx = sr_kemi_act_ctx_get();
 					init_run_actions_ctx(&ctx);
 					sr_kemi_act_ctx_set(&ctx);
-					if(keng->froute(i_req, BRANCH_ROUTE,
+					if(sr_kemi_route(keng, i_req, BRANCH_ROUTE,
 							sr_kemi_cbname_lookup_idx(branch_route), NULL)<0) {
 						LM_ERR("error running branch route kemi callback\n");
 					}
diff --git a/src/modules/tm/t_reply.c b/src/modules/tm/t_reply.c
index 411bf1be47..122d11c846 100644
--- a/src/modules/tm/t_reply.c
+++ b/src/modules/tm/t_reply.c
@@ -999,7 +999,7 @@ int run_failure_handlers(struct cell *t, struct sip_msg *rpl,
 			/* run a failure_route action if some was marked */
 			keng = sr_kemi_eng_get();
 			if(unlikely(keng!=NULL)) {
-				if(keng->froute(faked_req, FAILURE_ROUTE,
+				if(sr_kemi_route(keng, faked_req, FAILURE_ROUTE,
 						sr_kemi_cbname_lookup_idx(on_failure), NULL)<0) {
 					LM_ERR("error running failure route kemi callback\n");
 				}
@@ -1073,7 +1073,7 @@ int run_branch_failure_handlers(struct cell *t, struct sip_msg *rpl,
 			/* run a branch_failure_route action if some was marked */
 			keng = sr_kemi_eng_get();
 			if(unlikely(keng!=NULL)) {
-				if(keng->froute(faked_req, BRANCH_FAILURE_ROUTE,
+				if(sr_kemi_route(keng, faked_req, BRANCH_FAILURE_ROUTE,
 						sr_kemi_cbname_lookup_idx(on_branch_failure), NULL)<0) {
 					LM_ERR("error running branch failure route kemi callback\n");
 				}
@@ -2415,7 +2415,7 @@ int reply_received( struct sip_msg  *p_msg )
 			bctx = sr_kemi_act_ctx_get();
 			init_run_actions_ctx(&ctx);
 			sr_kemi_act_ctx_set(&ctx);
-			keng->froute(p_msg, TM_ONREPLY_ROUTE,
+			sr_kemi_route(keng, p_msg, TM_ONREPLY_ROUTE,
 					sr_kemi_cbname_lookup_idx(onreply_route), NULL);
 			sr_kemi_act_ctx_set(bctx);
 		} else {
diff --git a/src/modules/tm/t_suspend.c b/src/modules/tm/t_suspend.c
index 205c945d4c..c37957daba 100644
--- a/src/modules/tm/t_suspend.c
+++ b/src/modules/tm/t_suspend.c
@@ -314,7 +314,7 @@ int t_continue_helper(unsigned int hash_index, unsigned int label,
 						if(cbparam && cbparam->s) {
 							evname = *cbparam;
 						}
-						if(keng->froute(faked_req, FAILURE_ROUTE, cbname,
+						if(sr_kemi_route(keng, faked_req, FAILURE_ROUTE, cbname,
 								&evname)<0) {
 							LM_ERR("error running event route kemi callback\n");
 							return -1;
@@ -392,8 +392,8 @@ int t_continue_helper(unsigned int hash_index, unsigned int label,
 						if(cbparam && cbparam->s) {
 							evname = *cbparam;
 						}
-						if(keng->froute(t->uac[branch].reply, TM_ONREPLY_ROUTE,
-								cbname, &evname)<0) {
+						if(sr_kemi_route(keng, t->uac[branch].reply,
+									TM_ONREPLY_ROUTE, cbname, &evname)<0) {
 							LM_ERR("error running event route kemi callback\n");
 						}
 					} else {
diff --git a/src/modules/tm/uac.c b/src/modules/tm/uac.c
index 29f298a5d5..1686bd157b 100644
--- a/src/modules/tm/uac.c
+++ b/src/modules/tm/uac.c
@@ -273,7 +273,7 @@ static inline int t_run_local_req(
 			LM_WARN("event callback (%s) set, but no cfg engine\n",
 					tm_event_callback.s);
 		} else {
-			if(keng->froute(&lreq, EVENT_ROUTE,
+			if(sr_kemi_route(keng, &lreq, EVENT_ROUTE,
 						&tm_event_callback, &evname)<0) {
 				LM_ERR("error running event route kemi callback\n");
 			}




More information about the sr-dev mailing list