2008-05-01 22:56:14 +00:00
|
|
|
#ifndef FREESWITCH_LUA_H
|
|
|
|
#define FREESWITCH_LUA_H
|
2008-04-25 22:12:01 +00:00
|
|
|
|
2008-05-01 22:56:14 +00:00
|
|
|
extern "C" {
|
|
|
|
#ifdef __ICC
|
|
|
|
#pragma warning (disable:1419)
|
|
|
|
#endif
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
#include <perlibs.h>
|
|
|
|
#pragma comment(lib, PERL_LIB)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <EXTERN.h>
|
|
|
|
#include <perl.h>
|
|
|
|
#include <switch.h>
|
|
|
|
}
|
2008-04-25 22:12:01 +00:00
|
|
|
|
2008-05-01 22:56:14 +00:00
|
|
|
#include <switch_cpp.h>
|
2008-04-25 22:12:01 +00:00
|
|
|
|
2008-05-12 13:37:36 +00:00
|
|
|
namespace PERL {
|
2008-04-25 22:12:01 +00:00
|
|
|
class Session : public CoreSession {
|
|
|
|
private:
|
2008-05-01 22:56:14 +00:00
|
|
|
virtual void do_hangup_hook();
|
|
|
|
PerlInterpreter *getPERL();
|
|
|
|
PerlInterpreter *my_perl;
|
|
|
|
int hh;
|
|
|
|
int mark;
|
2008-07-14 20:37:36 +00:00
|
|
|
SV *me;
|
2008-04-25 22:12:01 +00:00
|
|
|
public:
|
|
|
|
Session();
|
2008-07-16 21:06:14 +00:00
|
|
|
Session(char *uuid, CoreSession *a_leg = NULL);
|
2008-04-25 22:12:01 +00:00
|
|
|
Session(switch_core_session_t *session);
|
|
|
|
~Session();
|
2008-05-01 22:56:14 +00:00
|
|
|
|
2008-04-25 22:12:01 +00:00
|
|
|
virtual bool begin_allow_threads();
|
|
|
|
virtual bool end_allow_threads();
|
|
|
|
virtual void check_hangup_hook();
|
|
|
|
|
2008-05-01 22:56:14 +00:00
|
|
|
virtual switch_status_t run_dtmf_callback(void *input, switch_input_type_t itype);
|
2008-07-14 20:37:36 +00:00
|
|
|
void setME(SV *p);
|
|
|
|
void setInputCallback(char *cbfunc = "on_input", char *funcargs = NULL);
|
2008-08-14 17:20:34 +00:00
|
|
|
void unsetInputCallback(void);
|
2008-05-08 23:58:45 +00:00
|
|
|
void setHangupHook(char *func, char *arg=NULL);
|
2008-05-01 22:56:14 +00:00
|
|
|
bool ready();
|
2008-07-14 20:37:36 +00:00
|
|
|
char *suuid;
|
2008-05-01 22:56:14 +00:00
|
|
|
char *cb_function;
|
|
|
|
char *cb_arg;
|
|
|
|
char *hangup_func_str;
|
2008-05-08 23:58:45 +00:00
|
|
|
char *hangup_func_arg;
|
2008-05-01 22:56:14 +00:00
|
|
|
void setPERL(PerlInterpreter *pi);
|
2008-04-25 22:12:01 +00:00
|
|
|
};
|
2008-05-12 13:37:36 +00:00
|
|
|
}
|
2008-04-25 22:12:01 +00:00
|
|
|
#endif
|