mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-02-09 09:17:34 +00:00
cleanup a tiny bit
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8204 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
9194729a83
commit
9d27233fea
@ -25,15 +25,14 @@
|
|||||||
*
|
*
|
||||||
* Anthony Minessale II <anthmct@yahoo.com>
|
* Anthony Minessale II <anthmct@yahoo.com>
|
||||||
*
|
*
|
||||||
* mod_lua.c -- Framework Demo Module
|
* mod_lua.c -- Lua
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
#include "lua.h"
|
#include "lua.h"
|
||||||
#include <lauxlib.h>
|
#include <lauxlib.h>
|
||||||
#include <lualib.h>
|
#include <lualib.h>
|
||||||
//#include <tolua.h>
|
|
||||||
//#include "mod_lua_wrap.h"
|
|
||||||
|
|
||||||
SWITCH_MODULE_LOAD_FUNCTION(mod_lua_load);
|
SWITCH_MODULE_LOAD_FUNCTION(mod_lua_load);
|
||||||
SWITCH_MODULE_DEFINITION(mod_lua, mod_lua_load, NULL, NULL);
|
SWITCH_MODULE_DEFINITION(mod_lua, mod_lua_load, NULL, NULL);
|
||||||
@ -42,7 +41,6 @@ static struct {
|
|||||||
switch_memory_pool_t *pool;
|
switch_memory_pool_t *pool;
|
||||||
} globals;
|
} globals;
|
||||||
|
|
||||||
|
|
||||||
int luaopen_freeswitch(lua_State* L);
|
int luaopen_freeswitch(lua_State* L);
|
||||||
|
|
||||||
static lua_State *lua_init(void)
|
static lua_State *lua_init(void)
|
||||||
@ -95,7 +93,6 @@ static int docall (lua_State *L, int narg, int clear) {
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void lua_parse_and_execute(lua_State *L, char *input_code)
|
static void lua_parse_and_execute(lua_State *L, char *input_code)
|
||||||
{
|
{
|
||||||
int error = 0;
|
int error = 0;
|
||||||
@ -171,8 +168,8 @@ int lua_thread(const char *text)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
SWITCH_STANDARD_APP(lua_function) {
|
SWITCH_STANDARD_APP(lua_function)
|
||||||
|
{
|
||||||
lua_State *L = lua_init();
|
lua_State *L = lua_init();
|
||||||
char code[1024] = "";
|
char code[1024] = "";
|
||||||
snprintf(code, sizeof(code), "~session = LUASession:new(\"%s\");", switch_core_session_get_uuid(session));
|
snprintf(code, sizeof(code), "~session = LUASession:new(\"%s\");", switch_core_session_get_uuid(session));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user