[sr-dev] git:master:fb99f748: app_lua: get lua execution stack for previous level

Daniel-Constantin Mierla miconda at gmail.com
Fri Mar 29 10:18:45 CET 2019


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2019-03-29T10:11:06+01:00

app_lua: get lua execution stack for previous level

- returns the info where current function was executed

---

Modified: src/modules/app_lua/app_lua_sr.c

---

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

---

diff --git a/src/modules/app_lua/app_lua_sr.c b/src/modules/app_lua/app_lua_sr.c
index 041cb32182..72cbc7180b 100644
--- a/src/modules/app_lua/app_lua_sr.c
+++ b/src/modules/app_lua/app_lua_sr.c
@@ -1952,7 +1952,7 @@ int sr_kemi_lua_exec_func(lua_State* L, int eidx)
 				   + (tve.tv_usec - tvb.tv_usec);
 		if(tdiff >= cfg_get(core, core_cfg, latency_limit_action)) {
 			memset(&dinfo, 0, sizeof(lua_Debug));
-			if(lua_getstack(L, 0, &dinfo)>0
+			if(lua_getstack(L, 1, &dinfo)>0
 						&& lua_getinfo(L, "nSl", &dinfo)>0) {
 				LOG(cfg_get(core, core_cfg, latency_log),
 						"alert - action KSR.%s%s%s(...)"




More information about the sr-dev mailing list