git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4798 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale committed 2007-03-30 00:13:31 +00:00
1 parent 643ca5c4e7
commit debdfb1aab
139 files changed
+2075 -3970

No files matched your search

+5 -10
View File
@@ -48,8 +48,7 @@ switch_status_t mod_mono_load_modules(const char *module_dir);
MonoClass *mod_mono_find_assembly_class(MonoImage * image);
/* Managed functions */
void mod_mono_switch_console_printf(switch_text_channel_t channel, char *file, const char *func, int line, char *fmt,
char *msg);
void mod_mono_switch_console_printf(switch_text_channel_t channel, char *file, const char *func, int line, char *fmt, char *msg);
static const char modname[] = "mod_mono";
static switch_memory_pool_t *mono_pool = NULL;
@@ -75,8 +74,7 @@ static switch_loadable_module_interface_t mono_module_interface = {
* This function will initialise the memory pool and plugin hash for this module,
* it will then initialise a new mono domain.
*/
SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **interface,
char *filename)
SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **interface, char *filename)
{
*interface = &mono_module_interface;
@@ -101,8 +99,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_mod
apr_finfo_t *assembly_finfo = (apr_finfo_t *) switch_core_alloc(mono_pool, sizeof(*assembly_finfo));
snprintf(assembly_dir, assembly_dir_len, "%s/%s", SWITCH_GLOBAL_dirs.base_dir, SWITCH_MONO_LIBDIR);
snprintf(assembly_file, assembly_file_len, "%s/%s%s", SWITCH_GLOBAL_dirs.base_dir, SWITCH_MONO_LIBDIR,
SWITCH_MONO_ASSEMBLY);
snprintf(assembly_file, assembly_file_len, "%s/%s%s", SWITCH_GLOBAL_dirs.base_dir, SWITCH_MONO_LIBDIR, SWITCH_MONO_ASSEMBLY);
if (apr_stat(assembly_finfo, assembly_file, 0, mono_pool) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Could not find FreeSwitch.NET assembly\n");
@@ -247,8 +244,7 @@ switch_status_t mod_mono_load_modules(const char *module_dir)
plugin->object = mono_object_new(globals.domain, plugin->class);
switch_core_hash_insert(globals.plugins, (char *) mono_image_get_name(mono_assembly_get_image(assembly)),
plugin);
switch_core_hash_insert(globals.plugins, (char *) mono_image_get_name(mono_assembly_get_image(assembly)), plugin);
plugin = NULL;
}
@@ -280,8 +276,7 @@ MonoClass *mod_mono_find_assembly_class(MonoImage * image)
/*
*
*/
void mono_switch_console_printf(switch_text_channel_t channel, char *file, const char *func, int line, char *fmt,
char *msg)
void mono_switch_console_printf(switch_text_channel_t channel, char *file, const char *func, int line, char *fmt, char *msg)
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, msg);
}
+2 -4
View File
@@ -68,8 +68,7 @@ static void perl_function(switch_core_session_t *session, char *data)
char *uuid = switch_core_session_get_uuid(session);
char code[1024];
PerlInterpreter *my_perl = clone_perl();
sprintf(code, "package fs_perl;\n"
"$SWITCH_ENV{UUID} = \"%s\";\n" "chdir(\"%s/perl\");\n", uuid, SWITCH_GLOBAL_dirs.base_dir);
sprintf(code, "package fs_perl;\n" "$SWITCH_ENV{UUID} = \"%s\";\n" "chdir(\"%s/perl\");\n", uuid, SWITCH_GLOBAL_dirs.base_dir);
Perl_eval_pv(my_perl, code, TRUE);
@@ -112,8 +111,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
return SWITCH_STATUS_SUCCESS;
}
SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface,
char *filename)
SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
{
PerlInterpreter *my_perl;
+23 -46
View File
@@ -468,8 +468,7 @@ extern "C" {
if (s->next) {
s->next->prev = s->prev;
}
/* Insert s as second element in the list */
s-> next = ty->next;
/* Insert s as second element in the list */ s->next = ty->next;
if (ty->next)
ty->next->prev = s;
ty->next = s;
@@ -689,14 +688,12 @@ typedef struct {
static void _swig_create_magic(SV * sv, char *name, int (*set) (SV *, MAGIC *), int (*get) (SV *, MAGIC *))
{
#else
static void _swig_create_magic(SV * sv, char *name, int (*set) (struct interpreter *, SV *, MAGIC *),
int (*get) (struct interpreter *, SV *, MAGIC *))
static void _swig_create_magic(SV * sv, char *name, int (*set) (struct interpreter *, SV *, MAGIC *), int (*get) (struct interpreter *, SV *, MAGIC *))
{
#endif
#else
# define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c)
static void _swig_create_magic(CPerlObj * pPerl, SV * sv, const char *name, int (CPerlObj::*set) (SV *, MAGIC *),
int (CPerlObj::*get) (SV *, MAGIC *))
static void _swig_create_magic(CPerlObj * pPerl, SV * sv, const char *name, int (CPerlObj::*set) (SV *, MAGIC *), int (CPerlObj::*get) (SV *, MAGIC *))
{
#endif
MAGIC *mg;
@@ -821,10 +818,8 @@ SWIGEXPORT(void) SWIG_init(CV * cv, CPerlObj *);
switch_input_callback_function_t, void *, unsigned int, unsigned int);
extern int fs_switch_ivr_sleep(switch_core_session_t *, uint32_t);
extern int fs_ivr_play_file2(switch_core_session_t *, char *);
extern int fs_switch_ivr_collect_digits_callback(switch_core_session_t *, switch_input_callback_function_t, void *,
unsigned int, unsigned int);
extern int fs_switch_ivr_collect_digits_count(switch_core_session_t *, char *, unsigned int, unsigned int,
char const *, char *, unsigned int);
extern int fs_switch_ivr_collect_digits_callback(switch_core_session_t *, switch_input_callback_function_t, void *, unsigned int, unsigned int);
extern int fs_switch_ivr_collect_digits_count(switch_core_session_t *, char *, unsigned int, unsigned int, char const *, char *, unsigned int);
extern int fs_switch_ivr_originate(switch_core_session_t *, switch_core_session_t **, char *, uint32_t);
extern int fs_switch_ivr_session_transfer(switch_core_session_t *, char *, char *, char *);
extern int fs_switch_ivr_speak_text(switch_core_session_t *, char *, char *, uint32_t, char *);
@@ -1157,8 +1152,7 @@ extern "C" {
}
{
if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 0) < 0) {
SWIG_croak
("Type error in argument 1 of fs_channel_set_variable. Expected _p_switch_core_session_t");
SWIG_croak("Type error in argument 1 of fs_channel_set_variable. Expected _p_switch_core_session_t");
}
}
if (!SvOK((SV *) ST(1)))
@@ -1192,8 +1186,7 @@ extern "C" {
}
{
if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 0) < 0) {
SWIG_croak
("Type error in argument 1 of fs_channel_get_variable. Expected _p_switch_core_session_t");
SWIG_croak("Type error in argument 1 of fs_channel_get_variable. Expected _p_switch_core_session_t");
}
}
if (!SvOK((SV *) ST(1)))
@@ -1291,14 +1284,12 @@ extern "C" {
}
{
if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 0) < 0) {
SWIG_croak
("Type error in argument 1 of fs_switch_ivr_record_file. Expected _p_switch_core_session_t");
SWIG_croak("Type error in argument 1 of fs_switch_ivr_record_file. Expected _p_switch_core_session_t");
}
}
{
if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_switch_file_handle_t, 0) < 0) {
SWIG_croak
("Type error in argument 2 of fs_switch_ivr_record_file. Expected _p_switch_file_handle_t");
SWIG_croak("Type error in argument 2 of fs_switch_ivr_record_file. Expected _p_switch_file_handle_t");
}
}
if (!SvOK((SV *) ST(2)))
@@ -1308,8 +1299,7 @@ extern "C" {
{
switch_input_callback_function_t *argp;
if (SWIG_ConvertPtr(ST(3), (void **) &argp, SWIGTYPE_p_switch_input_callback_function_t, 0) < 0) {
SWIG_croak
("Type error in argument 4 of fs_switch_ivr_record_file. Expected _p_switch_input_callback_function_t");
SWIG_croak("Type error in argument 4 of fs_switch_ivr_record_file. Expected _p_switch_input_callback_function_t");
}
arg4 = *argp;
}
@@ -1415,15 +1405,13 @@ extern "C" {
}
{
if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 0) < 0) {
SWIG_croak
("Type error in argument 1 of fs_switch_ivr_collect_digits_callback. Expected _p_switch_core_session_t");
SWIG_croak("Type error in argument 1 of fs_switch_ivr_collect_digits_callback. Expected _p_switch_core_session_t");
}
}
{
switch_input_callback_function_t *argp;
if (SWIG_ConvertPtr(ST(1), (void **) &argp, SWIGTYPE_p_switch_input_callback_function_t, 0) < 0) {
SWIG_croak
("Type error in argument 2 of fs_switch_ivr_collect_digits_callback. Expected _p_switch_input_callback_function_t");
SWIG_croak("Type error in argument 2 of fs_switch_ivr_collect_digits_callback. Expected _p_switch_input_callback_function_t");
}
arg2 = *argp;
}
@@ -1460,13 +1448,11 @@ extern "C" {
dXSARGS;
if ((items < 7) || (items > 7)) {
SWIG_croak
("Usage: fs_switch_ivr_collect_digits_count(session,buf,buflen,maxdigits,terminators,terminator,timeout);");
SWIG_croak("Usage: fs_switch_ivr_collect_digits_count(session,buf,buflen,maxdigits,terminators,terminator,timeout);");
}
{
if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 0) < 0) {
SWIG_croak
("Type error in argument 1 of fs_switch_ivr_collect_digits_count. Expected _p_switch_core_session_t");
SWIG_croak("Type error in argument 1 of fs_switch_ivr_collect_digits_count. Expected _p_switch_core_session_t");
}
}
if (!SvOK((SV *) ST(1)))
@@ -1511,14 +1497,12 @@ extern "C" {
}
{
if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 0) < 0) {
SWIG_croak
("Type error in argument 1 of fs_switch_ivr_originate. Expected _p_switch_core_session_t");
SWIG_croak("Type error in argument 1 of fs_switch_ivr_originate. Expected _p_switch_core_session_t");
}
}
{
if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_p_switch_core_session_t, 0) < 0) {
SWIG_croak
("Type error in argument 2 of fs_switch_ivr_originate. Expected _p_p_switch_core_session_t");
SWIG_croak("Type error in argument 2 of fs_switch_ivr_originate. Expected _p_p_switch_core_session_t");
}
}
if (!SvOK((SV *) ST(2)))
@@ -1559,8 +1543,7 @@ extern "C" {
}
{
if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 0) < 0) {
SWIG_croak
("Type error in argument 1 of fs_switch_ivr_session_transfer. Expected _p_switch_core_session_t");
SWIG_croak("Type error in argument 1 of fs_switch_ivr_session_transfer. Expected _p_switch_core_session_t");
}
}
if (!SvOK((SV *) ST(1)))
@@ -1603,8 +1586,7 @@ extern "C" {
}
{
if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 0) < 0) {
SWIG_croak
("Type error in argument 1 of fs_switch_ivr_speak_text. Expected _p_switch_core_session_t");
SWIG_croak("Type error in argument 1 of fs_switch_ivr_speak_text. Expected _p_switch_core_session_t");
}
}
if (!SvOK((SV *) ST(1)))
@@ -1651,8 +1633,7 @@ extern "C" {
}
{
if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_switch_channel_t, 0) < 0) {
SWIG_croak
("Type error in argument 1 of fs_switch_channel_get_variable. Expected _p_switch_channel_t");
SWIG_croak("Type error in argument 1 of fs_switch_channel_get_variable. Expected _p_switch_channel_t");
}
}
if (!SvOK((SV *) ST(1)))
@@ -1689,8 +1670,7 @@ extern "C" {
}
{
if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_switch_channel_t, 0) < 0) {
SWIG_croak
("Type error in argument 1 of fs_switch_channel_set_variable. Expected _p_switch_channel_t");
SWIG_croak("Type error in argument 1 of fs_switch_channel_set_variable. Expected _p_switch_channel_t");
}
}
if (!SvOK((SV *) ST(1)))
@@ -1716,17 +1696,14 @@ extern "C" {
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
static swig_type_info _swigt__p_switch_channel_t[] =
{ {"_p_switch_channel_t", 0, "switch_channel_t *", 0}, {"_p_switch_channel_t"}, {0} };
static swig_type_info _swigt__p_switch_file_handle_t[] =
{ {"_p_switch_file_handle_t", 0, "switch_file_handle_t *", 0}, {"_p_switch_file_handle_t"}, {0} };
static swig_type_info _swigt__p_switch_channel_t[] = { {"_p_switch_channel_t", 0, "switch_channel_t *", 0}, {"_p_switch_channel_t"}, {0} };
static swig_type_info _swigt__p_switch_file_handle_t[] = { {"_p_switch_file_handle_t", 0, "switch_file_handle_t *", 0}, {"_p_switch_file_handle_t"}, {0} };
static swig_type_info _swigt__p_switch_core_session_t[] =
{ {"_p_switch_core_session_t", 0, "switch_core_session_t *", 0}, {"_p_switch_core_session_t"}, {0} };
static swig_type_info _swigt__p_p_switch_core_session_t[] =
{ {"_p_p_switch_core_session_t", 0, "switch_core_session_t **", 0}, {"_p_p_switch_core_session_t"}, {0} };
static swig_type_info _swigt__p_uint32_t[] = { {"_p_uint32_t", 0, "uint32_t *", 0}, {"_p_uint32_t"}, {0} };
static swig_type_info _swigt__p_switch_input_callback_function_t[] =
{ {"_p_switch_input_callback_function_t", 0, "switch_input_callback_function_t *", 0},
static swig_type_info _swigt__p_switch_input_callback_function_t[] = { {"_p_switch_input_callback_function_t", 0, "switch_input_callback_function_t *", 0},
{"_p_switch_input_callback_function_t"}, {0}
};
@@ -10,8 +10,7 @@ extern "C" {
#include <switch.h>
extern void *globalDTMFCallbackFunction;
extern switch_status_t PythonDTMFCallback(switch_core_session * session,
void *input, switch_input_type_t itype, void *buf, unsigned int buflen);
extern switch_status_t PythonDTMFCallback(switch_core_session * session, void *input, switch_input_type_t itype, void *buf, unsigned int buflen);
class SessionContainer {
private:
+1 -2
View File
@@ -114,8 +114,7 @@ static switch_loadable_module_interface_t python_module_interface = {
/*.directory_interface */ NULL
};
SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface,
char *filename)
SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
{
/* connect my internal structure to the blank pointer passed to me */
*module_interface = &python_module_interface;
+31 -61
View File
@@ -329,8 +329,7 @@ extern "C" {
Note: if start == end at the beginning of the function, we go all the way around
the circular list.
*/
SWIGRUNTIME swig_type_info *SWIG_MangledTypeQueryModule(swig_module_info * start,
swig_module_info * end, const char *name) {
SWIGRUNTIME swig_type_info *SWIG_MangledTypeQueryModule(swig_module_info * start, swig_module_info * end, const char *name) {
swig_module_info *iter = start;
do {
if (iter->size) {
@@ -572,7 +571,7 @@ extern "C" {
* type checking.
*
* Author : David Beazley (beazley@cs.uchicago.edu)
************************************************************************//* Common SWIG API */
************************************************************************//* Common SWIG API */
#define SWIG_ConvertPtr(obj, pp, type, flags) SWIG_Python_ConvertPtr(obj, pp, type, flags)
#define SWIG_NewPointerObj(p, type, flags) SWIG_Python_NewPointerObj(p, type, flags)
#define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags)
@@ -584,11 +583,11 @@ extern "C" {
#define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer)
/* -----------------------------------------------------------------------------
* Pointer declarations
* ----------------------------------------------------------------------------- *//*
Use SWIG_NO_COBJECT_TYPES to force the use of strings to represent
C/C++ pointers in the python side. Very useful for debugging, but
not always safe.
*/
* ----------------------------------------------------------------------------- *//*
Use SWIG_NO_COBJECT_TYPES to force the use of strings to represent
C/C++ pointers in the python side. Very useful for debugging, but
not always safe.
*/
#if !defined(SWIG_NO_COBJECT_TYPES) && !defined(SWIG_COBJECT_TYPES)
# define SWIG_COBJECT_TYPES
#endif
@@ -652,8 +651,7 @@ extern "C" {
SWIGRUNTIME PyObject *PySwigObject_repr(PySwigObject * v) {
char result[SWIG_BUFFER_SIZE];
return SWIG_PackVoidPtr(result, v->ptr, v->desc, sizeof(result)) ?
PyString_FromFormat("<Swig Object at %s>", result) : 0;
return SWIG_PackVoidPtr(result, v->ptr, v->desc, sizeof(result)) ? PyString_FromFormat("<Swig Object at %s>", result) : 0;
}
SWIGRUNTIME PyObject *PySwigObject_str(PySwigObject * v) {
@@ -1283,8 +1281,7 @@ extern "C" {
#ifdef SWIG_LINK_RUNTIME
type_pointer = SWIG_ReturnGlobalTypeList((void *) 0);
#else
type_pointer = PyCObject_Import((char *) "swig_runtime_data" SWIG_RUNTIME_VERSION,
(char *) "type_pointer" SWIG_TYPE_TABLE_NAME);
type_pointer = PyCObject_Import((char *) "swig_runtime_data" SWIG_RUNTIME_VERSION, (char *) "type_pointer" SWIG_TYPE_TABLE_NAME);
if (PyErr_Occurred()) {
PyErr_Clear();
type_pointer = (void *) 0;
@@ -1541,8 +1538,7 @@ extern "C" {
resultobj = Py_None;
return resultobj;
fail:return NULL;
}
static PyObject *_wrap_fs_core_init(PyObject * self, PyObject * args) {
} static PyObject *_wrap_fs_core_init(PyObject * self, PyObject * args) {
PyObject *resultobj = NULL;
char *arg1 = (char *) 0;
int result;
@@ -1883,8 +1879,7 @@ extern "C" {
}
{
switch_input_callback_function_t *argp;
SWIG_Python_ConvertPtr(obj3, (void **) &argp, SWIGTYPE_p_switch_input_callback_function_t,
SWIG_POINTER_EXCEPTION);
SWIG_Python_ConvertPtr(obj3, (void **) &argp, SWIGTYPE_p_switch_input_callback_function_t, SWIG_POINTER_EXCEPTION);
if (SWIG_arg_fail(4))
SWIG_fail;
if (argp == NULL) {
@@ -1932,8 +1927,7 @@ extern "C" {
PyObject *obj4 = 0;
PyObject *obj5 = 0;
if (!PyArg_ParseTuple
(args, (char *) "OOOOOO:fs_switch_ivr_record_file", &obj0, &obj1, &obj2, &obj3, &obj4, &obj5))
if (!PyArg_ParseTuple(args, (char *) "OOOOOO:fs_switch_ivr_record_file", &obj0, &obj1, &obj2, &obj3, &obj4, &obj5))
goto fail;
SWIG_Python_ConvertPtr(obj0, (void **) &arg1, SWIGTYPE_p_switch_core_session_t, SWIG_POINTER_EXCEPTION | 0);
if (SWIG_arg_fail(1))
@@ -1947,8 +1941,7 @@ extern "C" {
}
{
switch_input_callback_function_t *argp;
SWIG_Python_ConvertPtr(obj3, (void **) &argp, SWIGTYPE_p_switch_input_callback_function_t,
SWIG_POINTER_EXCEPTION);
SWIG_Python_ConvertPtr(obj3, (void **) &argp, SWIGTYPE_p_switch_input_callback_function_t, SWIG_POINTER_EXCEPTION);
if (SWIG_arg_fail(4))
SWIG_fail;
if (argp == NULL) {
@@ -2051,16 +2044,14 @@ extern "C" {
PyObject *obj3 = 0;
PyObject *obj4 = 0;
if (!PyArg_ParseTuple
(args, (char *) "OOOOO:fs_switch_ivr_collect_digits_callback", &obj0, &obj1, &obj2, &obj3, &obj4))
if (!PyArg_ParseTuple(args, (char *) "OOOOO:fs_switch_ivr_collect_digits_callback", &obj0, &obj1, &obj2, &obj3, &obj4))
goto fail;
SWIG_Python_ConvertPtr(obj0, (void **) &arg1, SWIGTYPE_p_switch_core_session_t, SWIG_POINTER_EXCEPTION | 0);
if (SWIG_arg_fail(1))
SWIG_fail;
{
switch_input_callback_function_t *argp;
SWIG_Python_ConvertPtr(obj1, (void **) &argp, SWIGTYPE_p_switch_input_callback_function_t,
SWIG_POINTER_EXCEPTION);
SWIG_Python_ConvertPtr(obj1, (void **) &argp, SWIGTYPE_p_switch_input_callback_function_t, SWIG_POINTER_EXCEPTION);
if (SWIG_arg_fail(2))
SWIG_fail;
if (argp == NULL) {
@@ -2115,9 +2106,7 @@ extern "C" {
PyObject *obj5 = 0;
PyObject *obj6 = 0;
if (!PyArg_ParseTuple
(args, (char *) "OOOOOOO:fs_switch_ivr_collect_digits_count", &obj0, &obj1, &obj2, &obj3, &obj4, &obj5,
&obj6))
if (!PyArg_ParseTuple(args, (char *) "OOOOOOO:fs_switch_ivr_collect_digits_count", &obj0, &obj1, &obj2, &obj3, &obj4, &obj5, &obj6))
goto fail;
SWIG_Python_ConvertPtr(obj0, (void **) &arg1, SWIGTYPE_p_switch_core_session_t, SWIG_POINTER_EXCEPTION | 0);
if (SWIG_arg_fail(1))
@@ -2262,9 +2251,7 @@ extern "C" {
PyObject *obj7 = 0;
PyObject *obj8 = 0;
if (!PyArg_ParseTuple
(args, (char *) "OOOOOOOOO:fs_switch_ivr_speak_text", &obj0, &obj1, &obj2, &obj3, &obj4, &obj5, &obj6,
&obj7, &obj8))
if (!PyArg_ParseTuple(args, (char *) "OOOOOOOOO:fs_switch_ivr_speak_text", &obj0, &obj1, &obj2, &obj3, &obj4, &obj5, &obj6, &obj7, &obj8))
goto fail;
SWIG_Python_ConvertPtr(obj0, (void **) &arg1, SWIGTYPE_p_switch_core_session_t, SWIG_POINTER_EXCEPTION | 0);
if (SWIG_arg_fail(1))
@@ -2288,8 +2275,7 @@ extern "C" {
}
{
switch_input_callback_function_t *argp;
SWIG_Python_ConvertPtr(obj5, (void **) &argp, SWIGTYPE_p_switch_input_callback_function_t,
SWIG_POINTER_EXCEPTION);
SWIG_Python_ConvertPtr(obj5, (void **) &argp, SWIGTYPE_p_switch_input_callback_function_t, SWIG_POINTER_EXCEPTION);
if (SWIG_arg_fail(6))
SWIG_fail;
if (argp == NULL) {
@@ -2461,17 +2447,12 @@ extern "C" {
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
static swig_type_info _swigt__p_char = { "_p_char", "char *", 0, 0, 0 };
static swig_type_info _swigt__p_p_switch_core_session_t =
{ "_p_p_switch_core_session_t", "switch_core_session_t **", 0, 0, 0 };
static swig_type_info _swigt__p_switch_channel_state_t =
{ "_p_switch_channel_state_t", "enum switch_channel_state_t *|switch_channel_state_t *", 0, 0, 0 };
static swig_type_info _swigt__p_p_switch_core_session_t = { "_p_p_switch_core_session_t", "switch_core_session_t **", 0, 0, 0 };
static swig_type_info _swigt__p_switch_channel_state_t = { "_p_switch_channel_state_t", "enum switch_channel_state_t *|switch_channel_state_t *", 0, 0, 0 };
static swig_type_info _swigt__p_switch_channel_t = { "_p_switch_channel_t", "switch_channel_t *", 0, 0, 0 };
static swig_type_info _swigt__p_switch_core_session_t =
{ "_p_switch_core_session_t", "switch_core_session_t *", 0, 0, 0 };
static swig_type_info _swigt__p_switch_file_handle_t =
{ "_p_switch_file_handle_t", "switch_file_handle_t *", 0, 0, 0 };
static swig_type_info _swigt__p_switch_input_callback_function_t =
{ "_p_switch_input_callback_function_t", "switch_input_callback_function_t *", 0, 0, 0 };
static swig_type_info _swigt__p_switch_core_session_t = { "_p_switch_core_session_t", "switch_core_session_t *", 0, 0, 0 };
static swig_type_info _swigt__p_switch_file_handle_t = { "_p_switch_file_handle_t", "switch_file_handle_t *", 0, 0, 0 };
static swig_type_info _swigt__p_switch_input_callback_function_t = { "_p_switch_input_callback_function_t", "switch_input_callback_function_t *", 0, 0, 0 };
static swig_type_info _swigt__ptrdiff_t = { "_ptrdiff_t", "ptrdiff_t", 0, 0, 0 };
static swig_type_info _swigt__size_t = { "_size_t", "size_t", 0, 0, 0 };
@@ -2488,17 +2469,12 @@ extern "C" {
};
static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0}, {0, 0, 0, 0} };
static swig_cast_info _swigc__p_p_switch_core_session_t[] =
{ {&_swigt__p_p_switch_core_session_t, 0, 0, 0}, {0, 0, 0, 0} };
static swig_cast_info _swigc__p_switch_channel_state_t[] =
{ {&_swigt__p_switch_channel_state_t, 0, 0, 0}, {0, 0, 0, 0} };
static swig_cast_info _swigc__p_p_switch_core_session_t[] = { {&_swigt__p_p_switch_core_session_t, 0, 0, 0}, {0, 0, 0, 0} };
static swig_cast_info _swigc__p_switch_channel_state_t[] = { {&_swigt__p_switch_channel_state_t, 0, 0, 0}, {0, 0, 0, 0} };
static swig_cast_info _swigc__p_switch_channel_t[] = { {&_swigt__p_switch_channel_t, 0, 0, 0}, {0, 0, 0, 0} };
static swig_cast_info _swigc__p_switch_core_session_t[] =
{ {&_swigt__p_switch_core_session_t, 0, 0, 0}, {0, 0, 0, 0} };
static swig_cast_info _swigc__p_switch_file_handle_t[] =
{ {&_swigt__p_switch_file_handle_t, 0, 0, 0}, {0, 0, 0, 0} };
static swig_cast_info _swigc__p_switch_input_callback_function_t[] =
{ {&_swigt__p_switch_input_callback_function_t, 0, 0, 0}, {0, 0, 0, 0} };
static swig_cast_info _swigc__p_switch_core_session_t[] = { {&_swigt__p_switch_core_session_t, 0, 0, 0}, {0, 0, 0, 0} };
static swig_cast_info _swigc__p_switch_file_handle_t[] = { {&_swigt__p_switch_file_handle_t, 0, 0, 0}, {0, 0, 0, 0} };
static swig_cast_info _swigc__p_switch_input_callback_function_t[] = { {&_swigt__p_switch_input_callback_function_t, 0, 0, 0}, {0, 0, 0, 0} };
static swig_cast_info _swigc__ptrdiff_t[] = { {&_swigt__ptrdiff_t, 0, 0, 0}, {0, 0, 0, 0} };
static swig_cast_info _swigc__size_t[] = { {&_swigt__size_t, 0, 0, 0}, {0, 0, 0, 0} };
@@ -2704,8 +2680,7 @@ extern "C" {
SWIGINTERN PyObject *swig_varlink_repr(swig_varlinkobject * v) {
v = v;
return PyString_FromString("<Swig global variables>");
}
SWIGINTERN int swig_varlink_print(swig_varlinkobject * v, FILE * fp, int flags) {
} SWIGINTERN int swig_varlink_print(swig_varlinkobject * v, FILE * fp, int flags) {
swig_globalvar *var;
flags = flags;
fprintf(fp, "Swig global variables { ");
@@ -2809,9 +2784,7 @@ extern "C" {
return ((PyObject *) result);
}
SWIGINTERN void
SWIG_Python_addvarlink(PyObject * p, char *name, PyObject * (*get_attr) (void),
int (*set_attr) (PyObject * p)) {
SWIGINTERN void SWIG_Python_addvarlink(PyObject * p, char *name, PyObject * (*get_attr) (void), int (*set_attr) (PyObject * p)) {
swig_varlinkobject *v = (swig_varlinkobject *) p;
swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
if (gv) {
@@ -2872,10 +2845,7 @@ extern "C" {
/* Fix SwigMethods to carry the callback ptrs when needed */
/* ----------------------------------------------------------------------------- */
SWIGINTERN void
SWIG_Python_FixMethods(PyMethodDef * methods,
swig_const_info * const_table,
swig_type_info ** types, swig_type_info ** types_initial) {
SWIGINTERN void SWIG_Python_FixMethods(PyMethodDef * methods, swig_const_info * const_table, swig_type_info ** types, swig_type_info ** types_initial) {
size_t i;
for (i = 0; methods[i].ml_name; ++i) {
char *c = methods[i].ml_doc;
@@ -614,8 +614,7 @@ JSObject *new_js_event(switch_event_t *event, char *name, JSContext * cx, JSObje
eo->event = event;
eo->freed = 1;
if ((Event = JS_DefineObject(cx, obj, name, &event_class, NULL, 0))) {
if ((JS_SetPrivate(cx, Event, eo) &&
JS_DefineProperties(cx, Event, event_props) && JS_DefineFunctions(cx, Event, event_methods))) {
if ((JS_SetPrivate(cx, Event, eo) && JS_DefineProperties(cx, Event, event_props) && JS_DefineFunctions(cx, Event, event_methods))) {
}
}
}
@@ -623,8 +622,7 @@ JSObject *new_js_event(switch_event_t *event, char *name, JSContext * cx, JSObje
}
static switch_status_t js_common_callback(switch_core_session_t *session, void *input, switch_input_type_t itype,
void *buf, unsigned int buflen)
static switch_status_t js_common_callback(switch_core_session_t *session, void *input, switch_input_type_t itype, void *buf, unsigned int buflen)
{
char *dtmf = NULL;
switch_event_t *event = NULL;
@@ -635,8 +633,7 @@ static switch_status_t js_common_callback(switch_core_session_t *session, void *
JSObject *Event = NULL;
if (!jss || !jss->session) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
"You must call the session.originate method before calling this method!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
return SWITCH_STATUS_FALSE;
}
@@ -670,8 +667,7 @@ static switch_status_t js_common_callback(switch_core_session_t *session, void *
return SWITCH_STATUS_SUCCESS;
}
static switch_status_t js_stream_input_callback(switch_core_session_t *session, void *input, switch_input_type_t itype,
void *buf, unsigned int buflen)
static switch_status_t js_stream_input_callback(switch_core_session_t *session, void *input, switch_input_type_t itype, void *buf, unsigned int buflen)
{
char *ret;
switch_status_t status;
@@ -756,8 +752,7 @@ static switch_status_t js_stream_input_callback(switch_core_session_t *session,
return SWITCH_STATUS_SUCCESS;
}
static switch_status_t js_record_input_callback(switch_core_session_t *session, void *input, switch_input_type_t itype,
void *buf, unsigned int buflen)
static switch_status_t js_record_input_callback(switch_core_session_t *session, void *input, switch_input_type_t itype, void *buf, unsigned int buflen)
{
char *ret;
switch_status_t status;
@@ -794,8 +789,7 @@ static switch_status_t js_record_input_callback(switch_core_session_t *session,
return SWITCH_STATUS_SUCCESS;
}
static switch_status_t js_collect_input_callback(switch_core_session_t *session, void *input, switch_input_type_t itype,
void *buf, unsigned int buflen)
static switch_status_t js_collect_input_callback(switch_core_session_t *session, void *input, switch_input_type_t itype, void *buf, unsigned int buflen)
{
char *ret;
switch_status_t status;
@@ -822,8 +816,7 @@ static JSBool session_flush_digits(JSContext * cx, JSObject * obj, uintN argc, j
switch_channel_t *channel;
if (!jss || !jss->session) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
"You must call the session.originate method before calling this method!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
return JS_TRUE;
}
@@ -878,8 +871,7 @@ static JSBool session_recordfile(JSContext * cx, JSObject * obj, uintN argc, jsv
switch_input_args_t args = { 0 };
if (!jss || !jss->session) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
"You must call the session.originate method before calling this method!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
return JS_TRUE;
}
@@ -962,8 +954,7 @@ static JSBool session_collect_input(JSContext * cx, JSObject * obj, uintN argc,
if (!jss || !jss->session) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
"You must call the session.originate method before calling this method!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
return JS_TRUE;
}
@@ -1030,8 +1021,7 @@ static JSBool session_sayphrase(JSContext * cx, JSObject * obj, uintN argc, jsva
switch_input_args_t args = { 0 };
if (!jss || !jss->session) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
"You must call the session.originate method before calling this method!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
return JS_TRUE;
}
@@ -1161,8 +1151,7 @@ static JSBool session_streamfile(JSContext * cx, JSObject * obj, uintN argc, jsv
switch_input_args_t args = { 0 };
if (!jss || !jss->session) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
"You must call the session.originate method before calling this method!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
return JS_TRUE;
}
@@ -1227,8 +1216,7 @@ static JSBool session_set_variable(JSContext * cx, JSObject * obj, uintN argc, j
switch_channel_t *channel;
if (!jss || !jss->session) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
"You must call the session.originate method before calling this method!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
return JS_TRUE;
}
@@ -1298,8 +1286,7 @@ static JSBool session_speak(JSContext * cx, JSObject * obj, uintN argc, jsval *
switch_input_args_t args = { 0 };
if (!jss || !jss->session) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
"You must call the session.originate method before calling this method!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
return JS_TRUE;
}
@@ -1350,10 +1337,7 @@ static JSBool session_speak(JSContext * cx, JSObject * obj, uintN argc, jsval *
args.input_callback = dtmf_func;
args.buf = bp;
args.buflen = len;
switch_ivr_speak_text(jss->session,
tts_name,
voice_name && strlen(voice_name) ? voice_name : NULL,
codec->implementation->samples_per_second, text, &args);
switch_ivr_speak_text(jss->session, tts_name, voice_name && strlen(voice_name) ? voice_name : NULL, codec->implementation->samples_per_second, text, &args);
JS_ResumeRequest(cx, cb_state.saveDepth);
*rval = cb_state.ret;
@@ -1369,8 +1353,7 @@ static JSBool session_get_digits(JSContext * cx, JSObject * obj, uintN argc, jsv
switch_channel_t *channel;
if (!jss || !jss->session) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
"You must call the session.originate method before calling this method!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
return JS_TRUE;
}
@@ -1390,8 +1373,7 @@ static JSBool session_get_digits(JSContext * cx, JSObject * obj, uintN argc, jsv
JS_ValueToInt32(cx, argv[0], &digits);
if (digits > sizeof(buf) - 1) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Exceeded max digits of %" SWITCH_SIZE_T_FMT "\n",
sizeof(buf) - 1);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Exceeded max digits of %" SWITCH_SIZE_T_FMT "\n", sizeof(buf) - 1);
return JS_FALSE;
}
@@ -1417,8 +1399,7 @@ static JSBool session_autohangup(JSContext * cx, JSObject * obj, uintN argc, jsv
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
if (!jss || !jss->session) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
"You must call the session.originate method before calling this method!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
return JS_TRUE;
}
@@ -1443,8 +1424,7 @@ static JSBool session_answer(JSContext * cx, JSObject * obj, uintN argc, jsval *
switch_channel_t *channel;
if (!jss || !jss->session) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
"You must call the session.originate method before calling this method!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
return JS_TRUE;
}
@@ -1473,8 +1453,7 @@ static JSBool session_cdr(JSContext * cx, JSObject * obj, uintN argc, jsval * ar
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
if (!jss || !jss->session) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
"You must call the session.originate method before calling this method!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
return JS_TRUE;
}
@@ -1496,8 +1475,7 @@ static JSBool session_ready(JSContext * cx, JSObject * obj, uintN argc, jsval *
switch_channel_t *channel;
if (!jss || !jss->session) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
"You must call the session.originate method before calling this method!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
return JS_TRUE;
}
@@ -1521,8 +1499,7 @@ static JSBool session_wait_for_media(JSContext * cx, JSObject * obj, uintN argc,
int32 timeout = 60;
if (!jss || !jss->session) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
"You must call the session.originate method before calling this method!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
return JS_TRUE;
}
@@ -1565,8 +1542,7 @@ static JSBool session_wait_for_answer(JSContext * cx, JSObject * obj, uintN argc
int32 timeout = 60;
if (!jss || !jss->session) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
"You must call the session.originate method before calling this method!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
return JS_TRUE;
}
@@ -1605,8 +1581,7 @@ static JSBool session_execute(JSContext * cx, JSObject * obj, uintN argc, jsval
struct js_session *jss = JS_GetPrivate(cx, obj);
if (!jss || !jss->session) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
"You must call the session.originate method before calling this method!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
return JS_TRUE;
}
@@ -1629,8 +1604,7 @@ static JSBool session_execute(JSContext * cx, JSObject * obj, uintN argc, jsval
jsrefcount saveDepth;
if (!jss || !jss->session) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
"You must call the session.originate method before calling this method!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
return JS_TRUE;
}
@@ -1655,8 +1629,7 @@ static JSBool session_get_event(JSContext * cx, JSObject * obj, uintN argc, jsva
switch_event_t *event;
if (!jss || !jss->session) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
"You must call the session.originate method before calling this method!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
return JS_TRUE;
}
@@ -1670,8 +1643,7 @@ static JSBool session_get_event(JSContext * cx, JSObject * obj, uintN argc, jsva
eo->freed = 0;
if ((Event = JS_DefineObject(cx, obj, "__event__", &event_class, NULL, 0))) {
if ((JS_SetPrivate(cx, Event, eo) &&
JS_DefineProperties(cx, Event, event_props) && JS_DefineFunctions(cx, Event, event_methods))) {
if ((JS_SetPrivate(cx, Event, eo) && JS_DefineProperties(cx, Event, event_props) && JS_DefineFunctions(cx, Event, event_methods))) {
*rval = OBJECT_TO_JSVAL(Event);
return JS_TRUE;
}
@@ -1691,8 +1663,7 @@ static JSBool session_send_event(JSContext * cx, JSObject * obj, uintN argc, jsv
struct event_obj *eo;
if (!jss || !jss->session) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
"You must call the session.originate method before calling this method!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
return JS_TRUE;
}
@@ -1724,8 +1695,7 @@ static JSBool session_hangup(JSContext * cx, JSObject * obj, uintN argc, jsval *
switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
if (!jss || !jss->session) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
"You must call the session.originate method before calling this method!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
return JS_TRUE;
}
@@ -2043,8 +2013,7 @@ JSClass session_class = {
};
static JSObject *new_js_session(JSContext * cx, JSObject * obj, switch_core_session_t *session, struct js_session *jss,
char *name, int flags)
static JSObject *new_js_session(JSContext * cx, JSObject * obj, switch_core_session_t *session, struct js_session *jss, char *name, int flags)
{
JSObject *session_obj;
if ((session_obj = JS_DefineObject(cx, obj, name, &session_class, NULL, 0))) {
@@ -2054,8 +2023,7 @@ static JSObject *new_js_session(JSContext * cx, JSObject * obj, switch_core_sess
jss->cx = cx;
jss->obj = session_obj;
if ((JS_SetPrivate(cx, session_obj, jss) &&
JS_DefineProperties(cx, session_obj, session_props) &&
JS_DefineFunctions(cx, session_obj, session_methods))) {
JS_DefineProperties(cx, session_obj, session_props) && JS_DefineFunctions(cx, session_obj, session_methods))) {
return session_obj;
}
}
@@ -2167,15 +2135,9 @@ static JSBool session_originate(JSContext * cx, JSObject * obj, uintN argc, jsva
}
caller_profile = switch_caller_profile_new(pool,
username,
dialplan,
cid_name,
cid_num,
network_addr, ani, aniii, rdnis, (char *) modname, context, dest);
username, dialplan, cid_name, cid_num, network_addr, ani, aniii, rdnis, (char *) modname, context, dest);
if (switch_ivr_originate
(session, &peer_session, &jss->cause, dest, to ? atoi(to) : 60, NULL, NULL, NULL,
caller_profile) != SWITCH_STATUS_SUCCESS) {
if (switch_ivr_originate(session, &peer_session, &jss->cause, dest, to ? atoi(to) : 60, NULL, NULL, NULL, caller_profile) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Cannot Create Outgoing Channel! [%s]\n", dest);
goto done;
}
@@ -2356,8 +2318,7 @@ static JSBool fileio_write(JSContext * cx, JSObject * obj, uintN argc, jsval * a
if (data) {
wrote = strlen(data);
*rval =
BOOLEAN_TO_JSVAL((switch_file_write(fio->fd, data, &wrote) == SWITCH_STATUS_SUCCESS) ? JS_TRUE : JS_FALSE);
*rval = BOOLEAN_TO_JSVAL((switch_file_write(fio->fd, data, &wrote) == SWITCH_STATUS_SUCCESS) ? JS_TRUE : JS_FALSE);
}
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
@@ -2561,8 +2522,7 @@ static JSBool js_bridge(JSContext * cx, JSObject * obj, uintN argc, jsval * argv
}
if (!(jss_a && jss_b)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failure! %s %s\n", jss_a ? "y" : "n",
jss_b ? "y" : "n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failure! %s %s\n", jss_a ? "y" : "n", jss_b ? "y" : "n");
return JS_FALSE;
}
@@ -2648,18 +2608,11 @@ static int env_init(JSContext * cx, JSObject * javascript_object)
JS_InitStandardClasses(cx, javascript_object);
JS_InitClass(cx,
javascript_object,
NULL,
&session_class, session_construct, 3, session_props, session_methods, session_props, session_methods);
JS_InitClass(cx, javascript_object, NULL, &session_class, session_construct, 3, session_props, session_methods, session_props, session_methods);
JS_InitClass(cx,
javascript_object,
NULL, &fileio_class, fileio_construct, 3, fileio_props, fileio_methods, fileio_props, fileio_methods);
JS_InitClass(cx, javascript_object, NULL, &fileio_class, fileio_construct, 3, fileio_props, fileio_methods, fileio_props, fileio_methods);
JS_InitClass(cx,
javascript_object,
NULL, &event_class, event_construct, 3, event_props, event_methods, event_props, event_methods);
JS_InitClass(cx, javascript_object, NULL, &event_class, event_construct, 3, event_props, event_methods, event_props, event_methods);
return 1;
}
@@ -2720,7 +2673,7 @@ static void js_parse_and_execute(switch_core_session_t *session, char *input_cod
static void *SWITCH_THREAD_FUNC js_thread_run(switch_thread_t *thread, void *obj)
static void *SWITCH_THREAD_FUNC js_thread_run(switch_thread_t * thread, void *obj)
{
char *input_code = obj;
@@ -2801,8 +2754,7 @@ static switch_loadable_module_interface_t spidermonkey_module_interface = {
/*.directory_interface */ NULL
};
SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface,
char *filename)
SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
{
switch_status_t status;
@@ -90,8 +90,7 @@ static JSBool js_email(JSContext * cx, JSObject * obj, uintN argc, jsval * argv,
if (argc > 3 &&
(from = JS_GetStringBytes(JS_ValueToString(cx, argv[0]))) &&
(to = JS_GetStringBytes(JS_ValueToString(cx, argv[1]))) &&
(headers = JS_GetStringBytes(JS_ValueToString(cx, argv[2]))) &&
(body = JS_GetStringBytes(JS_ValueToString(cx, argv[3])))
(headers = JS_GetStringBytes(JS_ValueToString(cx, argv[2]))) && (body = JS_GetStringBytes(JS_ValueToString(cx, argv[3])))
) {
if (argc > 4) {
file = JS_GetStringBytes(JS_ValueToString(cx, argv[4]));
@@ -129,8 +128,7 @@ static JSBool js_email(JSContext * cx, JSObject * obj, uintN argc, jsval * argv,
if (file) {
snprintf(buf, B64BUFFLEN, "\n\n--%s\nContent-Type: application/octet-stream\n"
"Content-Transfer-Encoding: base64\n"
"Content-Description: Sound attachment.\n"
"Content-Disposition: attachment; filename=\"%s\"\n\n", bound, file);
"Content-Description: Sound attachment.\n" "Content-Disposition: attachment; filename=\"%s\"\n\n", bound, file);
if (!write_buf(fd, buf))
return JS_FALSE;
@@ -233,8 +231,7 @@ switch_status_t etpan_load(JSContext * cx, JSObject * obj)
{
JS_DefineFunctions(cx, obj, etpan_functions);
JS_InitClass(cx,
obj, NULL, &etpan_class, etpan_construct, 3, etpan_props, etpan_methods, etpan_props, etpan_methods);
JS_InitClass(cx, obj, NULL, &etpan_class, etpan_construct, 3, etpan_props, etpan_methods, etpan_props, etpan_methods);
return SWITCH_STATUS_SUCCESS;
}
@@ -375,9 +372,7 @@ int send_message(char *data, size_t len, char **rcpts)
}
/* first open the stream */
if ((ret = mailsmtp_socket_connect(smtp,
(smtp_server != NULL ? smtp_server : "localhost"),
smtp_port)) != MAILSMTP_NO_ERROR) {
if ((ret = mailsmtp_socket_connect(smtp, (smtp_server != NULL ? smtp_server : "localhost"), smtp_port)) != MAILSMTP_NO_ERROR) {
fprintf(stderr, "mailsmtp_socket_connect: %s\n", mailsmtp_strerror(ret));
goto error;
}
@@ -397,17 +392,14 @@ int send_message(char *data, size_t len, char **rcpts)
goto error;
}
if (esmtp && smtp_user != NULL &&
(ret = mailsmtp_auth(smtp, smtp_user, (smtp_password != NULL) ? smtp_password : ""))
if (esmtp && smtp_user != NULL && (ret = mailsmtp_auth(smtp, smtp_user, (smtp_password != NULL) ? smtp_password : ""))
!= MAILSMTP_NO_ERROR) {
fprintf(stderr, "mailsmtp_auth: %s: %s\n", smtp_user, mailsmtp_strerror(ret));
goto error;
}
/* source */
if ((ret = (esmtp ?
mailesmtp_mail(smtp, smtp_from, 1, "etPanSMTPTest") :
mailsmtp_mail(smtp, smtp_from))) != MAILSMTP_NO_ERROR) {
if ((ret = (esmtp ? mailesmtp_mail(smtp, smtp_from, 1, "etPanSMTPTest") : mailsmtp_mail(smtp, smtp_from))) != MAILSMTP_NO_ERROR) {
fprintf(stderr, "mailsmtp_mail: %s, %s\n", smtp_from, mailsmtp_strerror(ret));
goto error;
}
@@ -415,9 +407,7 @@ int send_message(char *data, size_t len, char **rcpts)
/* recipients */
for (r = rcpts; *r != NULL; r++) {
if ((ret = (esmtp ?
mailesmtp_rcpt(smtp, *r,
MAILSMTP_DSN_NOTIFY_FAILURE | MAILSMTP_DSN_NOTIFY_DELAY,
NULL) : mailsmtp_rcpt(smtp, *r))) != MAILSMTP_NO_ERROR) {
mailesmtp_rcpt(smtp, *r, MAILSMTP_DSN_NOTIFY_FAILURE | MAILSMTP_DSN_NOTIFY_DELAY, NULL) : mailsmtp_rcpt(smtp, *r))) != MAILSMTP_NO_ERROR) {
fprintf(stderr, "mailsmtp_rcpt: %s: %s\n", *r, mailsmtp_strerror(ret));
goto error;
}
@@ -168,15 +168,12 @@ odbc_status_t odbc_obj_connect(odbc_obj_t * obj)
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Connecting %s\n", obj->dsn);
result = SQLConnect(obj->con,
(SQLCHAR *) obj->dsn, SQL_NTS,
(SQLCHAR *) obj->username, SQL_NTS, (SQLCHAR *) obj->password, SQL_NTS);
result = SQLConnect(obj->con, (SQLCHAR *) obj->dsn, SQL_NTS, (SQLCHAR *) obj->username, SQL_NTS, (SQLCHAR *) obj->password, SQL_NTS);
if ((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) {
SQLGetDiagRec(SQL_HANDLE_DBC, obj->con, 1, stat, &err, msg, 100, &mlen);
SQLFreeHandle(SQL_HANDLE_ENV, obj->env);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Error SQLConnect=%d errno=%d %s\n", result, (int) err,
msg);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Error SQLConnect=%d errno=%d %s\n", result, (int) err, msg);
return ODBC_FAIL;
} else {
@@ -445,8 +442,7 @@ static JSBool odbc_get_data(JSContext * cx, JSObject * obj, uintN argc, jsval *
SQLCHAR *data = odbc_obj->colbuf;
SQLCHAR *esc = NULL;
SQLDescribeCol(odbc_obj->stmt, x, name, sizeof(name), &NameLength, &DataType, &ColumnSize,
&DecimalDigits, &Nullable);
SQLDescribeCol(odbc_obj->stmt, x, name, sizeof(name), &NameLength, &DataType, &ColumnSize, &DecimalDigits, &Nullable);
SQLGetData(odbc_obj->stmt, x, SQL_C_CHAR, odbc_obj->colbuf, odbc_obj->cblen, NULL);
if (strchr((char *) odbc_obj->colbuf, '"')) { /* please don't */
@@ -454,8 +450,7 @@ static JSBool odbc_get_data(JSContext * cx, JSObject * obj, uintN argc, jsval *
data = esc;
}
snprintf((char *) odbc_obj->code, odbc_obj->codelen, "~_oDbC_dB_RoW_DaTa_[\"%s\"] = \"%s\"", name,
data);
snprintf((char *) odbc_obj->code, odbc_obj->codelen, "~_oDbC_dB_RoW_DaTa_[\"%s\"] = \"%s\"", name, data);
switch_safe_free(esc);
eval_some_js((char *) odbc_obj->code, cx, obj, rval);
@@ -116,8 +116,7 @@ static JSBool teletone_construct(JSContext * cx, JSObject * obj, uintN argc, jsv
read_codec->implementation->samples_per_second,
read_codec->implementation->microseconds_per_frame / 1000,
read_codec->implementation->number_of_channels,
SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE,
NULL, pool) == SWITCH_STATUS_SUCCESS) {
SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, pool) == SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Raw Codec Activated\n");
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Raw Codec Activation Failed\n");
@@ -285,9 +284,7 @@ static JSBool teletone_generate(JSContext * cx, JSObject * obj, uintN argc, jsva
break;
}
}
if ((write_frame.datalen =
(uint32_t) switch_buffer_read(tto->audio_buffer, fdata,
write_frame.codec->implementation->bytes_per_frame)) <= 0) {
if ((write_frame.datalen = (uint32_t) switch_buffer_read(tto->audio_buffer, fdata, write_frame.codec->implementation->bytes_per_frame)) <= 0) {
if (loops) {
switch_buffer_t *tmp;
@@ -298,8 +295,7 @@ static JSBool teletone_generate(JSContext * cx, JSObject * obj, uintN argc, jsva
loops--;
/* try again */
if ((write_frame.datalen =
(uint32_t) switch_buffer_read(tto->audio_buffer, fdata,
write_frame.codec->implementation->bytes_per_frame)) <= 0) {
(uint32_t) switch_buffer_read(tto->audio_buffer, fdata, write_frame.codec->implementation->bytes_per_frame)) <= 0) {
break;
}
} else {
@@ -363,11 +359,7 @@ JSClass teletone_class = {
switch_status_t teletone_load(JSContext * cx, JSObject * obj)
{
JS_InitClass(cx,
obj,
NULL,
&teletone_class,
teletone_construct, 3, teletone_props, teletone_methods, teletone_props, teletone_methods);
JS_InitClass(cx, obj, NULL, &teletone_class, teletone_construct, 3, teletone_props, teletone_methods, teletone_props, teletone_methods);
return SWITCH_STATUS_SUCCESS;
}