mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-02-24 02:18:57 +00:00
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9063 d0543943-73ff-0310-b7d9-9358b9ac24b2
50 lines
1.1 KiB
C++
50 lines
1.1 KiB
C++
#ifndef FREESWITCH_PYTHON_H
|
|
#define FREESWITCH_PYTHON_H
|
|
|
|
extern "C" {
|
|
#include <Python.h>
|
|
#include "mod_python_extra.h"
|
|
}
|
|
|
|
#include <switch_cpp.h>
|
|
|
|
namespace PYTHON {
|
|
class Session : public CoreSession {
|
|
private:
|
|
virtual void do_hangup_hook();
|
|
PyObject *getPython();
|
|
PyObject *Py;
|
|
PyObject *Self;
|
|
int hh;
|
|
int mark;
|
|
PyThreadState *TS;
|
|
public:
|
|
Session();
|
|
Session(char *nuuid, CoreSession *a_leg = NULL);
|
|
Session(switch_core_session_t *session);
|
|
virtual ~Session();
|
|
|
|
virtual bool begin_allow_threads();
|
|
virtual bool end_allow_threads();
|
|
virtual void check_hangup_hook();
|
|
|
|
virtual switch_status_t run_dtmf_callback(void *input, switch_input_type_t itype);
|
|
void setInputCallback(PyObject *cbfunc, PyObject *funcargs = NULL);
|
|
void setHangupHook(PyObject *pyfunc, PyObject *arg = NULL);
|
|
bool ready();
|
|
|
|
PyObject *cb_function;
|
|
PyObject *cb_arg;
|
|
PyObject *hangup_func;
|
|
PyObject *hangup_func_arg;
|
|
|
|
/* keep a pointer to parent module, internal use only*/
|
|
void setPython(PyObject *state);
|
|
|
|
/* keeps the PyObject * version of the Session so it can be used as args to the callback */
|
|
void setSelf(PyObject *state);
|
|
|
|
};
|
|
}
|
|
#endif
|