[sr-dev] git:master:9bbef256: app_lua: check if kemi onsend_route callback name is set

Daniel-Constantin Mierla miconda at gmail.com
Fri Mar 9 09:46:32 CET 2018


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2018-03-09T09:45:10+01:00

app_lua: check if kemi onsend_route callback name is set

---

Modified: src/modules/app_lua/app_lua_mod.c

---

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

---

diff --git a/src/modules/app_lua/app_lua_mod.c b/src/modules/app_lua/app_lua_mod.c
index ac536878c9..b4786b2745 100644
--- a/src/modules/app_lua/app_lua_mod.c
+++ b/src/modules/app_lua/app_lua_mod.c
@@ -140,7 +140,11 @@ int sr_kemi_config_engine_lua(sip_msg_t *msg, int rtype, str *rname,
 			ret = app_lua_run_ex(msg, rname->s, NULL, NULL, NULL, 0);
 		}
 	} else if(rtype==ONSEND_ROUTE) {
-		ret = app_lua_run_ex(msg, "ksr_onsend_route", NULL, NULL, NULL, 0);
+		if(kemi_onsend_route_callback.len>0) {
+			ret = app_lua_run_ex(msg, kemi_onsend_route_callback.s, NULL,
+					NULL, NULL, 0);
+		}
+		return 1;
 	} else if(rtype==EVENT_ROUTE) {
 		if(rname!=NULL && rname->s!=NULL) {
 			ret = app_lua_run_ex(msg, rname->s,




More information about the sr-dev mailing list