2008-04-29 23:34:26 +00:00
|
|
|
#ifndef FREESWITCH_LUA_H
|
|
|
|
#define FREESWITCH_LUA_H
|
2008-04-25 22:16:16 +00:00
|
|
|
|
2008-04-30 19:42:26 +00:00
|
|
|
extern "C" {
|
|
|
|
#include "lua.h"
|
|
|
|
#include <lauxlib.h>
|
|
|
|
#include <lualib.h>
|
|
|
|
#include "mod_lua_extra.h"
|
|
|
|
}
|
|
|
|
|
2008-04-25 22:16:16 +00:00
|
|
|
#include <switch_cpp.h>
|
|
|
|
|
|
|
|
class Session : public CoreSession {
|
2008-04-30 19:42:26 +00:00
|
|
|
private:
|
|
|
|
virtual void do_hangup_hook();
|
|
|
|
lua_State *getLUA();
|
|
|
|
lua_State *L;
|
|
|
|
int hh;
|
|
|
|
int mark;
|
2008-04-25 22:16:16 +00:00
|
|
|
public:
|
|
|
|
Session();
|
|
|
|
Session(char *uuid);
|
|
|
|
Session(switch_core_session_t *session);
|
|
|
|
~Session();
|
2008-04-30 19:42:26 +00:00
|
|
|
|
2008-04-25 22:16:16 +00:00
|
|
|
virtual bool begin_allow_threads();
|
|
|
|
virtual bool end_allow_threads();
|
|
|
|
virtual void check_hangup_hook();
|
2008-04-30 19:42:26 +00:00
|
|
|
|
2008-04-25 22:16:16 +00:00
|
|
|
virtual switch_status_t run_dtmf_callback(void *input, switch_input_type_t itype);
|
2008-04-29 23:34:26 +00:00
|
|
|
void setInputCallback(char *cbfunc, char *funcargs);
|
|
|
|
void setHangupHook(char *func);
|
2008-04-30 19:42:26 +00:00
|
|
|
bool ready();
|
|
|
|
|
2008-04-29 23:34:26 +00:00
|
|
|
char *cb_function;
|
|
|
|
char *cb_arg;
|
|
|
|
char *hangup_func_str;
|
2008-04-30 19:42:26 +00:00
|
|
|
void setLUA(lua_State *state);
|
2008-04-25 22:16:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|