Browse Source

app_lua: aligned kemi api for KSR.x.drop()

Daniel-Constantin Mierla 8 năm trước cách đây
mục cha
commit
b511d90766
1 tập tin đã thay đổi với 17 bổ sung0 xóa
  1. 17 0
      src/modules/app_lua/app_lua_sr.c

+ 17 - 0
src/modules/app_lua/app_lua_sr.c

@@ -1742,12 +1742,29 @@ static int sr_kemi_lua_exit (lua_State *L)
 	return 0;
 }
 
+/**
+ *
+ */
+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}
 };