mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-02-25 10:54:45 +00:00
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3475 d0543943-73ff-0310-b7d9-9358b9ac24b2
1340 lines
43 KiB
C
1340 lines
43 KiB
C
/* ----------------------------------------------------------------------------
|
|
* This file was automatically generated by SWIG (http://www.swig.org).
|
|
* Version 1.3.21
|
|
*
|
|
* This file is not intended to be easily readable and contains a number of
|
|
* coding conventions designed to improve portability and efficiency. Do not make
|
|
* changes to this file unless you know what you are doing--modify the SWIG
|
|
* interface file instead.
|
|
* ----------------------------------------------------------------------------- */
|
|
|
|
#define SWIGPYTHON
|
|
|
|
#include "Python.h"
|
|
|
|
/*************************************************************** -*- c -*-
|
|
* python/precommon.swg
|
|
*
|
|
* Rename all exported symbols from common.swg, to avoid symbol
|
|
* clashes if multiple interpreters are included
|
|
*
|
|
************************************************************************/
|
|
|
|
#define SWIG_TypeRegister SWIG_Python_TypeRegister
|
|
#define SWIG_TypeCheck SWIG_Python_TypeCheck
|
|
#define SWIG_TypeCast SWIG_Python_TypeCast
|
|
#define SWIG_TypeDynamicCast SWIG_Python_TypeDynamicCast
|
|
#define SWIG_TypeName SWIG_Python_TypeName
|
|
#define SWIG_TypeQuery SWIG_Python_TypeQuery
|
|
#define SWIG_TypeClientData SWIG_Python_TypeClientData
|
|
#define SWIG_PackData SWIG_Python_PackData
|
|
#define SWIG_UnpackData SWIG_Python_UnpackData
|
|
|
|
|
|
/***********************************************************************
|
|
* common.swg
|
|
*
|
|
* This file contains generic SWIG runtime support for pointer
|
|
* type checking as well as a few commonly used macros to control
|
|
* external linkage.
|
|
*
|
|
* Author : David Beazley (beazley@cs.uchicago.edu)
|
|
*
|
|
* Copyright (c) 1999-2000, The University of Chicago
|
|
*
|
|
* This file may be freely redistributed without license or fee provided
|
|
* this copyright message remains intact.
|
|
************************************************************************/
|
|
|
|
#include <string.h>
|
|
|
|
#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
|
|
# if defined(_MSC_VER) || defined(__GNUC__)
|
|
# if defined(STATIC_LINKED)
|
|
# define SWIGEXPORT(a) a
|
|
# define SWIGIMPORT(a) extern a
|
|
# else
|
|
# define SWIGEXPORT(a) __declspec(dllexport) a
|
|
# define SWIGIMPORT(a) extern a
|
|
# endif
|
|
# else
|
|
# if defined(__BORLANDC__)
|
|
# define SWIGEXPORT(a) a _export
|
|
# define SWIGIMPORT(a) a _export
|
|
# else
|
|
# define SWIGEXPORT(a) a
|
|
# define SWIGIMPORT(a) a
|
|
# endif
|
|
# endif
|
|
#else
|
|
# define SWIGEXPORT(a) a
|
|
# define SWIGIMPORT(a) a
|
|
#endif
|
|
|
|
#ifdef SWIG_GLOBAL
|
|
# define SWIGRUNTIME(a) SWIGEXPORT(a)
|
|
#else
|
|
# define SWIGRUNTIME(a) static a
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef void *(*swig_converter_func)(void *);
|
|
typedef struct swig_type_info *(*swig_dycast_func)(void **);
|
|
|
|
typedef struct swig_type_info {
|
|
const char *name;
|
|
swig_converter_func converter;
|
|
const char *str;
|
|
void *clientdata;
|
|
swig_dycast_func dcast;
|
|
struct swig_type_info *next;
|
|
struct swig_type_info *prev;
|
|
} swig_type_info;
|
|
|
|
#ifdef SWIG_NOINCLUDE
|
|
|
|
SWIGIMPORT(swig_type_info *) SWIG_TypeRegister(swig_type_info *);
|
|
SWIGIMPORT(swig_type_info *) SWIG_TypeCheck(char *c, swig_type_info *);
|
|
SWIGIMPORT(void *) SWIG_TypeCast(swig_type_info *, void *);
|
|
SWIGIMPORT(swig_type_info *) SWIG_TypeDynamicCast(swig_type_info *, void **);
|
|
SWIGIMPORT(const char *) SWIG_TypeName(const swig_type_info *);
|
|
SWIGIMPORT(swig_type_info *) SWIG_TypeQuery(const char *);
|
|
SWIGIMPORT(void) SWIG_TypeClientData(swig_type_info *, void *);
|
|
SWIGIMPORT(char *) SWIG_PackData(char *, void *, int);
|
|
SWIGIMPORT(char *) SWIG_UnpackData(char *, void *, int);
|
|
|
|
#else
|
|
|
|
static swig_type_info *swig_type_list = 0;
|
|
|
|
/* Register a type mapping with the type-checking */
|
|
SWIGRUNTIME(swig_type_info *)
|
|
SWIG_TypeRegister(swig_type_info *ti) {
|
|
swig_type_info *tc, *head, *ret, *next;
|
|
/* Check to see if this type has already been registered */
|
|
tc = swig_type_list;
|
|
while (tc) {
|
|
if (strcmp(tc->name, ti->name) == 0) {
|
|
/* Already exists in the table. Just add additional types to the list */
|
|
if (tc->clientdata) ti->clientdata = tc->clientdata;
|
|
head = tc;
|
|
next = tc->next;
|
|
goto l1;
|
|
}
|
|
tc = tc->prev;
|
|
}
|
|
head = ti;
|
|
next = 0;
|
|
|
|
/* Place in list */
|
|
ti->prev = swig_type_list;
|
|
swig_type_list = ti;
|
|
|
|
/* Build linked lists */
|
|
l1:
|
|
ret = head;
|
|
tc = ti + 1;
|
|
/* Patch up the rest of the links */
|
|
while (tc->name) {
|
|
head->next = tc;
|
|
tc->prev = head;
|
|
head = tc;
|
|
tc++;
|
|
}
|
|
if (next) next->prev = head;
|
|
head->next = next;
|
|
return ret;
|
|
}
|
|
|
|
/* Check the typename */
|
|
SWIGRUNTIME(swig_type_info *)
|
|
SWIG_TypeCheck(char *c, swig_type_info *ty) {
|
|
swig_type_info *s;
|
|
if (!ty) return 0; /* Void pointer */
|
|
s = ty->next; /* First element always just a name */
|
|
do {
|
|
if (strcmp(s->name,c) == 0) {
|
|
if (s == ty->next) return s;
|
|
/* Move s to the top of the linked list */
|
|
s->prev->next = s->next;
|
|
if (s->next) {
|
|
s->next->prev = s->prev;
|
|
}
|
|
/* Insert s as second element in the list */
|
|
s->next = ty->next;
|
|
if (ty->next) ty->next->prev = s;
|
|
ty->next = s;
|
|
s->prev = ty;
|
|
return s;
|
|
}
|
|
s = s->next;
|
|
} while (s && (s != ty->next));
|
|
return 0;
|
|
}
|
|
|
|
/* Cast a pointer up an inheritance hierarchy */
|
|
SWIGRUNTIME(void *)
|
|
SWIG_TypeCast(swig_type_info *ty, void *ptr) {
|
|
if ((!ty) || (!ty->converter)) return ptr;
|
|
return (*ty->converter)(ptr);
|
|
}
|
|
|
|
/* Dynamic pointer casting. Down an inheritance hierarchy */
|
|
SWIGRUNTIME(swig_type_info *)
|
|
SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
|
|
swig_type_info *lastty = ty;
|
|
if (!ty || !ty->dcast) return ty;
|
|
while (ty && (ty->dcast)) {
|
|
ty = (*ty->dcast)(ptr);
|
|
if (ty) lastty = ty;
|
|
}
|
|
return lastty;
|
|
}
|
|
|
|
/* Return the name associated with this type */
|
|
SWIGRUNTIME(const char *)
|
|
SWIG_TypeName(const swig_type_info *ty) {
|
|
return ty->name;
|
|
}
|
|
|
|
/* Search for a swig_type_info structure */
|
|
SWIGRUNTIME(swig_type_info *)
|
|
SWIG_TypeQuery(const char *name) {
|
|
swig_type_info *ty = swig_type_list;
|
|
while (ty) {
|
|
if (ty->str && (strcmp(name,ty->str) == 0)) return ty;
|
|
if (ty->name && (strcmp(name,ty->name) == 0)) return ty;
|
|
ty = ty->prev;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
/* Set the clientdata field for a type */
|
|
SWIGRUNTIME(void)
|
|
SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
|
|
swig_type_info *tc, *equiv;
|
|
if (ti->clientdata == clientdata) return;
|
|
ti->clientdata = clientdata;
|
|
equiv = ti->next;
|
|
while (equiv) {
|
|
if (!equiv->converter) {
|
|
tc = swig_type_list;
|
|
while (tc) {
|
|
if ((strcmp(tc->name, equiv->name) == 0))
|
|
SWIG_TypeClientData(tc,clientdata);
|
|
tc = tc->prev;
|
|
}
|
|
}
|
|
equiv = equiv->next;
|
|
}
|
|
}
|
|
|
|
/* Pack binary data into a string */
|
|
SWIGRUNTIME(char *)
|
|
SWIG_PackData(char *c, void *ptr, int sz) {
|
|
static char hex[17] = "0123456789abcdef";
|
|
int i;
|
|
unsigned char *u = (unsigned char *) ptr;
|
|
register unsigned char uu;
|
|
for (i = 0; i < sz; i++,u++) {
|
|
uu = *u;
|
|
*(c++) = hex[(uu & 0xf0) >> 4];
|
|
*(c++) = hex[uu & 0xf];
|
|
}
|
|
return c;
|
|
}
|
|
|
|
/* Unpack binary data from a string */
|
|
SWIGRUNTIME(char *)
|
|
SWIG_UnpackData(char *c, void *ptr, int sz) {
|
|
register unsigned char uu = 0;
|
|
register int d;
|
|
unsigned char *u = (unsigned char *) ptr;
|
|
int i;
|
|
for (i = 0; i < sz; i++, u++) {
|
|
d = *(c++);
|
|
if ((d >= '0') && (d <= '9'))
|
|
uu = ((d - '0') << 4);
|
|
else if ((d >= 'a') && (d <= 'f'))
|
|
uu = ((d - ('a'-10)) << 4);
|
|
d = *(c++);
|
|
if ((d >= '0') && (d <= '9'))
|
|
uu |= (d - '0');
|
|
else if ((d >= 'a') && (d <= 'f'))
|
|
uu |= (d - ('a'-10));
|
|
*u = uu;
|
|
}
|
|
return c;
|
|
}
|
|
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
/***********************************************************************
|
|
* python.swg
|
|
*
|
|
* This file contains the runtime support for Python modules
|
|
* and includes code for managing global variables and pointer
|
|
* type checking.
|
|
*
|
|
* Author : David Beazley (beazley@cs.uchicago.edu)
|
|
************************************************************************/
|
|
|
|
#include "Python.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#define SWIG_PY_INT 1
|
|
#define SWIG_PY_FLOAT 2
|
|
#define SWIG_PY_STRING 3
|
|
#define SWIG_PY_POINTER 4
|
|
#define SWIG_PY_BINARY 5
|
|
|
|
/* Flags for pointer conversion */
|
|
|
|
#define SWIG_POINTER_EXCEPTION 0x1
|
|
#define SWIG_POINTER_DISOWN 0x2
|
|
|
|
/* Exception handling in wrappers */
|
|
#define SWIG_fail goto fail
|
|
|
|
/* Constant information structure */
|
|
typedef struct swig_const_info {
|
|
int type;
|
|
char *name;
|
|
long lvalue;
|
|
double dvalue;
|
|
void *pvalue;
|
|
swig_type_info **ptype;
|
|
} swig_const_info;
|
|
|
|
/* 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)
|
|
|
|
/* Python-specific SWIG API */
|
|
#define SWIG_newvarlink() \
|
|
SWIG_Python_newvarlink()
|
|
#define SWIG_addvarlink(p, name, get_attr, set_attr) \
|
|
SWIG_Python_addvarlink(p, name, get_attr, set_attr)
|
|
#define SWIG_ConvertPacked(obj, ptr, sz, ty, flags) \
|
|
SWIG_Python_ConvertPacked(obj, ptr, sz, ty, flags)
|
|
#define SWIG_NewPackedObj(ptr, sz, type) \
|
|
SWIG_Python_NewPackedObj(ptr, sz, type)
|
|
#define SWIG_InstallConstants(d, constants) \
|
|
SWIG_Python_InstallConstants(d, constants)
|
|
|
|
#ifdef SWIG_NOINCLUDE
|
|
|
|
SWIGIMPORT(int) SWIG_Python_ConvertPtr(PyObject *, void **, swig_type_info *, int);
|
|
SWIGIMPORT(PyObject *) SWIG_Python_NewPointerObj(void *, swig_type_info *,int own);
|
|
SWIGIMPORT(void *) SWIG_Python_MustGetPtr(PyObject *, swig_type_info *, int, int);
|
|
SWIGIMPORT(PyObject *) SWIG_Python_newvarlink(void);
|
|
SWIGIMPORT(void) SWIG_Python_addvarlink(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *));
|
|
SWIGIMPORT(int) SWIG_Python_ConvertPacked(PyObject *, void *, int sz, swig_type_info *, int);
|
|
SWIGIMPORT(PyObject *) SWIG_Python_NewPackedObj(void *, int sz, swig_type_info *);
|
|
SWIGIMPORT(void) SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]);
|
|
|
|
#else
|
|
|
|
/* -----------------------------------------------------------------------------
|
|
* global variable support code.
|
|
* ----------------------------------------------------------------------------- */
|
|
|
|
typedef struct swig_globalvar {
|
|
char *name; /* Name of global variable */
|
|
PyObject *(*get_attr)(void); /* Return the current value */
|
|
int (*set_attr)(PyObject *); /* Set the value */
|
|
struct swig_globalvar *next;
|
|
} swig_globalvar;
|
|
|
|
typedef struct swig_varlinkobject {
|
|
PyObject_HEAD
|
|
swig_globalvar *vars;
|
|
} swig_varlinkobject;
|
|
|
|
static PyObject *
|
|
swig_varlink_repr(swig_varlinkobject *v) {
|
|
v = v;
|
|
return PyString_FromString("<Global variables>");
|
|
}
|
|
|
|
static int
|
|
swig_varlink_print(swig_varlinkobject *v, FILE *fp, int flags) {
|
|
swig_globalvar *var;
|
|
flags = flags;
|
|
fprintf(fp,"Global variables { ");
|
|
for (var = v->vars; var; var=var->next) {
|
|
fprintf(fp,"%s", var->name);
|
|
if (var->next) fprintf(fp,", ");
|
|
}
|
|
fprintf(fp," }\n");
|
|
return 0;
|
|
}
|
|
|
|
static PyObject *
|
|
swig_varlink_getattr(swig_varlinkobject *v, char *n) {
|
|
swig_globalvar *var = v->vars;
|
|
while (var) {
|
|
if (strcmp(var->name,n) == 0) {
|
|
return (*var->get_attr)();
|
|
}
|
|
var = var->next;
|
|
}
|
|
PyErr_SetString(PyExc_NameError,"Unknown C global variable");
|
|
return NULL;
|
|
}
|
|
|
|
static int
|
|
swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
|
|
swig_globalvar *var = v->vars;
|
|
while (var) {
|
|
if (strcmp(var->name,n) == 0) {
|
|
return (*var->set_attr)(p);
|
|
}
|
|
var = var->next;
|
|
}
|
|
PyErr_SetString(PyExc_NameError,"Unknown C global variable");
|
|
return 1;
|
|
}
|
|
|
|
statichere PyTypeObject varlinktype = {
|
|
PyObject_HEAD_INIT(0)
|
|
0,
|
|
(char *)"swigvarlink", /* Type name */
|
|
sizeof(swig_varlinkobject), /* Basic size */
|
|
0, /* Itemsize */
|
|
0, /* Deallocator */
|
|
(printfunc) swig_varlink_print, /* Print */
|
|
(getattrfunc) swig_varlink_getattr, /* get attr */
|
|
(setattrfunc) swig_varlink_setattr, /* Set attr */
|
|
0, /* tp_compare */
|
|
(reprfunc) swig_varlink_repr, /* tp_repr */
|
|
0, /* tp_as_number */
|
|
0, /* tp_as_mapping*/
|
|
0, /* tp_hash */
|
|
};
|
|
|
|
/* Create a variable linking object for use later */
|
|
SWIGRUNTIME(PyObject *)
|
|
SWIG_Python_newvarlink(void) {
|
|
swig_varlinkobject *result = 0;
|
|
result = PyMem_NEW(swig_varlinkobject,1);
|
|
varlinktype.ob_type = &PyType_Type; /* Patch varlinktype into a PyType */
|
|
result->ob_type = &varlinktype;
|
|
result->vars = 0;
|
|
result->ob_refcnt = 0;
|
|
Py_XINCREF((PyObject *) result);
|
|
return ((PyObject*) result);
|
|
}
|
|
|
|
SWIGRUNTIME(void)
|
|
SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
|
|
swig_varlinkobject *v;
|
|
swig_globalvar *gv;
|
|
v= (swig_varlinkobject *) p;
|
|
gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
|
|
gv->name = (char *) malloc(strlen(name)+1);
|
|
strcpy(gv->name,name);
|
|
gv->get_attr = get_attr;
|
|
gv->set_attr = set_attr;
|
|
gv->next = v->vars;
|
|
v->vars = gv;
|
|
}
|
|
|
|
/* Convert a pointer value */
|
|
SWIGRUNTIME(int)
|
|
SWIG_Python_ConvertPtr(PyObject *obj, void **ptr, swig_type_info *ty, int flags) {
|
|
swig_type_info *tc;
|
|
char *c = 0;
|
|
static PyObject *SWIG_this = 0;
|
|
int newref = 0;
|
|
PyObject *pyobj = 0;
|
|
|
|
if (!obj) return 0;
|
|
if (obj == Py_None) {
|
|
*ptr = 0;
|
|
return 0;
|
|
}
|
|
#ifdef SWIG_COBJECT_TYPES
|
|
if (!(PyCObject_Check(obj))) {
|
|
if (!SWIG_this)
|
|
SWIG_this = PyString_FromString("this");
|
|
pyobj = obj;
|
|
obj = PyObject_GetAttr(obj,SWIG_this);
|
|
newref = 1;
|
|
if (!obj) goto type_error;
|
|
if (!PyCObject_Check(obj)) {
|
|
Py_DECREF(obj);
|
|
goto type_error;
|
|
}
|
|
}
|
|
*ptr = PyCObject_AsVoidPtr(obj);
|
|
c = (char *) PyCObject_GetDesc(obj);
|
|
if (newref) Py_DECREF(obj);
|
|
goto cobject;
|
|
#else
|
|
if (!(PyString_Check(obj))) {
|
|
if (!SWIG_this)
|
|
SWIG_this = PyString_FromString("this");
|
|
pyobj = obj;
|
|
obj = PyObject_GetAttr(obj,SWIG_this);
|
|
newref = 1;
|
|
if (!obj) goto type_error;
|
|
if (!PyString_Check(obj)) {
|
|
Py_DECREF(obj);
|
|
goto type_error;
|
|
}
|
|
}
|
|
c = PyString_AsString(obj);
|
|
/* Pointer values must start with leading underscore */
|
|
if (*c != '_') {
|
|
*ptr = (void *) 0;
|
|
if (strcmp(c,"NULL") == 0) {
|
|
if (newref) { Py_DECREF(obj); }
|
|
return 0;
|
|
} else {
|
|
if (newref) { Py_DECREF(obj); }
|
|
goto type_error;
|
|
}
|
|
}
|
|
c++;
|
|
c = SWIG_UnpackData(c,ptr,sizeof(void *));
|
|
if (newref) { Py_DECREF(obj); }
|
|
#endif
|
|
|
|
#ifdef SWIG_COBJECT_TYPES
|
|
cobject:
|
|
#endif
|
|
|
|
if (ty) {
|
|
tc = SWIG_TypeCheck(c,ty);
|
|
if (!tc) goto type_error;
|
|
*ptr = SWIG_TypeCast(tc,(void*) *ptr);
|
|
}
|
|
|
|
if ((pyobj) && (flags & SWIG_POINTER_DISOWN)) {
|
|
PyObject *zero = PyInt_FromLong(0);
|
|
PyObject_SetAttrString(pyobj,(char*)"thisown",zero);
|
|
Py_DECREF(zero);
|
|
}
|
|
return 0;
|
|
|
|
type_error:
|
|
if (flags & SWIG_POINTER_EXCEPTION) {
|
|
if (ty && c) {
|
|
char *temp = (char *) malloc(64+strlen(ty->name)+strlen(c));
|
|
sprintf(temp,"Type error. Got %s, expected %s", c, ty->name);
|
|
PyErr_SetString(PyExc_TypeError, temp);
|
|
free((char *) temp);
|
|
} else {
|
|
PyErr_SetString(PyExc_TypeError,"Expected a pointer");
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
/* Convert a pointer value, signal an exception on a type mismatch */
|
|
SWIGRUNTIME(void *)
|
|
SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) {
|
|
void *result;
|
|
SWIG_Python_ConvertPtr(obj, &result, ty, flags | SWIG_POINTER_EXCEPTION);
|
|
return result;
|
|
}
|
|
|
|
/* Convert a packed value value */
|
|
SWIGRUNTIME(int)
|
|
SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, int sz, swig_type_info *ty, int flags) {
|
|
swig_type_info *tc;
|
|
char *c = 0;
|
|
|
|
if ((!obj) || (!PyString_Check(obj))) goto type_error;
|
|
c = PyString_AsString(obj);
|
|
/* Pointer values must start with leading underscore */
|
|
if (*c != '_') goto type_error;
|
|
c++;
|
|
c = SWIG_UnpackData(c,ptr,sz);
|
|
if (ty) {
|
|
tc = SWIG_TypeCheck(c,ty);
|
|
if (!tc) goto type_error;
|
|
}
|
|
return 0;
|
|
|
|
type_error:
|
|
|
|
if (flags) {
|
|
if (ty && c) {
|
|
char *temp = (char *) malloc(64+strlen(ty->name)+strlen(c));
|
|
sprintf(temp,"Type error. Got %s, expected %s", c, ty->name);
|
|
PyErr_SetString(PyExc_TypeError, temp);
|
|
free((char *) temp);
|
|
} else {
|
|
PyErr_SetString(PyExc_TypeError,"Expected a pointer");
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
/* Create a new pointer object */
|
|
SWIGRUNTIME(PyObject *)
|
|
SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int own) {
|
|
PyObject *robj;
|
|
if (!ptr) {
|
|
Py_INCREF(Py_None);
|
|
return Py_None;
|
|
}
|
|
#ifdef SWIG_COBJECT_TYPES
|
|
robj = PyCObject_FromVoidPtrAndDesc((void *) ptr, (char *) type->name, NULL);
|
|
#else
|
|
{
|
|
char result[1024];
|
|
char *r = result;
|
|
*(r++) = '_';
|
|
r = SWIG_PackData(r,&ptr,sizeof(void *));
|
|
strcpy(r,type->name);
|
|
robj = PyString_FromString(result);
|
|
}
|
|
#endif
|
|
if (!robj || (robj == Py_None)) return robj;
|
|
if (type->clientdata) {
|
|
PyObject *inst;
|
|
PyObject *args = Py_BuildValue((char*)"(O)", robj);
|
|
Py_DECREF(robj);
|
|
inst = PyObject_CallObject((PyObject *) type->clientdata, args);
|
|
Py_DECREF(args);
|
|
if (inst) {
|
|
if (own) {
|
|
PyObject *n = PyInt_FromLong(1);
|
|
PyObject_SetAttrString(inst,(char*)"thisown",n);
|
|
Py_DECREF(n);
|
|
}
|
|
robj = inst;
|
|
}
|
|
}
|
|
return robj;
|
|
}
|
|
|
|
SWIGRUNTIME(PyObject *)
|
|
SWIG_Python_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
|
|
char result[1024];
|
|
char *r = result;
|
|
if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
|
|
*(r++) = '_';
|
|
r = SWIG_PackData(r,ptr,sz);
|
|
strcpy(r,type->name);
|
|
return PyString_FromString(result);
|
|
}
|
|
|
|
/* Install Constants */
|
|
SWIGRUNTIME(void)
|
|
SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
|
|
int i;
|
|
PyObject *obj;
|
|
for (i = 0; constants[i].type; i++) {
|
|
switch(constants[i].type) {
|
|
case SWIG_PY_INT:
|
|
obj = PyInt_FromLong(constants[i].lvalue);
|
|
break;
|
|
case SWIG_PY_FLOAT:
|
|
obj = PyFloat_FromDouble(constants[i].dvalue);
|
|
break;
|
|
case SWIG_PY_STRING:
|
|
obj = PyString_FromString((char *) constants[i].pvalue);
|
|
break;
|
|
case SWIG_PY_POINTER:
|
|
obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
|
|
break;
|
|
case SWIG_PY_BINARY:
|
|
obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
|
|
break;
|
|
default:
|
|
obj = 0;
|
|
break;
|
|
}
|
|
if (obj) {
|
|
PyDict_SetItemString(d,constants[i].name,obj);
|
|
Py_DECREF(obj);
|
|
}
|
|
}
|
|
}
|
|
|
|
#endif
|
|
|
|
/* Contract support */
|
|
|
|
#define SWIG_contract_assert(expr, msg) if (!(expr)) { PyErr_SetString(PyExc_RuntimeError, (char *) msg ); goto fail; } else
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
|
|
/* -------- TYPES TABLE (BEGIN) -------- */
|
|
|
|
#define SWIGTYPE_p_switch_channel_t swig_types[0]
|
|
#define SWIGTYPE_p_switch_file_handle_t swig_types[1]
|
|
#define SWIGTYPE_p_switch_core_session_t swig_types[2]
|
|
#define SWIGTYPE_p_p_switch_core_session_t swig_types[3]
|
|
#define SWIGTYPE_p_uint32_t swig_types[4]
|
|
#define SWIGTYPE_p_switch_input_callback_function_t swig_types[5]
|
|
static swig_type_info *swig_types[7];
|
|
|
|
/* -------- TYPES TABLE (END) -------- */
|
|
|
|
|
|
/*-----------------------------------------------
|
|
@(target):= _freeswitch.so
|
|
------------------------------------------------*/
|
|
#define SWIG_init init_freeswitch
|
|
|
|
#define SWIG_name "_freeswitch"
|
|
extern void fs_core_set_globals(void);
|
|
extern int fs_core_init(char *);
|
|
extern int fs_core_destroy(void);
|
|
extern int fs_loadable_module_init(void);
|
|
extern int fs_loadable_module_shutdown(void);
|
|
extern int fs_console_loop(void);
|
|
extern void fs_consol_log(char *,char *);
|
|
extern void fs_consol_clean(char *);
|
|
extern switch_core_session_t *fs_core_session_locate(char *);
|
|
extern void fs_channel_answer(switch_core_session_t *);
|
|
extern void fs_channel_pre_answer(switch_core_session_t *);
|
|
extern void fs_channel_hangup(switch_core_session_t *,char *);
|
|
extern void fs_channel_set_variable(switch_core_session_t *,char *,char *);
|
|
extern void fs_channel_get_variable(switch_core_session_t *,char *);
|
|
extern void fs_channel_set_state(switch_core_session_t *,char *);
|
|
extern int fs_ivr_play_file(switch_core_session_t *,char *,char *,switch_input_callback_function_t,void *,unsigned int);
|
|
extern int fs_switch_ivr_record_file(switch_core_session_t *,switch_file_handle_t *,char *,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_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 *,char *,uint32_t,switch_input_callback_function_t,char *,void *,unsigned int);
|
|
extern char *fs_switch_channel_get_variable(switch_channel_t *,char *);
|
|
extern int fs_switch_channel_set_variable(switch_channel_t *,char *,char *);
|
|
|
|
#include "switch.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
static PyObject *_wrap_fs_core_set_globals(PyObject *self, PyObject *args) {
|
|
PyObject *resultobj;
|
|
|
|
if(!PyArg_ParseTuple(args,(char *)":fs_core_set_globals")) goto fail;
|
|
fs_core_set_globals();
|
|
|
|
Py_INCREF(Py_None); resultobj = Py_None;
|
|
return resultobj;
|
|
fail:
|
|
return NULL;
|
|
}
|
|
|
|
|
|
static PyObject *_wrap_fs_core_init(PyObject *self, PyObject *args) {
|
|
PyObject *resultobj;
|
|
char *arg1 ;
|
|
int result;
|
|
|
|
if(!PyArg_ParseTuple(args,(char *)"s:fs_core_init",&arg1)) goto fail;
|
|
result = (int)fs_core_init(arg1);
|
|
|
|
resultobj = PyInt_FromLong((long)result);
|
|
return resultobj;
|
|
fail:
|
|
return NULL;
|
|
}
|
|
|
|
|
|
static PyObject *_wrap_fs_core_destroy(PyObject *self, PyObject *args) {
|
|
PyObject *resultobj;
|
|
int result;
|
|
|
|
if(!PyArg_ParseTuple(args,(char *)":fs_core_destroy")) goto fail;
|
|
result = (int)fs_core_destroy();
|
|
|
|
resultobj = PyInt_FromLong((long)result);
|
|
return resultobj;
|
|
fail:
|
|
return NULL;
|
|
}
|
|
|
|
|
|
static PyObject *_wrap_fs_loadable_module_init(PyObject *self, PyObject *args) {
|
|
PyObject *resultobj;
|
|
int result;
|
|
|
|
if(!PyArg_ParseTuple(args,(char *)":fs_loadable_module_init")) goto fail;
|
|
result = (int)fs_loadable_module_init();
|
|
|
|
resultobj = PyInt_FromLong((long)result);
|
|
return resultobj;
|
|
fail:
|
|
return NULL;
|
|
}
|
|
|
|
|
|
static PyObject *_wrap_fs_loadable_module_shutdown(PyObject *self, PyObject *args) {
|
|
PyObject *resultobj;
|
|
int result;
|
|
|
|
if(!PyArg_ParseTuple(args,(char *)":fs_loadable_module_shutdown")) goto fail;
|
|
result = (int)fs_loadable_module_shutdown();
|
|
|
|
resultobj = PyInt_FromLong((long)result);
|
|
return resultobj;
|
|
fail:
|
|
return NULL;
|
|
}
|
|
|
|
|
|
static PyObject *_wrap_fs_console_loop(PyObject *self, PyObject *args) {
|
|
PyObject *resultobj;
|
|
int result;
|
|
|
|
if(!PyArg_ParseTuple(args,(char *)":fs_console_loop")) goto fail;
|
|
result = (int)fs_console_loop();
|
|
|
|
resultobj = PyInt_FromLong((long)result);
|
|
return resultobj;
|
|
fail:
|
|
return NULL;
|
|
}
|
|
|
|
|
|
static PyObject *_wrap_fs_consol_log(PyObject *self, PyObject *args) {
|
|
PyObject *resultobj;
|
|
char *arg1 ;
|
|
char *arg2 ;
|
|
|
|
if(!PyArg_ParseTuple(args,(char *)"ss:fs_consol_log",&arg1,&arg2)) goto fail;
|
|
fs_consol_log(arg1,arg2);
|
|
|
|
Py_INCREF(Py_None); resultobj = Py_None;
|
|
return resultobj;
|
|
fail:
|
|
return NULL;
|
|
}
|
|
|
|
|
|
static PyObject *_wrap_fs_consol_clean(PyObject *self, PyObject *args) {
|
|
PyObject *resultobj;
|
|
char *arg1 ;
|
|
|
|
if(!PyArg_ParseTuple(args,(char *)"s:fs_consol_clean",&arg1)) goto fail;
|
|
fs_consol_clean(arg1);
|
|
|
|
Py_INCREF(Py_None); resultobj = Py_None;
|
|
return resultobj;
|
|
fail:
|
|
return NULL;
|
|
}
|
|
|
|
|
|
static PyObject *_wrap_fs_core_session_locate(PyObject *self, PyObject *args) {
|
|
PyObject *resultobj;
|
|
char *arg1 ;
|
|
switch_core_session_t *result;
|
|
|
|
if(!PyArg_ParseTuple(args,(char *)"s:fs_core_session_locate",&arg1)) goto fail;
|
|
result = (switch_core_session_t *)fs_core_session_locate(arg1);
|
|
|
|
resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_switch_core_session_t, 0);
|
|
return resultobj;
|
|
fail:
|
|
return NULL;
|
|
}
|
|
|
|
|
|
static PyObject *_wrap_fs_channel_answer(PyObject *self, PyObject *args) {
|
|
PyObject *resultobj;
|
|
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
|
PyObject * obj0 = 0 ;
|
|
|
|
if(!PyArg_ParseTuple(args,(char *)"O:fs_channel_answer",&obj0)) goto fail;
|
|
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_switch_core_session_t,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
|
fs_channel_answer(arg1);
|
|
|
|
Py_INCREF(Py_None); resultobj = Py_None;
|
|
return resultobj;
|
|
fail:
|
|
return NULL;
|
|
}
|
|
|
|
|
|
static PyObject *_wrap_fs_channel_pre_answer(PyObject *self, PyObject *args) {
|
|
PyObject *resultobj;
|
|
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
|
PyObject * obj0 = 0 ;
|
|
|
|
if(!PyArg_ParseTuple(args,(char *)"O:fs_channel_pre_answer",&obj0)) goto fail;
|
|
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_switch_core_session_t,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
|
fs_channel_pre_answer(arg1);
|
|
|
|
Py_INCREF(Py_None); resultobj = Py_None;
|
|
return resultobj;
|
|
fail:
|
|
return NULL;
|
|
}
|
|
|
|
|
|
static PyObject *_wrap_fs_channel_hangup(PyObject *self, PyObject *args) {
|
|
PyObject *resultobj;
|
|
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
|
char *arg2 ;
|
|
PyObject * obj0 = 0 ;
|
|
|
|
if(!PyArg_ParseTuple(args,(char *)"Os:fs_channel_hangup",&obj0,&arg2)) goto fail;
|
|
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_switch_core_session_t,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
|
fs_channel_hangup(arg1,arg2);
|
|
|
|
Py_INCREF(Py_None); resultobj = Py_None;
|
|
return resultobj;
|
|
fail:
|
|
return NULL;
|
|
}
|
|
|
|
|
|
static PyObject *_wrap_fs_channel_set_variable(PyObject *self, PyObject *args) {
|
|
PyObject *resultobj;
|
|
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
|
char *arg2 ;
|
|
char *arg3 ;
|
|
PyObject * obj0 = 0 ;
|
|
|
|
if(!PyArg_ParseTuple(args,(char *)"Oss:fs_channel_set_variable",&obj0,&arg2,&arg3)) goto fail;
|
|
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_switch_core_session_t,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
|
fs_channel_set_variable(arg1,arg2,arg3);
|
|
|
|
Py_INCREF(Py_None); resultobj = Py_None;
|
|
return resultobj;
|
|
fail:
|
|
return NULL;
|
|
}
|
|
|
|
|
|
static PyObject *_wrap_fs_channel_get_variable(PyObject *self, PyObject *args) {
|
|
PyObject *resultobj;
|
|
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
|
char *arg2 ;
|
|
PyObject * obj0 = 0 ;
|
|
|
|
if(!PyArg_ParseTuple(args,(char *)"Os:fs_channel_get_variable",&obj0,&arg2)) goto fail;
|
|
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_switch_core_session_t,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
|
fs_channel_get_variable(arg1,arg2);
|
|
|
|
Py_INCREF(Py_None); resultobj = Py_None;
|
|
return resultobj;
|
|
fail:
|
|
return NULL;
|
|
}
|
|
|
|
|
|
static PyObject *_wrap_fs_channel_set_state(PyObject *self, PyObject *args) {
|
|
PyObject *resultobj;
|
|
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
|
char *arg2 ;
|
|
PyObject * obj0 = 0 ;
|
|
|
|
if(!PyArg_ParseTuple(args,(char *)"Os:fs_channel_set_state",&obj0,&arg2)) goto fail;
|
|
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_switch_core_session_t,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
|
fs_channel_set_state(arg1,arg2);
|
|
|
|
Py_INCREF(Py_None); resultobj = Py_None;
|
|
return resultobj;
|
|
fail:
|
|
return NULL;
|
|
}
|
|
|
|
|
|
static PyObject *_wrap_fs_ivr_play_file(PyObject *self, PyObject *args) {
|
|
PyObject *resultobj;
|
|
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
|
char *arg2 ;
|
|
char *arg3 ;
|
|
switch_input_callback_function_t arg4 ;
|
|
void *arg5 = (void *) 0 ;
|
|
unsigned int arg6 ;
|
|
int result;
|
|
switch_input_callback_function_t *argp4 ;
|
|
PyObject * obj0 = 0 ;
|
|
PyObject * obj3 = 0 ;
|
|
PyObject * obj4 = 0 ;
|
|
PyObject * obj5 = 0 ;
|
|
|
|
if(!PyArg_ParseTuple(args,(char *)"OssOOO:fs_ivr_play_file",&obj0,&arg2,&arg3,&obj3,&obj4,&obj5)) goto fail;
|
|
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_switch_core_session_t,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
|
if ((SWIG_ConvertPtr(obj3,(void **) &argp4, SWIGTYPE_p_switch_input_callback_function_t,SWIG_POINTER_EXCEPTION) == -1)) SWIG_fail;
|
|
arg4 = *argp4;
|
|
if ((SWIG_ConvertPtr(obj4,(void **) &arg5, 0, SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
|
arg6 = (unsigned int) PyInt_AsLong(obj5);
|
|
if (PyErr_Occurred()) SWIG_fail;
|
|
result = (int)fs_ivr_play_file(arg1,arg2,arg3,arg4,arg5,arg6);
|
|
|
|
resultobj = PyInt_FromLong((long)result);
|
|
return resultobj;
|
|
fail:
|
|
return NULL;
|
|
}
|
|
|
|
|
|
static PyObject *_wrap_fs_switch_ivr_record_file(PyObject *self, PyObject *args) {
|
|
PyObject *resultobj;
|
|
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
|
switch_file_handle_t *arg2 = (switch_file_handle_t *) 0 ;
|
|
char *arg3 ;
|
|
switch_input_callback_function_t arg4 ;
|
|
void *arg5 = (void *) 0 ;
|
|
unsigned int arg6 ;
|
|
unsigned int arg7 ;
|
|
int result;
|
|
switch_input_callback_function_t *argp4 ;
|
|
PyObject * obj0 = 0 ;
|
|
PyObject * obj1 = 0 ;
|
|
PyObject * obj3 = 0 ;
|
|
PyObject * obj4 = 0 ;
|
|
PyObject * obj5 = 0 ;
|
|
PyObject * obj6 = 0 ;
|
|
|
|
if(!PyArg_ParseTuple(args,(char *)"OOsOOOO:fs_switch_ivr_record_file",&obj0,&obj1,&arg3,&obj3,&obj4,&obj5,&obj6)) goto fail;
|
|
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_switch_core_session_t,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
|
if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_switch_file_handle_t,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
|
if ((SWIG_ConvertPtr(obj3,(void **) &argp4, SWIGTYPE_p_switch_input_callback_function_t,SWIG_POINTER_EXCEPTION) == -1)) SWIG_fail;
|
|
arg4 = *argp4;
|
|
if ((SWIG_ConvertPtr(obj4,(void **) &arg5, 0, SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
|
arg6 = (unsigned int) PyInt_AsLong(obj5);
|
|
if (PyErr_Occurred()) SWIG_fail;
|
|
arg7 = (unsigned int) PyInt_AsLong(obj6);
|
|
if (PyErr_Occurred()) SWIG_fail;
|
|
result = (int)fs_switch_ivr_record_file(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
|
|
|
|
resultobj = PyInt_FromLong((long)result);
|
|
return resultobj;
|
|
fail:
|
|
return NULL;
|
|
}
|
|
|
|
|
|
static PyObject *_wrap_fs_switch_ivr_sleep(PyObject *self, PyObject *args) {
|
|
PyObject *resultobj;
|
|
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
|
uint32_t arg2 ;
|
|
int result;
|
|
uint32_t *argp2 ;
|
|
PyObject * obj0 = 0 ;
|
|
PyObject * obj1 = 0 ;
|
|
|
|
if(!PyArg_ParseTuple(args,(char *)"OO:fs_switch_ivr_sleep",&obj0,&obj1)) goto fail;
|
|
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_switch_core_session_t,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
|
if ((SWIG_ConvertPtr(obj1,(void **) &argp2, SWIGTYPE_p_uint32_t,SWIG_POINTER_EXCEPTION) == -1)) SWIG_fail;
|
|
arg2 = *argp2;
|
|
result = (int)fs_switch_ivr_sleep(arg1,arg2);
|
|
|
|
resultobj = PyInt_FromLong((long)result);
|
|
return resultobj;
|
|
fail:
|
|
return NULL;
|
|
}
|
|
|
|
|
|
static PyObject *_wrap_fs_ivr_play_file2(PyObject *self, PyObject *args) {
|
|
PyObject *resultobj;
|
|
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
|
char *arg2 ;
|
|
int result;
|
|
PyObject * obj0 = 0 ;
|
|
|
|
if(!PyArg_ParseTuple(args,(char *)"Os:fs_ivr_play_file2",&obj0,&arg2)) goto fail;
|
|
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_switch_core_session_t,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
|
result = (int)fs_ivr_play_file2(arg1,arg2);
|
|
|
|
resultobj = PyInt_FromLong((long)result);
|
|
return resultobj;
|
|
fail:
|
|
return NULL;
|
|
}
|
|
|
|
|
|
static PyObject *_wrap_fs_switch_ivr_collect_digits_callback(PyObject *self, PyObject *args) {
|
|
PyObject *resultobj;
|
|
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
|
switch_input_callback_function_t arg2 ;
|
|
void *arg3 = (void *) 0 ;
|
|
unsigned int arg4 ;
|
|
unsigned int arg5 ;
|
|
int result;
|
|
switch_input_callback_function_t *argp2 ;
|
|
PyObject * obj0 = 0 ;
|
|
PyObject * obj1 = 0 ;
|
|
PyObject * obj2 = 0 ;
|
|
PyObject * obj3 = 0 ;
|
|
PyObject * obj4 = 0 ;
|
|
|
|
if(!PyArg_ParseTuple(args,(char *)"OOOOO:fs_switch_ivr_collect_digits_callback",&obj0,&obj1,&obj2,&obj3,&obj4)) goto fail;
|
|
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_switch_core_session_t,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
|
if ((SWIG_ConvertPtr(obj1,(void **) &argp2, SWIGTYPE_p_switch_input_callback_function_t,SWIG_POINTER_EXCEPTION) == -1)) SWIG_fail;
|
|
arg2 = *argp2;
|
|
if ((SWIG_ConvertPtr(obj2,(void **) &arg3, 0, SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
|
arg4 = (unsigned int) PyInt_AsLong(obj3);
|
|
if (PyErr_Occurred()) SWIG_fail;
|
|
arg5 = (unsigned int) PyInt_AsLong(obj4);
|
|
if (PyErr_Occurred()) SWIG_fail;
|
|
result = (int)fs_switch_ivr_collect_digits_callback(arg1,arg2,arg3,arg4,arg5);
|
|
|
|
resultobj = PyInt_FromLong((long)result);
|
|
return resultobj;
|
|
fail:
|
|
return NULL;
|
|
}
|
|
|
|
|
|
static PyObject *_wrap_fs_switch_ivr_collect_digits_count(PyObject *self, PyObject *args) {
|
|
PyObject *resultobj;
|
|
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
|
char *arg2 ;
|
|
unsigned int arg3 ;
|
|
unsigned int arg4 ;
|
|
char *arg5 ;
|
|
char *arg6 ;
|
|
unsigned int arg7 ;
|
|
int result;
|
|
PyObject * obj0 = 0 ;
|
|
PyObject * obj2 = 0 ;
|
|
PyObject * obj3 = 0 ;
|
|
PyObject * obj6 = 0 ;
|
|
|
|
if(!PyArg_ParseTuple(args,(char *)"OsOOssO:fs_switch_ivr_collect_digits_count",&obj0,&arg2,&obj2,&obj3,&arg5,&arg6,&obj6)) goto fail;
|
|
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_switch_core_session_t,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
|
arg3 = (unsigned int) PyInt_AsLong(obj2);
|
|
if (PyErr_Occurred()) SWIG_fail;
|
|
arg4 = (unsigned int) PyInt_AsLong(obj3);
|
|
if (PyErr_Occurred()) SWIG_fail;
|
|
arg7 = (unsigned int) PyInt_AsLong(obj6);
|
|
if (PyErr_Occurred()) SWIG_fail;
|
|
result = (int)fs_switch_ivr_collect_digits_count(arg1,arg2,arg3,arg4,(char const *)arg5,arg6,arg7);
|
|
|
|
resultobj = PyInt_FromLong((long)result);
|
|
return resultobj;
|
|
fail:
|
|
return NULL;
|
|
}
|
|
|
|
|
|
static PyObject *_wrap_fs_switch_ivr_originate(PyObject *self, PyObject *args) {
|
|
PyObject *resultobj;
|
|
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
|
switch_core_session_t **arg2 = (switch_core_session_t **) 0 ;
|
|
char *arg3 ;
|
|
uint32_t arg4 ;
|
|
int result;
|
|
uint32_t *argp4 ;
|
|
PyObject * obj0 = 0 ;
|
|
PyObject * obj1 = 0 ;
|
|
PyObject * obj3 = 0 ;
|
|
|
|
if(!PyArg_ParseTuple(args,(char *)"OOsO:fs_switch_ivr_originate",&obj0,&obj1,&arg3,&obj3)) goto fail;
|
|
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_switch_core_session_t,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
|
if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_p_switch_core_session_t,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
|
if ((SWIG_ConvertPtr(obj3,(void **) &argp4, SWIGTYPE_p_uint32_t,SWIG_POINTER_EXCEPTION) == -1)) SWIG_fail;
|
|
arg4 = *argp4;
|
|
result = (int)fs_switch_ivr_originate(arg1,arg2,arg3,arg4);
|
|
|
|
resultobj = PyInt_FromLong((long)result);
|
|
return resultobj;
|
|
fail:
|
|
return NULL;
|
|
}
|
|
|
|
|
|
static PyObject *_wrap_fs_switch_ivr_session_transfer(PyObject *self, PyObject *args) {
|
|
PyObject *resultobj;
|
|
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
|
char *arg2 ;
|
|
char *arg3 ;
|
|
char *arg4 ;
|
|
int result;
|
|
PyObject * obj0 = 0 ;
|
|
|
|
if(!PyArg_ParseTuple(args,(char *)"Osss:fs_switch_ivr_session_transfer",&obj0,&arg2,&arg3,&arg4)) goto fail;
|
|
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_switch_core_session_t,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
|
result = (int)fs_switch_ivr_session_transfer(arg1,arg2,arg3,arg4);
|
|
|
|
resultobj = PyInt_FromLong((long)result);
|
|
return resultobj;
|
|
fail:
|
|
return NULL;
|
|
}
|
|
|
|
|
|
static PyObject *_wrap_fs_switch_ivr_speak_text(PyObject *self, PyObject *args) {
|
|
PyObject *resultobj;
|
|
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
|
char *arg2 ;
|
|
char *arg3 ;
|
|
char *arg4 ;
|
|
uint32_t arg5 ;
|
|
switch_input_callback_function_t arg6 ;
|
|
char *arg7 ;
|
|
void *arg8 = (void *) 0 ;
|
|
unsigned int arg9 ;
|
|
int result;
|
|
uint32_t *argp5 ;
|
|
switch_input_callback_function_t *argp6 ;
|
|
PyObject * obj0 = 0 ;
|
|
PyObject * obj4 = 0 ;
|
|
PyObject * obj5 = 0 ;
|
|
PyObject * obj7 = 0 ;
|
|
PyObject * obj8 = 0 ;
|
|
|
|
if(!PyArg_ParseTuple(args,(char *)"OsssOOsOO:fs_switch_ivr_speak_text",&obj0,&arg2,&arg3,&arg4,&obj4,&obj5,&arg7,&obj7,&obj8)) goto fail;
|
|
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_switch_core_session_t,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
|
if ((SWIG_ConvertPtr(obj4,(void **) &argp5, SWIGTYPE_p_uint32_t,SWIG_POINTER_EXCEPTION) == -1)) SWIG_fail;
|
|
arg5 = *argp5;
|
|
if ((SWIG_ConvertPtr(obj5,(void **) &argp6, SWIGTYPE_p_switch_input_callback_function_t,SWIG_POINTER_EXCEPTION) == -1)) SWIG_fail;
|
|
arg6 = *argp6;
|
|
if ((SWIG_ConvertPtr(obj7,(void **) &arg8, 0, SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
|
arg9 = (unsigned int) PyInt_AsLong(obj8);
|
|
if (PyErr_Occurred()) SWIG_fail;
|
|
result = (int)fs_switch_ivr_speak_text(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);
|
|
|
|
resultobj = PyInt_FromLong((long)result);
|
|
return resultobj;
|
|
fail:
|
|
return NULL;
|
|
}
|
|
|
|
|
|
static PyObject *_wrap_fs_switch_channel_get_variable(PyObject *self, PyObject *args) {
|
|
PyObject *resultobj;
|
|
switch_channel_t *arg1 = (switch_channel_t *) 0 ;
|
|
char *arg2 ;
|
|
char *result;
|
|
PyObject * obj0 = 0 ;
|
|
|
|
if(!PyArg_ParseTuple(args,(char *)"Os:fs_switch_channel_get_variable",&obj0,&arg2)) goto fail;
|
|
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_switch_channel_t,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
|
result = (char *)fs_switch_channel_get_variable(arg1,arg2);
|
|
|
|
resultobj = result ? PyString_FromString(result) : Py_BuildValue((char*)"");
|
|
return resultobj;
|
|
fail:
|
|
return NULL;
|
|
}
|
|
|
|
|
|
static PyObject *_wrap_fs_switch_channel_set_variable(PyObject *self, PyObject *args) {
|
|
PyObject *resultobj;
|
|
switch_channel_t *arg1 = (switch_channel_t *) 0 ;
|
|
char *arg2 ;
|
|
char *arg3 ;
|
|
int result;
|
|
PyObject * obj0 = 0 ;
|
|
|
|
if(!PyArg_ParseTuple(args,(char *)"Oss:fs_switch_channel_set_variable",&obj0,&arg2,&arg3)) goto fail;
|
|
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_switch_channel_t,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
|
result = (int)fs_switch_channel_set_variable(arg1,arg2,arg3);
|
|
|
|
resultobj = PyInt_FromLong((long)result);
|
|
return resultobj;
|
|
fail:
|
|
return NULL;
|
|
}
|
|
|
|
|
|
static PyMethodDef SwigMethods[] = {
|
|
{ (char *)"fs_core_set_globals", _wrap_fs_core_set_globals, METH_VARARGS },
|
|
{ (char *)"fs_core_init", _wrap_fs_core_init, METH_VARARGS },
|
|
{ (char *)"fs_core_destroy", _wrap_fs_core_destroy, METH_VARARGS },
|
|
{ (char *)"fs_loadable_module_init", _wrap_fs_loadable_module_init, METH_VARARGS },
|
|
{ (char *)"fs_loadable_module_shutdown", _wrap_fs_loadable_module_shutdown, METH_VARARGS },
|
|
{ (char *)"fs_console_loop", _wrap_fs_console_loop, METH_VARARGS },
|
|
{ (char *)"fs_consol_log", _wrap_fs_consol_log, METH_VARARGS },
|
|
{ (char *)"fs_consol_clean", _wrap_fs_consol_clean, METH_VARARGS },
|
|
{ (char *)"fs_core_session_locate", _wrap_fs_core_session_locate, METH_VARARGS },
|
|
{ (char *)"fs_channel_answer", _wrap_fs_channel_answer, METH_VARARGS },
|
|
{ (char *)"fs_channel_pre_answer", _wrap_fs_channel_pre_answer, METH_VARARGS },
|
|
{ (char *)"fs_channel_hangup", _wrap_fs_channel_hangup, METH_VARARGS },
|
|
{ (char *)"fs_channel_set_variable", _wrap_fs_channel_set_variable, METH_VARARGS },
|
|
{ (char *)"fs_channel_get_variable", _wrap_fs_channel_get_variable, METH_VARARGS },
|
|
{ (char *)"fs_channel_set_state", _wrap_fs_channel_set_state, METH_VARARGS },
|
|
{ (char *)"fs_ivr_play_file", _wrap_fs_ivr_play_file, METH_VARARGS },
|
|
{ (char *)"fs_switch_ivr_record_file", _wrap_fs_switch_ivr_record_file, METH_VARARGS },
|
|
{ (char *)"fs_switch_ivr_sleep", _wrap_fs_switch_ivr_sleep, METH_VARARGS },
|
|
{ (char *)"fs_ivr_play_file2", _wrap_fs_ivr_play_file2, METH_VARARGS },
|
|
{ (char *)"fs_switch_ivr_collect_digits_callback", _wrap_fs_switch_ivr_collect_digits_callback, METH_VARARGS },
|
|
{ (char *)"fs_switch_ivr_collect_digits_count", _wrap_fs_switch_ivr_collect_digits_count, METH_VARARGS },
|
|
{ (char *)"fs_switch_ivr_originate", _wrap_fs_switch_ivr_originate, METH_VARARGS },
|
|
{ (char *)"fs_switch_ivr_session_transfer", _wrap_fs_switch_ivr_session_transfer, METH_VARARGS },
|
|
{ (char *)"fs_switch_ivr_speak_text", _wrap_fs_switch_ivr_speak_text, METH_VARARGS },
|
|
{ (char *)"fs_switch_channel_get_variable", _wrap_fs_switch_channel_get_variable, METH_VARARGS },
|
|
{ (char *)"fs_switch_channel_set_variable", _wrap_fs_switch_channel_set_variable, METH_VARARGS },
|
|
{ NULL, NULL }
|
|
};
|
|
|
|
|
|
/* -------- 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_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},{"_p_switch_input_callback_function_t"},{0}};
|
|
|
|
static swig_type_info *swig_types_initial[] = {
|
|
_swigt__p_switch_channel_t,
|
|
_swigt__p_switch_file_handle_t,
|
|
_swigt__p_switch_core_session_t,
|
|
_swigt__p_p_switch_core_session_t,
|
|
_swigt__p_uint32_t,
|
|
_swigt__p_switch_input_callback_function_t,
|
|
0
|
|
};
|
|
|
|
|
|
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
|
|
|
|
static swig_const_info swig_const_table[] = {
|
|
{0}};
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
extern "C"
|
|
#endif
|
|
SWIGEXPORT(void) SWIG_init(void) {
|
|
static PyObject *SWIG_globals = 0;
|
|
static int typeinit = 0;
|
|
PyObject *m, *d;
|
|
int i;
|
|
if (!SWIG_globals) SWIG_globals = SWIG_newvarlink();
|
|
m = Py_InitModule((char *) SWIG_name, SwigMethods);
|
|
d = PyModule_GetDict(m);
|
|
|
|
if (!typeinit) {
|
|
for (i = 0; swig_types_initial[i]; i++) {
|
|
swig_types[i] = SWIG_TypeRegister(swig_types_initial[i]);
|
|
}
|
|
typeinit = 1;
|
|
}
|
|
SWIG_InstallConstants(d,swig_const_table);
|
|
|
|
}
|
|
|