2007-03-29 22:31:56 +00:00
|
|
|
#ifndef FREESWITCH_PYTHON_H
|
2006-12-21 17:11:43 +00:00
|
|
|
#define FREESWITCH_PYTHON_H
|
|
|
|
|
|
|
|
#include <Python.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2007-05-08 16:08:48 +00:00
|
|
|
#ifdef DOH
|
|
|
|
}
|
|
|
|
#endif
|
2006-12-21 17:11:43 +00:00
|
|
|
|
2007-06-01 18:50:34 +00:00
|
|
|
#include <switch_cpp.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-06-22 19:14:53 +00:00
|
|
|
typedef enum {
|
|
|
|
S_SWAPPED_IN = (1 << 0),
|
|
|
|
S_SWAPPED_OUT = (1 << 1)
|
|
|
|
} swap_state_t;
|
2006-12-21 17:11:43 +00:00
|
|
|
|
2007-05-08 16:08:48 +00:00
|
|
|
void console_log(char *level_str, char *msg);
|
|
|
|
void console_clean_log(char *msg);
|
|
|
|
char *api_execute(char *cmd, char *arg);
|
|
|
|
void api_reply_delete(char *reply);
|
|
|
|
|
2007-06-01 18:50:34 +00:00
|
|
|
class PySession : public CoreSession {
|
2007-05-08 16:08:48 +00:00
|
|
|
private:
|
2007-06-15 17:25:41 +00:00
|
|
|
void *threadState;
|
2007-06-22 19:14:53 +00:00
|
|
|
int swapstate;
|
2007-05-08 16:08:48 +00:00
|
|
|
public:
|
2007-06-20 08:56:34 +00:00
|
|
|
PySession();
|
|
|
|
PySession(char *uuid);
|
|
|
|
PySession(switch_core_session_t *session);
|
2007-06-15 17:25:41 +00:00
|
|
|
~PySession();
|
|
|
|
void setDTMFCallback(PyObject *pyfunc, char *funcargs);
|
2007-06-22 19:14:53 +00:00
|
|
|
void setHangupHook(PyObject *pyfunc);
|
|
|
|
void check_hangup_hook();
|
|
|
|
void hangup(char *cause);
|
|
|
|
bool begin_allow_threads();
|
|
|
|
bool end_allow_threads();
|
|
|
|
|
|
|
|
switch_status_t run_dtmf_callback(void *input,
|
|
|
|
switch_input_type_t itype);
|
2007-06-15 17:25:41 +00:00
|
|
|
|
2007-05-08 16:08:48 +00:00
|
|
|
};
|
2006-12-21 17:11:43 +00:00
|
|
|
|
2007-06-20 08:56:34 +00:00
|
|
|
|
2006-12-21 17:11:43 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|