mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-05 20:01:55 +00:00
change mod_python so freeswitch module is auto-loaded and session is auto declared
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5103 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -6,42 +6,46 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#ifdef DOH
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <switch.h>
|
||||
|
||||
extern switch_status_t PythonDTMFCallback(switch_core_session * session, void *input, switch_input_type_t itype, void *buf, unsigned int buflen);
|
||||
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);
|
||||
extern switch_status_t PythonDTMFCallback(switch_core_session * session, void *input, switch_input_type_t itype, void *buf, unsigned int buflen);
|
||||
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);
|
||||
|
||||
class SessionContainer {
|
||||
private:
|
||||
switch_core_session_t *session;
|
||||
switch_channel_t *channel;
|
||||
char *uuid;
|
||||
PyObject *dtmfCallbackFunction;
|
||||
char *tts_name;
|
||||
char *voice_name;
|
||||
public:
|
||||
SessionContainer(char *uuid);
|
||||
~SessionContainer();
|
||||
int answer();
|
||||
int pre_answer();
|
||||
void hangup(char *cause);
|
||||
void set_variable(char *var, char *val);
|
||||
void get_variable(char *var, char *val);
|
||||
int play_file(char *file, char *timer_name);
|
||||
void set_dtmf_callback(PyObject * pyfunc);
|
||||
int speak_text(char *text);
|
||||
void set_tts_parms(char *tts_name, char *voice_name);
|
||||
int get_digits(char *dtmf_buf, int len, char *terminators, char *terminator, int timeout);
|
||||
int transfer(char *extensions, char *dialplan, char *context);
|
||||
int play_and_get_digits(int min_digits, int max_digits, int max_tries, int timeout, char *terminators,
|
||||
char *audio_files, char *bad_input_audio_files, char *dtmf_buf, char *digits_regex);
|
||||
void execute(char *app, char *data);
|
||||
protected:
|
||||
};
|
||||
class SessionContainer {
|
||||
private:
|
||||
switch_core_session_t *session;
|
||||
switch_channel_t *channel;
|
||||
PyObject *dtmfCallbackFunction;
|
||||
char *tts_name;
|
||||
char *voice_name;
|
||||
public:
|
||||
SessionContainer(char *uuid);
|
||||
~SessionContainer();
|
||||
char *uuid;
|
||||
|
||||
int answer();
|
||||
int pre_answer();
|
||||
void hangup(char *cause);
|
||||
void set_variable(char *var, char *val);
|
||||
void get_variable(char *var, char *val);
|
||||
int play_file(char *file, char *timer_name);
|
||||
void set_dtmf_callback(PyObject * pyfunc);
|
||||
int speak_text(char *text);
|
||||
void set_tts_parms(char *tts_name, char *voice_name);
|
||||
int get_digits(char *dtmf_buf, int len, char *terminators, char *terminator, int timeout);
|
||||
int transfer(char *extensions, char *dialplan, char *context);
|
||||
int play_and_get_digits(int min_digits, int max_digits, int max_tries, int timeout, char *terminators,
|
||||
char *audio_files, char *bad_input_audio_files, char *dtmf_buf, char *digits_regex);
|
||||
void execute(char *app, char *data);
|
||||
protected:
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user