Module: kamailio
Branch: master
Commit: b511d90766c3dcf5643c8a29d02eb382b740a413
URL:
https://github.com/kamailio/kamailio/commit/b511d90766c3dcf5643c8a29d02eb38…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-01-09T14:18:23+01:00
app_lua: aligned kemi api for KSR.x.drop()
---
Modified: src/modules/app_lua/app_lua_sr.c
---
Diff:
https://github.com/kamailio/kamailio/commit/b511d90766c3dcf5643c8a29d02eb38…
Patch:
https://github.com/kamailio/kamailio/commit/b511d90766c3dcf5643c8a29d02eb38…
---
diff --git a/src/modules/app_lua/app_lua_sr.c b/src/modules/app_lua/app_lua_sr.c
index b5d8e67..3b18ff5 100644
--- a/src/modules/app_lua/app_lua_sr.c
+++ b/src/modules/app_lua/app_lua_sr.c
@@ -1745,9 +1745,26 @@ static int sr_kemi_lua_exit (lua_State *L)
/**
*
*/
+static int sr_kemi_lua_drop (lua_State *L)
+{
+ str *s;
+
+ LM_DBG("script drop call\n");
+ sr_kemi_core_drop(NULL);
+ s = sr_kemi_lua_exit_string_get();
+ lua_getglobal(L, "error");
+ lua_pushstring(L, s->s);
+ lua_call(L, 1, 0);
+ return 0;
+}
+
+/**
+ *
+ */
static const luaL_Reg _sr_kemi_x_Map [] = {
{"modf", lua_sr_modf},
{"exit", sr_kemi_lua_exit},
+ {"drop", sr_kemi_lua_drop},
{NULL, NULL}
};