diff --git a/apps/py_sems/Makefile b/apps/py_sems/Makefile index b044b7ea..41db7b80 100644 --- a/apps/py_sems/Makefile +++ b/apps/py_sems/Makefile @@ -108,6 +108,7 @@ install_python_files: $(modules-prefix)/$(modules-dir) clean_py_sems_lib: $(MAKE) -C sip/ clean rm -f sip/py_sems_lib.a + rm -f py/*.pyc sip/py_sems_lib.a: $(MAKE) -C sip/ py_sems_lib.a diff --git a/apps/py_sems/PySems.cpp b/apps/py_sems/PySems.cpp index 5fecb6d1..50cd2246 100644 --- a/apps/py_sems/PySems.cpp +++ b/apps/py_sems/PySems.cpp @@ -1,5 +1,6 @@ /* * $Id: PySems.cpp,v 1.26.2.1 2005/09/02 13:47:46 rco Exp $ + * * Copyright (C) 2002-2003 Fhg Fokus * * This file is part of sems, a free SIP media server. @@ -29,8 +30,14 @@ #include "AmUtils.h" #include "AmPlugIn.h" +#include "PySemsDialog.h" +#include "PySemsB2BDialog.h" +#include "PySemsUtils.h" + #include "sip/sipAPIpy_sems_lib.h" #include "sip/sippy_sems_libPySemsDialog.h" +#include "sip/sippy_sems_libPySemsB2BDialog.h" +#include "sip/sippy_sems_libPySemsB2ABDialog.h" #include #include @@ -201,7 +208,7 @@ void PySemsFactory::init_python_interpreter() PyEval_ReleaseLock(); } -PySemsDialog* PySemsFactory::newDlg(const string& name) +AmSession* PySemsFactory::newDlg(const string& name) { PYLOCK; @@ -231,24 +238,90 @@ PySemsDialog* PySemsFactory::newDlg(const string& name) } int err=0; - PySemsDialog* dlg = (PySemsDialog*)sipForceConvertTo_PySemsDialog(dlg_inst,&err); - if(!dlg || err){ - - PyErr_Print(); - ERROR("PySemsFactory: while loading \"%s\": could not retrieve PySemsDialog ptr.\n", - name.c_str()); - throw AmSession::Exception(500,"Internal error in PY_SEMS plug-in."); - Py_DECREF(dlg_inst); - return NULL; + AmSession* sess = NULL; + PySemsDialogBase* dlg_base = NULL; + + switch(mod_desc.dt) { + case PySemsScriptDesc::None: { + ERROR("wrong script type: None.\n"); + }; break; + case PySemsScriptDesc::Dialog: { + PySemsDialog* dlg = (PySemsDialog*) + sipForceConvertTo_PySemsDialog(dlg_inst,&err); + sess = dlg; + dlg_base = dlg; + }; break; + + case PySemsScriptDesc::B2BDialog: { + PySemsB2BDialog* b2b_dlg = (PySemsB2BDialog*) + sipForceConvertTo_PySemsB2BDialog(dlg_inst,&err); + sess = b2b_dlg; + dlg_base = b2b_dlg; + }; break; + + case PySemsScriptDesc::B2ABDialog: { + PySemsB2ABDialog* b2ab_dlg = (PySemsB2ABDialog*) + sipForceConvertTo_PySemsB2ABDialog(dlg_inst,&err); + sess = b2ab_dlg; + dlg_base = b2ab_dlg; + + }; break; + } + + if (err || !dlg_base) { + // no luck + PyErr_Print(); + ERROR("PySemsFactory: while loading \"%s\": could not retrieve a PySems*Dialog ptr.\n", + name.c_str()); + throw AmSession::Exception(500,"Internal error in PY_SEMS plug-in."); + Py_DECREF(dlg_inst); + return NULL; } + +// // TODO: find some way to guess the type without trying... +// // try Dialog... +// PySemsDialog* dlg = (PySemsDialog*)sipForceConvertTo_PySemsDialog(dlg_inst,&err); +// if (dlg && (!err)) { +// DBG("OK, got PySemsDialog.\n"); +// sess = dlg; +// dlg_base = dlg; +// } else { +// // try B2BDialog... +// err = 0; +// PySemsB2BDialog* b2b_dlg = (PySemsB2BDialog*)sipForceConvertTo_PySemsB2BDialog(dlg_inst,&err); +// if (b2b_dlg && (!err)) { +// DBG("OK, got PySemsB2BDialog.\n"); +// sess = b2b_dlg; +// dlg_base = b2b_dlg; +// } else { + +// // try B2ABDialog... +// err=0; +// PySemsB2ABDialog* b2ab_dlg = (PySemsB2ABDialog*)sipForceConvertTo_PySemsB2ABDialog(dlg_inst,&err); + +// // if (b2ab_dlg && (!err)) { +// // DBG("OK, got PySemsB2ABDialog.\n"); +// // sess = b2ab_dlg; +// // dlg_base = b2ab_dlg; +// // } else { +// // no luck +// PyErr_Print(); +// ERROR("PySemsFactory: while loading \"%s\": could not retrieve a PySems*Dialog ptr.\n", +// name.c_str()); +// throw AmSession::Exception(500,"Internal error in PY_SEMS plug-in."); +// Py_DECREF(dlg_inst); +// return NULL; +// } +// } +// } + // take the ownership over dlg sipTransferTo(dlg_inst,dlg_inst); Py_DECREF(dlg_inst); - dlg->setPyPtrs(NULL,dlg_inst); - - return dlg; + dlg_base->setPyPtrs(NULL,dlg_inst); + return sess; } bool PySemsFactory::loadScript(const string& path) @@ -256,6 +329,8 @@ bool PySemsFactory::loadScript(const string& path) PYLOCK; PyObject *modName,*mod,*dict, *dlg_class, *config=NULL; + PySemsScriptDesc::DialogType dt = PySemsScriptDesc::None; + modName = PyString_FromString(path.c_str()); mod = PyImport_Import(modName); @@ -288,9 +363,17 @@ bool PySemsFactory::loadScript(const string& path) } Py_INCREF(dlg_class); - - if(!PyObject_IsSubclass(dlg_class,(PyObject *)sipClass_PySemsDialog)){ - + + if(PyObject_IsSubclass(dlg_class,(PyObject *)sipClass_PySemsDialog)) { + dt = PySemsScriptDesc::Dialog; + DBG("Loaded a Dialog Script.\n"); + } else if (PyObject_IsSubclass(dlg_class,(PyObject *)sipClass_PySemsB2BDialog)) { + DBG("Loaded a B2BDialog Script.\n"); + dt = PySemsScriptDesc::B2BDialog; + } else if (PyObject_IsSubclass(dlg_class,(PyObject *)sipClass_PySemsB2ABDialog)) { + DBG("Loaded a B2ABDialog Script.\n"); + dt = PySemsScriptDesc::B2ABDialog; + } else { WARN("PySemsFactory: in \"%s\": PySemsScript is not a " "subtype of PySemsDialog\n", path.c_str()); @@ -319,7 +402,7 @@ bool PySemsFactory::loadScript(const string& path) PyObject_SetAttrString(mod,"config",config); mod_reg.insert(make_pair(path, - PySemsScriptDesc(mod,dlg_class))); + PySemsScriptDesc(mod,dlg_class, dt))); return true; @@ -427,100 +510,26 @@ AmSession* PySemsFactory::onInvite(const AmSipRequest& req) return newDlg(req.user); } -PySemsDialog::PySemsDialog() - : py_mod(NULL), - py_dlg(NULL), - playlist(this), - user_timer(NULL) +// PySemsDialogBase - base class for all possible PySemsDialog classes +PySemsDialogBase::PySemsDialogBase() + : py_mod(NULL), + py_dlg(NULL) { - sip_relay_only = false; } -PySemsDialog::PySemsDialog(AmDynInvoke* user_timer) - : py_mod(NULL), - py_dlg(NULL), - playlist(this), - user_timer(user_timer) -{ - sip_relay_only = false; -} - - -PySemsDialog::~PySemsDialog() -{ +PySemsDialogBase::~PySemsDialogBase() { PYLOCK; Py_XDECREF(py_dlg); } -void PySemsDialog::setPyPtrs(PyObject *mod, PyObject *dlg) +void PySemsDialogBase::setPyPtrs(PyObject *mod, PyObject *dlg) { PYLOCK; Py_XDECREF(py_dlg); py_dlg = dlg; } -static PyObject * -type_error(const char *msg) -{ - PyErr_SetString(PyExc_TypeError, msg); - return NULL; -} - -static PyObject * -null_error(void) -{ - if (!PyErr_Occurred()) - PyErr_SetString(PyExc_SystemError, - "null argument to internal routine"); - return NULL; -} - -PyObject * -PyObject_VaCallMethod(PyObject *o, char *name, char *format, va_list va) -{ - PyObject *args, *func = 0, *retval; - - if (o == NULL || name == NULL) - return null_error(); - - func = PyObject_GetAttrString(o, name); - if (func == NULL) { - PyErr_SetString(PyExc_AttributeError, name); - return 0; - } - - if (!PyCallable_Check(func)) - return type_error("call of non-callable attribute"); - - if (format && *format) { - args = Py_VaBuildValue(format, va); - } - else - args = PyTuple_New(0); - - if (!args) - return NULL; - - if (!PyTuple_Check(args)) { - PyObject *a; - - a = PyTuple_New(1); - if (a == NULL) - return NULL; - if (PyTuple_SetItem(a, 0, args) < 0) - return NULL; - args = a; - } - - retval = PyObject_Call(func, args, NULL); - - Py_DECREF(args); - Py_DECREF(func); - - return retval; -} - -bool PySemsDialog::callPyEventHandler(char* name, char* fmt, ...) +bool PySemsDialogBase::callPyEventHandler(char* name, char* fmt, ...) { bool ret=false; va_list va; @@ -552,35 +561,3 @@ bool PySemsDialog::callPyEventHandler(char* name, char* fmt, ...) return ret; } - -void PySemsDialog::onSessionStart(const AmSipRequest& req) -{ - DBG("PySemsDialog::onSessionStart\n"); - setInOut(&playlist,&playlist); - AmB2BCallerSession::onSessionStart(req); -} - -void PySemsDialog::process(AmEvent* event) -{ - DBG("PySemsDialog::process\n"); - - AmAudioEvent* audio_event = dynamic_cast(event); - if(audio_event && audio_event->event_id == AmAudioEvent::noAudio){ - - callPyEventHandler("onEmptyQueue", NULL); - event->processed = true; - } - - AmPluginEvent* plugin_event = dynamic_cast(event); - if(plugin_event && plugin_event->name == "timer_timeout") { - - callPyEventHandler("onTimer", "i", plugin_event->data.get(0).asInt()); - event->processed = true; - } - - if (!event->processed) - AmB2BCallerSession::process(event); - - return; -} - diff --git a/apps/py_sems/PySems.h b/apps/py_sems/PySems.h index 3c2d57f7..4ea2f59a 100644 --- a/apps/py_sems/PySems.h +++ b/apps/py_sems/PySems.h @@ -1,5 +1,6 @@ /* * $Id: PySems.h,v 1.15.2.1 2005/09/02 13:47:46 rco Exp $ + * * Copyright (C) 2002-2003 Fhg Fokus * * This file is part of sems, a free SIP media server. @@ -38,27 +39,39 @@ using std::string; using std::map; -class PySemsDialog; +class PySemsDialogBase; struct PySemsScriptDesc { + enum DialogType { + None = 0, + Dialog, + B2BDialog, + B2ABDialog + }; + PyObject* mod; PyObject* dlg_class; + DialogType dt; PySemsScriptDesc() : mod(0), - dlg_class(0) + dlg_class(0), + dt(None) {} PySemsScriptDesc(const PySemsScriptDesc& d) : mod(d.mod), - dlg_class(d.dlg_class) + dlg_class(d.dlg_class), + dt(d.dt) {} PySemsScriptDesc(PyObject* mod, - PyObject* dlg_class) + PyObject* dlg_class, + DialogType dt) : mod(mod), - dlg_class(dlg_class) + dlg_class(dlg_class), + dt(dt) {} }; @@ -87,7 +100,7 @@ class PySemsFactory: public AmSessionFactory void setScriptPath(const string& path); bool checkCfg(); - PySemsDialog* newDlg(const string& name); + AmSession* newDlg(const string& name); public: PySemsFactory(const string& _app_name); @@ -96,30 +109,19 @@ class PySemsFactory: public AmSessionFactory AmSession* onInvite(const AmSipRequest& req); }; - -class PySemsDialog : public AmB2BCallerSession -{ +class PySemsDialogBase { PyObject *py_mod; PyObject *py_dlg; + protected: bool callPyEventHandler(char* name, char* fmt, ...); -public: - AmDynInvoke* user_timer; - AmPlaylist playlist; - - PySemsDialog(); - PySemsDialog(AmDynInvoke* user_timer); - ~PySemsDialog(); + public: + PySemsDialogBase(); + ~PySemsDialogBase(); // must be called before everything else. void setPyPtrs(PyObject *mod, PyObject *dlg); - - void onSessionStart(const AmSipRequest& req); - - // @see AmEventHandler - void process(AmEvent* event); - }; #endif diff --git a/apps/py_sems/PySemsB2ABDialog.cpp b/apps/py_sems/PySemsB2ABDialog.cpp new file mode 100644 index 00000000..e964a535 --- /dev/null +++ b/apps/py_sems/PySemsB2ABDialog.cpp @@ -0,0 +1,70 @@ +/* + * $Id: PySemsDialog.h,v 1.26.2.1 2005/09/02 13:47:46 rco Exp $ + * + * Copyright (C) 2006 iptego GmbH + * + * This file is part of sems, a free SIP media server. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include "PySemsB2ABDialog.h" +#include "PySemsUtils.h" +PySemsB2ABDialog::PySemsB2ABDialog() + : playlist(this), + user_timer(NULL) +{ +} + +PySemsB2ABDialog::PySemsB2ABDialog(AmDynInvoke* user_timer) + : playlist(this), + user_timer(user_timer) +{ +} + +PySemsB2ABDialog::~PySemsB2ABDialog() +{ +} + +void PySemsB2ABDialog::onSessionStart(const AmSipRequest& req) +{ + DBG("PySemsB2ABDialog::onSessionStart\n"); + setInOut(&playlist,&playlist); + AmB2ABCallerSession::onSessionStart(req); +} + +void PySemsB2ABDialog::process(AmEvent* event) +{ + DBG("PySemsB2ABDialog::process\n"); + + AmAudioEvent* audio_event = dynamic_cast(event); + if(audio_event && audio_event->event_id == AmAudioEvent::noAudio){ + + callPyEventHandler("onEmptyQueue", NULL); + event->processed = true; + } + + AmPluginEvent* plugin_event = dynamic_cast(event); + if(plugin_event && plugin_event->name == "timer_timeout") { + + callPyEventHandler("onTimer", "i", plugin_event->data.get(0).asInt()); + event->processed = true; + } + + if (!event->processed) + AmB2ABCallerSession::process(event); + + return; +} + diff --git a/apps/py_sems/PySemsB2ABDialog.h b/apps/py_sems/PySemsB2ABDialog.h new file mode 100644 index 00000000..8350c561 --- /dev/null +++ b/apps/py_sems/PySemsB2ABDialog.h @@ -0,0 +1,47 @@ +/* + * $Id: PySemsDialog.h,v 1.26.2.1 2005/09/02 13:47:46 rco Exp $ + * + * Copyright (C) 2006 iptego GmbH + * + * This file is part of sems, a free SIP media server. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef PY_SEMSB2ABDIALOG_H +#define PY_SEMSB2ABDIALOG_H + +#include "AmApi.h" +#include "AmB2ABSession.h" +#include "AmPlaylist.h" +#include "PySems.h" + +class PySemsB2ABDialog : public AmB2ABCallerSession, + public PySemsDialogBase +{ +public: + AmDynInvoke* user_timer; + AmPlaylist playlist; + + PySemsB2ABDialog(); + PySemsB2ABDialog(AmDynInvoke* user_timer); + ~PySemsB2ABDialog(); + + void onSessionStart(const AmSipRequest& req); + + // @see AmEventHandler + void process(AmEvent* event); +}; + +#endif diff --git a/apps/py_sems/PySemsB2BDialog.cpp b/apps/py_sems/PySemsB2BDialog.cpp new file mode 100644 index 00000000..eefba6bc --- /dev/null +++ b/apps/py_sems/PySemsB2BDialog.cpp @@ -0,0 +1,73 @@ +/* + * $Id: PySemsDialog.h,v 1.26.2.1 2005/09/02 13:47:46 rco Exp $ + * + * Copyright (C) 2002-2003 Fhg Fokus + * Copyright (C) 2006 iptego GmbH + * + * This file is part of sems, a free SIP media server. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include "PySemsB2BDialog.h" +#include "PySemsUtils.h" +PySemsB2BDialog::PySemsB2BDialog() + : playlist(this), + user_timer(NULL) +{ + sip_relay_only = false; +} + +PySemsB2BDialog::PySemsB2BDialog(AmDynInvoke* user_timer) + : playlist(this), + user_timer(user_timer) +{ + sip_relay_only = false; +} + +PySemsB2BDialog::~PySemsB2BDialog() +{ +} + +void PySemsB2BDialog::onSessionStart(const AmSipRequest& req) +{ + DBG("PySemsB2BDialog::onSessionStart\n"); + setInOut(&playlist,&playlist); + AmB2BCallerSession::onSessionStart(req); +} + +void PySemsB2BDialog::process(AmEvent* event) +{ + DBG("PySemsB2BDialog::process\n"); + + AmAudioEvent* audio_event = dynamic_cast(event); + if(audio_event && audio_event->event_id == AmAudioEvent::noAudio){ + + callPyEventHandler("onEmptyQueue", NULL); + event->processed = true; + } + + AmPluginEvent* plugin_event = dynamic_cast(event); + if(plugin_event && plugin_event->name == "timer_timeout") { + + callPyEventHandler("onTimer", "i", plugin_event->data.get(0).asInt()); + event->processed = true; + } + + if (!event->processed) + AmB2BCallerSession::process(event); + + return; +} + diff --git a/apps/py_sems/PySemsB2BDialog.h b/apps/py_sems/PySemsB2BDialog.h new file mode 100644 index 00000000..14b0781d --- /dev/null +++ b/apps/py_sems/PySemsB2BDialog.h @@ -0,0 +1,48 @@ +/* + * $Id: PySemsDialog.h,v 1.26.2.1 2005/09/02 13:47:46 rco Exp $ + * + * Copyright (C) 2002-2003 Fhg Fokus + * Copyright (C) 2006 iptego GmbH + * + * This file is part of sems, a free SIP media server. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef PY_SEMSB2BDIALOG_H +#define PY_SEMSB2BDIALOG_H + +#include "AmApi.h" +#include "AmB2BSession.h" +#include "AmPlaylist.h" +#include "PySems.h" + +class PySemsB2BDialog : public AmB2BCallerSession, + public PySemsDialogBase +{ +public: + AmDynInvoke* user_timer; + AmPlaylist playlist; + + PySemsB2BDialog(); + PySemsB2BDialog(AmDynInvoke* user_timer); + ~PySemsB2BDialog(); + + void onSessionStart(const AmSipRequest& req); + + // @see AmEventHandler + void process(AmEvent* event); +}; + +#endif diff --git a/apps/py_sems/PySemsDialog.cpp b/apps/py_sems/PySemsDialog.cpp new file mode 100644 index 00000000..f2d7e7bb --- /dev/null +++ b/apps/py_sems/PySemsDialog.cpp @@ -0,0 +1,75 @@ +/* + * $Id: PySemsDialog.cpp,v 1.26.2.1 2005/09/02 13:47:46 rco Exp $ + * + * Copyright (C) 2002-2003 Fhg Fokus + * Copyright (C) 2006 iptego GmbH + * + * This file is part of sems, a free SIP media server. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include "PySemsDialog.h" +#include "PySemsUtils.h" + +PySemsDialog::PySemsDialog() + : playlist(this), + user_timer(NULL) +{ +} + +PySemsDialog::PySemsDialog(AmDynInvoke* user_timer) + : playlist(this), + user_timer(user_timer) +{ +} + + +PySemsDialog::~PySemsDialog() +{ +} + + + +void PySemsDialog::onSessionStart(const AmSipRequest& req) +{ + DBG("PySemsDialog::onSessionStart\n"); + setInOut(&playlist,&playlist); + AmSession::onSessionStart(req); +} + +void PySemsDialog::process(AmEvent* event) +{ + DBG("PySemsDialog::process\n"); + + AmAudioEvent* audio_event = dynamic_cast(event); + if(audio_event && audio_event->event_id == AmAudioEvent::noAudio){ + + callPyEventHandler("onEmptyQueue", NULL); + event->processed = true; + } + + AmPluginEvent* plugin_event = dynamic_cast(event); + if(plugin_event && plugin_event->name == "timer_timeout") { + + callPyEventHandler("onTimer", "i", plugin_event->data.get(0).asInt()); + event->processed = true; + } + + if (!event->processed) + AmSession::process(event); + + return; +} + diff --git a/apps/py_sems/PySemsDialog.h b/apps/py_sems/PySemsDialog.h new file mode 100644 index 00000000..75459800 --- /dev/null +++ b/apps/py_sems/PySemsDialog.h @@ -0,0 +1,52 @@ +/* + * $Id: PySemsDialog.h,v 1.26.2.1 2005/09/02 13:47:46 rco Exp $ + * + * Copyright (C) 2002-2003 Fhg Fokus + * Copyright (C) 2006 iptego GmbH + * + * This file is part of sems, a free SIP media server. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef PY_SEMS_DIALOG_H +#define PY_SEMS_DIALOG_H + +#include + +#include "AmSession.h" +#include "AmApi.h" +#include "AmPlaylist.h" +#include "PySems.h" + +class PySemsDialog : public AmSession, + public PySemsDialogBase +{ + +public: + AmDynInvoke* user_timer; + AmPlaylist playlist; + + PySemsDialog(); + PySemsDialog(AmDynInvoke* user_timer); + ~PySemsDialog(); + + void onSessionStart(const AmSipRequest& req); + + // @see AmEventHandler + void process(AmEvent* event); + +}; + +#endif diff --git a/apps/py_sems/PySemsUtils.cpp b/apps/py_sems/PySemsUtils.cpp new file mode 100644 index 00000000..b125798a --- /dev/null +++ b/apps/py_sems/PySemsUtils.cpp @@ -0,0 +1,84 @@ +/* + * $Id: PySemsUtils.h,v 1.26.2.1 2005/09/02 13:47:46 rco Exp $ + * + * Copyright (C) 2002-2003 Fhg Fokus + * + * This file is part of sems, a free SIP media server. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "PySemsUtils.h" + +PyObject * +type_error(const char *msg) +{ + PyErr_SetString(PyExc_TypeError, msg); + return NULL; +} + +PyObject * +null_error(void) +{ + if (!PyErr_Occurred()) + PyErr_SetString(PyExc_SystemError, + "null argument to internal routine"); + return NULL; +} + +PyObject * +PyObject_VaCallMethod(PyObject *o, char *name, char *format, va_list va) +{ + PyObject *args, *func = 0, *retval; + + if (o == NULL || name == NULL) + return null_error(); + + func = PyObject_GetAttrString(o, name); + if (func == NULL) { + PyErr_SetString(PyExc_AttributeError, name); + return 0; + } + + if (!PyCallable_Check(func)) + return type_error("call of non-callable attribute"); + + if (format && *format) { + args = Py_VaBuildValue(format, va); + } + else + args = PyTuple_New(0); + + if (!args) + return NULL; + + if (!PyTuple_Check(args)) { + PyObject *a; + + a = PyTuple_New(1); + if (a == NULL) + return NULL; + if (PyTuple_SetItem(a, 0, args) < 0) + return NULL; + args = a; + } + + retval = PyObject_Call(func, args, NULL); + + Py_DECREF(args); + Py_DECREF(func); + + return retval; +} diff --git a/apps/py_sems/PySemsUtils.h b/apps/py_sems/PySemsUtils.h new file mode 100644 index 00000000..82515f25 --- /dev/null +++ b/apps/py_sems/PySemsUtils.h @@ -0,0 +1,31 @@ +/* + * $Id: PySemsUtils.h,v 1.26.2.1 2005/09/02 13:47:46 rco Exp $ + * + * Copyright (C) 2002-2003 Fhg Fokus + * + * This file is part of sems, a free SIP media server. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef PY_SEMS_UTILS_H +#define PY_SEMS_UTILS_H + +#include + +PyObject * type_error(const char *msg); +PyObject * null_error(void); +PyObject * PyObject_VaCallMethod(PyObject *o, char *name, char *format, va_list va); + +#endif diff --git a/apps/py_sems/sip/Makefile.gen b/apps/py_sems/sip/Makefile.gen index e4942285..c8009dad 100644 --- a/apps/py_sems/sip/Makefile.gen +++ b/apps/py_sems/sip/Makefile.gen @@ -1,6 +1,6 @@ TARGET = py_sems_lib.so -OFILES = sippy_sems_libcmodule.o sippy_sems_libPySemsDialog.o sippy_sems_libAmAudioFile.o sippy_sems_libAmAudioEvent.o sippy_sems_libAmEvent.o sippy_sems_libAmSipDialog.o sippy_sems_libAmSipReply.o sippy_sems_libAmSipRequest.o sippy_sems_libstring.o -HFILES = sipAPIpy_sems_lib.h sippy_sems_libPySemsDialog.h sippy_sems_libAmAudioFile.h sippy_sems_libAmAudioEvent.h sippy_sems_libAmEvent.h sippy_sems_libAmSipDialog.h sippy_sems_libAmSipReply.h sippy_sems_libAmSipRequest.h sippy_sems_libstring.h +OFILES = sippy_sems_libcmodule.o sippy_sems_libPySemsB2ABDialog.o sippy_sems_libPySemsB2BDialog.o sippy_sems_libPySemsDialog.o sippy_sems_libAmAudioFile.o sippy_sems_libAmAudioEvent.o sippy_sems_libAmEvent.o sippy_sems_libAmSipDialog.o sippy_sems_libAmSipReply.o sippy_sems_libAmSipRequest.o sippy_sems_libstring.o +HFILES = sipAPIpy_sems_lib.h sippy_sems_libPySemsB2ABDialog.h sippy_sems_libPySemsB2BDialog.h sippy_sems_libPySemsDialog.h sippy_sems_libAmAudioFile.h sippy_sems_libAmAudioEvent.h sippy_sems_libAmEvent.h sippy_sems_libAmSipDialog.h sippy_sems_libAmSipReply.h sippy_sems_libAmSipRequest.h sippy_sems_libstring.h CC = gcc CXX = g++ @@ -42,6 +42,8 @@ install: $(TARGET) clean: -rm -f $(TARGET) -rm -f sippy_sems_libcmodule.o + -rm -f sippy_sems_libPySemsB2ABDialog.o + -rm -f sippy_sems_libPySemsB2BDialog.o -rm -f sippy_sems_libPySemsDialog.o -rm -f sippy_sems_libAmAudioFile.o -rm -f sippy_sems_libAmAudioEvent.o diff --git a/apps/py_sems/sip/PySemsB2ABDialog.sip b/apps/py_sems/sip/PySemsB2ABDialog.sip new file mode 100644 index 00000000..455eb03e --- /dev/null +++ b/apps/py_sems/sip/PySemsB2ABDialog.sip @@ -0,0 +1,43 @@ + + +class PySemsB2ABDialog +{ +%TypeHeaderCode +#include "../PySemsB2ABDialog.h" +%End + +public: + + AmSipDialog dlg; + + PySemsB2ABDialog(); + + virtual ~PySemsB2ABDialog(); +%MethodCode + fprintf(stderr,"------------- dealloc_PySemsB2ABDialog ----------\n"); +%End + + int acceptAudio(const string& /* body */, + const string& /* hdrs */, + string* /Out/ /* sdp_reply */); + + void setStopped(); + + virtual void onInvite(const AmSipRequest& /* req */); + virtual void onSessionStart(const AmSipRequest& /* req */); + virtual void onCancel(); + + virtual void onBye(const AmSipRequest& /* req */); + virtual void onDtmf(int /* event */, int /* duration_msec */); + + + void setInput(AmAudioFile* /In/ /*in*/); + void setOutput(AmAudioFile* /In/ /*out*/); + void setInOut(AmAudioFile* /In/ /*in*/, AmAudioFile* /*out*/); + + virtual void process(AmEvent* /*In,Out*/); + + +private: + PySemsB2ABDialog(const PySemsB2ABDialog&); +}; diff --git a/apps/py_sems/sip/PySemsB2BDialog.sip b/apps/py_sems/sip/PySemsB2BDialog.sip new file mode 100644 index 00000000..5f684a64 --- /dev/null +++ b/apps/py_sems/sip/PySemsB2BDialog.sip @@ -0,0 +1,43 @@ + + +class PySemsB2BDialog +{ +%TypeHeaderCode +#include "../PySemsB2BDialog.h" +%End + +public: + + AmSipDialog dlg; + + PySemsB2BDialog(); + + virtual ~PySemsB2BDialog(); +%MethodCode + fprintf(stderr,"------------- dealloc_PySemsB2BDialog ----------\n"); +%End + + int acceptAudio(const string& /* body */, + const string& /* hdrs */, + string* /Out/ /* sdp_reply */); + + void setStopped(); + + virtual void onInvite(const AmSipRequest& /* req */); + virtual void onSessionStart(const AmSipRequest& /* req */); + virtual void onCancel(); + + virtual void onBye(const AmSipRequest& /* req */); + virtual void onDtmf(int /* event */, int /* duration_msec */); + + + void setInput(AmAudioFile* /In/ /*in*/); + void setOutput(AmAudioFile* /In/ /*out*/); + void setInOut(AmAudioFile* /In/ /*in*/, AmAudioFile* /*out*/); + + virtual void process(AmEvent* /*In,Out*/); + + +private: + PySemsB2BDialog(const PySemsB2BDialog&); +}; diff --git a/apps/py_sems/sip/PySemsDialog.sip b/apps/py_sems/sip/PySemsDialog.sip index 327c8793..ff1eabda 100644 --- a/apps/py_sems/sip/PySemsDialog.sip +++ b/apps/py_sems/sip/PySemsDialog.sip @@ -3,7 +3,7 @@ class PySemsDialog { %TypeHeaderCode -#include "../PySems.h" +#include "../PySemsDialog.h" %End public: diff --git a/apps/py_sems/sip/py_sems.sbf b/apps/py_sems/sip/py_sems.sbf index c2ec31d3..c5911a2c 100644 --- a/apps/py_sems/sip/py_sems.sbf +++ b/apps/py_sems/sip/py_sems.sbf @@ -1,3 +1,3 @@ target = py_sems_lib -sources = sippy_sems_libcmodule.cpp sippy_sems_libPySemsDialog.cpp sippy_sems_libAmAudioFile.cpp sippy_sems_libAmAudioEvent.cpp sippy_sems_libAmEvent.cpp sippy_sems_libAmSipDialog.cpp sippy_sems_libAmSipReply.cpp sippy_sems_libAmSipRequest.cpp sippy_sems_libstring.cpp -headers = sipAPIpy_sems_lib.h sippy_sems_libPySemsDialog.h sippy_sems_libAmAudioFile.h sippy_sems_libAmAudioEvent.h sippy_sems_libAmEvent.h sippy_sems_libAmSipDialog.h sippy_sems_libAmSipReply.h sippy_sems_libAmSipRequest.h sippy_sems_libstring.h +sources = sippy_sems_libcmodule.cpp sippy_sems_libPySemsB2ABDialog.cpp sippy_sems_libPySemsB2BDialog.cpp sippy_sems_libPySemsDialog.cpp sippy_sems_libAmAudioFile.cpp sippy_sems_libAmAudioEvent.cpp sippy_sems_libAmEvent.cpp sippy_sems_libAmSipDialog.cpp sippy_sems_libAmSipReply.cpp sippy_sems_libAmSipRequest.cpp sippy_sems_libstring.cpp +headers = sipAPIpy_sems_lib.h sippy_sems_libPySemsB2ABDialog.h sippy_sems_libPySemsB2BDialog.h sippy_sems_libPySemsDialog.h sippy_sems_libAmAudioFile.h sippy_sems_libAmAudioEvent.h sippy_sems_libAmEvent.h sippy_sems_libAmSipDialog.h sippy_sems_libAmSipReply.h sippy_sems_libAmSipRequest.h sippy_sems_libstring.h diff --git a/apps/py_sems/sip/py_sems.sip b/apps/py_sems/sip/py_sems.sip index 19014320..66854206 100644 --- a/apps/py_sems/sip/py_sems.sip +++ b/apps/py_sems/sip/py_sems.sip @@ -6,4 +6,6 @@ %Include AmSipDialog.sip %Include AmAudio.sip %Include PySemsDialog.sip +%Include PySemsB2BDialog.sip +%Include PySemsB2ABDialog.sip %Include AmUtils.sip diff --git a/apps/py_sems/sip/sipAPIpy_sems_lib.h b/apps/py_sems/sip/sipAPIpy_sems_lib.h index 04840202..5887c1b8 100644 --- a/apps/py_sems/sip/sipAPIpy_sems_lib.h +++ b/apps/py_sems/sip/sipAPIpy_sems_lib.h @@ -1,7 +1,7 @@ /* * Internal module API header file. * - * Generated by SIP 4.5.2 (4.5.2) on Tue Feb 20 15:24:56 2007 + * Generated by SIP 4.5.2 (4.5.2) on Wed Mar 28 22:59:14 2007 */ #ifndef _py_sems_libAPI_H @@ -19,6 +19,8 @@ * These are part of the public API. */ +#define sipName_PySemsB2ABDialog sipNm_py_sems_lib_PySemsB2ABDialog +#define sipName_PySemsB2BDialog sipNm_py_sems_lib_PySemsB2BDialog #define sipName_PySemsDialog sipNm_py_sems_lib_PySemsDialog #define sipName_AmAudioFile sipNm_py_sems_lib_AmAudioFile #define sipName_AmAudioEvent sipNm_py_sems_lib_AmAudioEvent @@ -107,6 +109,8 @@ /* The strings used by this module. */ extern char sipNm_py_sems_lib_get_header_param[]; +extern char sipNm_py_sems_lib_PySemsB2ABDialog[]; +extern char sipNm_py_sems_lib_PySemsB2BDialog[]; extern char sipNm_py_sems_lib_process[]; extern char sipNm_py_sems_lib_setInOut[]; extern char sipNm_py_sems_lib_setOutput[]; diff --git a/apps/py_sems/sip/sippy_sems_libAmAudioEvent.cpp b/apps/py_sems/sip/sippy_sems_libAmAudioEvent.cpp index a9f144d7..a29a6e3d 100644 --- a/apps/py_sems/sip/sippy_sems_libAmAudioEvent.cpp +++ b/apps/py_sems/sip/sippy_sems_libAmAudioEvent.cpp @@ -1,7 +1,7 @@ /* * Interface wrapper code. * - * Generated by SIP 4.5.2 (4.5.2) on Tue Feb 20 15:24:56 2007 + * Generated by SIP 4.5.2 (4.5.2) on Wed Mar 28 22:59:14 2007 */ #include "sipAPIpy_sems_lib.h" @@ -126,7 +126,7 @@ static void *forceConvertTo_AmAudioEvent(PyObject *valobj,int *iserrp) /* Define this type's super-types. */ -static sipEncodedClassDef supers_AmAudioEvent[] = {{2, 255, 1}}; +static sipEncodedClassDef supers_AmAudioEvent[] = {{4, 255, 1}}; static sipEnumMemberDef enummembers_AmAudioEvent[] = { {sipNm_py_sems_lib_cleared, AmAudioEvent::cleared, 1}, diff --git a/apps/py_sems/sip/sippy_sems_libAmAudioEvent.h b/apps/py_sems/sip/sippy_sems_libAmAudioEvent.h index f20171b8..c9db5dd6 100644 --- a/apps/py_sems/sip/sippy_sems_libAmAudioEvent.h +++ b/apps/py_sems/sip/sippy_sems_libAmAudioEvent.h @@ -1,7 +1,7 @@ /* * Interface header file. * - * Generated by SIP 4.5.2 (4.5.2) on Tue Feb 20 15:24:56 2007 + * Generated by SIP 4.5.2 (4.5.2) on Wed Mar 28 22:59:14 2007 */ #ifndef _py_sems_libAmAudioEvent_h @@ -11,7 +11,7 @@ #include "../../../core/AmAudio.h" #line 13 "sippy_sems_libAmAudioEvent.h" -#define sipClass_AmAudioEvent sipModuleAPI_py_sems_lib.em_types[3] +#define sipClass_AmAudioEvent sipModuleAPI_py_sems_lib.em_types[5] #define sipCast_AmAudioEvent sipType_py_sems_lib_AmAudioEvent.td_cast #define sipForceConvertTo_AmAudioEvent sipType_py_sems_lib_AmAudioEvent.td_fcto diff --git a/apps/py_sems/sip/sippy_sems_libAmAudioFile.cpp b/apps/py_sems/sip/sippy_sems_libAmAudioFile.cpp index c6d246eb..576f9b66 100644 --- a/apps/py_sems/sip/sippy_sems_libAmAudioFile.cpp +++ b/apps/py_sems/sip/sippy_sems_libAmAudioFile.cpp @@ -1,7 +1,7 @@ /* * Interface wrapper code. * - * Generated by SIP 4.5.2 (4.5.2) on Tue Feb 20 15:24:56 2007 + * Generated by SIP 4.5.2 (4.5.2) on Wed Mar 28 22:59:14 2007 */ #include "sipAPIpy_sems_lib.h" diff --git a/apps/py_sems/sip/sippy_sems_libAmAudioFile.h b/apps/py_sems/sip/sippy_sems_libAmAudioFile.h index bc97e5ea..eee26d66 100644 --- a/apps/py_sems/sip/sippy_sems_libAmAudioFile.h +++ b/apps/py_sems/sip/sippy_sems_libAmAudioFile.h @@ -1,7 +1,7 @@ /* * Interface header file. * - * Generated by SIP 4.5.2 (4.5.2) on Tue Feb 20 15:24:56 2007 + * Generated by SIP 4.5.2 (4.5.2) on Wed Mar 28 22:59:14 2007 */ #ifndef _py_sems_libAmAudioFile_h @@ -11,7 +11,7 @@ #include "../../../core/AmAudio.h" #line 13 "sippy_sems_libAmAudioFile.h" -#define sipClass_AmAudioFile sipModuleAPI_py_sems_lib.em_types[1] +#define sipClass_AmAudioFile sipModuleAPI_py_sems_lib.em_types[3] #define sipCast_AmAudioFile sipType_py_sems_lib_AmAudioFile.td_cast #define sipForceConvertTo_AmAudioFile sipType_py_sems_lib_AmAudioFile.td_fcto diff --git a/apps/py_sems/sip/sippy_sems_libAmEvent.cpp b/apps/py_sems/sip/sippy_sems_libAmEvent.cpp index e1916d4e..4e91890c 100644 --- a/apps/py_sems/sip/sippy_sems_libAmEvent.cpp +++ b/apps/py_sems/sip/sippy_sems_libAmEvent.cpp @@ -1,7 +1,7 @@ /* * Interface wrapper code. * - * Generated by SIP 4.5.2 (4.5.2) on Tue Feb 20 15:24:56 2007 + * Generated by SIP 4.5.2 (4.5.2) on Wed Mar 28 22:59:14 2007 */ #include "sipAPIpy_sems_lib.h" diff --git a/apps/py_sems/sip/sippy_sems_libAmEvent.h b/apps/py_sems/sip/sippy_sems_libAmEvent.h index 6a60c788..dda90f94 100644 --- a/apps/py_sems/sip/sippy_sems_libAmEvent.h +++ b/apps/py_sems/sip/sippy_sems_libAmEvent.h @@ -1,7 +1,7 @@ /* * Interface header file. * - * Generated by SIP 4.5.2 (4.5.2) on Tue Feb 20 15:24:56 2007 + * Generated by SIP 4.5.2 (4.5.2) on Wed Mar 28 22:59:14 2007 */ #ifndef _py_sems_libAmEvent_h @@ -11,7 +11,7 @@ #include "../../../core/AmEvent.h" #line 13 "sippy_sems_libAmEvent.h" -#define sipClass_AmEvent sipModuleAPI_py_sems_lib.em_types[2] +#define sipClass_AmEvent sipModuleAPI_py_sems_lib.em_types[4] #define sipCast_AmEvent sipType_py_sems_lib_AmEvent.td_cast #define sipForceConvertTo_AmEvent sipType_py_sems_lib_AmEvent.td_fcto diff --git a/apps/py_sems/sip/sippy_sems_libAmSipDialog.cpp b/apps/py_sems/sip/sippy_sems_libAmSipDialog.cpp index 02d147c3..f6a5482b 100644 --- a/apps/py_sems/sip/sippy_sems_libAmSipDialog.cpp +++ b/apps/py_sems/sip/sippy_sems_libAmSipDialog.cpp @@ -1,7 +1,7 @@ /* * Interface wrapper code. * - * Generated by SIP 4.5.2 (4.5.2) on Tue Feb 20 15:24:56 2007 + * Generated by SIP 4.5.2 (4.5.2) on Wed Mar 28 22:59:14 2007 */ #include "sipAPIpy_sems_lib.h" diff --git a/apps/py_sems/sip/sippy_sems_libAmSipDialog.h b/apps/py_sems/sip/sippy_sems_libAmSipDialog.h index 4f6fa05a..a8a7e7da 100644 --- a/apps/py_sems/sip/sippy_sems_libAmSipDialog.h +++ b/apps/py_sems/sip/sippy_sems_libAmSipDialog.h @@ -1,7 +1,7 @@ /* * Interface header file. * - * Generated by SIP 4.5.2 (4.5.2) on Tue Feb 20 15:24:56 2007 + * Generated by SIP 4.5.2 (4.5.2) on Wed Mar 28 22:59:14 2007 */ #ifndef _py_sems_libAmSipDialog_h @@ -11,7 +11,7 @@ #include "../../../core/AmSipDialog.h" #line 13 "sippy_sems_libAmSipDialog.h" -#define sipClass_AmSipDialog sipModuleAPI_py_sems_lib.em_types[4] +#define sipClass_AmSipDialog sipModuleAPI_py_sems_lib.em_types[6] #define sipCast_AmSipDialog sipType_py_sems_lib_AmSipDialog.td_cast #define sipForceConvertTo_AmSipDialog sipType_py_sems_lib_AmSipDialog.td_fcto diff --git a/apps/py_sems/sip/sippy_sems_libAmSipReply.cpp b/apps/py_sems/sip/sippy_sems_libAmSipReply.cpp index 3c4cc2e1..cee6687b 100644 --- a/apps/py_sems/sip/sippy_sems_libAmSipReply.cpp +++ b/apps/py_sems/sip/sippy_sems_libAmSipReply.cpp @@ -1,7 +1,7 @@ /* * Interface wrapper code. * - * Generated by SIP 4.5.2 (4.5.2) on Tue Feb 20 15:24:56 2007 + * Generated by SIP 4.5.2 (4.5.2) on Wed Mar 28 22:59:14 2007 */ #include "sipAPIpy_sems_lib.h" diff --git a/apps/py_sems/sip/sippy_sems_libAmSipReply.h b/apps/py_sems/sip/sippy_sems_libAmSipReply.h index f6b09656..0726d402 100644 --- a/apps/py_sems/sip/sippy_sems_libAmSipReply.h +++ b/apps/py_sems/sip/sippy_sems_libAmSipReply.h @@ -1,7 +1,7 @@ /* * Interface header file. * - * Generated by SIP 4.5.2 (4.5.2) on Tue Feb 20 15:24:56 2007 + * Generated by SIP 4.5.2 (4.5.2) on Wed Mar 28 22:59:14 2007 */ #ifndef _py_sems_libAmSipReply_h @@ -11,7 +11,7 @@ #include "../../../core/AmSipReply.h" #line 13 "sippy_sems_libAmSipReply.h" -#define sipClass_AmSipReply sipModuleAPI_py_sems_lib.em_types[5] +#define sipClass_AmSipReply sipModuleAPI_py_sems_lib.em_types[7] #define sipCast_AmSipReply sipType_py_sems_lib_AmSipReply.td_cast #define sipForceConvertTo_AmSipReply sipType_py_sems_lib_AmSipReply.td_fcto diff --git a/apps/py_sems/sip/sippy_sems_libAmSipRequest.cpp b/apps/py_sems/sip/sippy_sems_libAmSipRequest.cpp index 3c69a979..2a56b5ea 100644 --- a/apps/py_sems/sip/sippy_sems_libAmSipRequest.cpp +++ b/apps/py_sems/sip/sippy_sems_libAmSipRequest.cpp @@ -1,7 +1,7 @@ /* * Interface wrapper code. * - * Generated by SIP 4.5.2 (4.5.2) on Tue Feb 20 15:24:56 2007 + * Generated by SIP 4.5.2 (4.5.2) on Wed Mar 28 22:59:14 2007 */ #include "sipAPIpy_sems_lib.h" diff --git a/apps/py_sems/sip/sippy_sems_libAmSipRequest.h b/apps/py_sems/sip/sippy_sems_libAmSipRequest.h index bc6048e0..e441a3ef 100644 --- a/apps/py_sems/sip/sippy_sems_libAmSipRequest.h +++ b/apps/py_sems/sip/sippy_sems_libAmSipRequest.h @@ -1,7 +1,7 @@ /* * Interface header file. * - * Generated by SIP 4.5.2 (4.5.2) on Tue Feb 20 15:24:56 2007 + * Generated by SIP 4.5.2 (4.5.2) on Wed Mar 28 22:59:14 2007 */ #ifndef _py_sems_libAmSipRequest_h @@ -11,7 +11,7 @@ #include "../../../core/AmSipRequest.h" #line 13 "sippy_sems_libAmSipRequest.h" -#define sipClass_AmSipRequest sipModuleAPI_py_sems_lib.em_types[6] +#define sipClass_AmSipRequest sipModuleAPI_py_sems_lib.em_types[8] #define sipCast_AmSipRequest sipType_py_sems_lib_AmSipRequest.td_cast #define sipForceConvertTo_AmSipRequest sipType_py_sems_lib_AmSipRequest.td_fcto diff --git a/apps/py_sems/sip/sippy_sems_libPySemsB2ABDialog.cpp b/apps/py_sems/sip/sippy_sems_libPySemsB2ABDialog.cpp new file mode 100644 index 00000000..71a955d1 --- /dev/null +++ b/apps/py_sems/sip/sippy_sems_libPySemsB2ABDialog.cpp @@ -0,0 +1,622 @@ +/* + * Interface wrapper code. + * + * Generated by SIP 4.5.2 (4.5.2) on Wed Mar 28 22:59:14 2007 + */ + +#include "sipAPIpy_sems_lib.h" +#include "sippy_sems_libPySemsB2ABDialog.h" + +#include "sippy_sems_libAmSipDialog.h" +#include "sippy_sems_libPySemsB2ABDialog.h" +#include "sippy_sems_libAmEvent.h" +#include "sippy_sems_libAmAudioFile.h" +#include "sippy_sems_libAmSipRequest.h" +#include "sippy_sems_libstring.h" + + +sipPySemsB2ABDialog::sipPySemsB2ABDialog(): PySemsB2ABDialog(), sipPySelf(0) +{ + sipTrace(SIP_TRACE_CTORS,"sipPySemsB2ABDialog::sipPySemsB2ABDialog() (this=0x%08x)\n",this); + + sipCommonCtor(sipPyMethods,6); +} + +sipPySemsB2ABDialog::~sipPySemsB2ABDialog() +{ + sipTrace(SIP_TRACE_DTORS,"sipPySemsB2ABDialog::~sipPySemsB2ABDialog() (this=0x%08x)\n",this); + + sipCommonDtor(sipPySelf); +} + +void sipPySemsB2ABDialog::onInvite(const AmSipRequest& a0) +{ + sipTrace(SIP_TRACE_CATCHERS,"void sipPySemsB2ABDialog::onInvite(const AmSipRequest&) (this=0x%08x)\n",this); + + extern void sipVH_py_sems_lib_2(sip_gilstate_t,PyObject *,const AmSipRequest&); + + sip_gilstate_t sipGILState; + PyObject *meth; + + meth = sipIsPyMethod(&sipGILState,&sipPyMethods[0],sipPySelf,NULL,sipNm_py_sems_lib_onInvite); + + if (!meth) + { + PySemsB2ABDialog::onInvite(a0); + return; + } + + sipVH_py_sems_lib_2(sipGILState,meth,a0); +} + +void sipPySemsB2ABDialog::onSessionStart(const AmSipRequest& a0) +{ + sipTrace(SIP_TRACE_CATCHERS,"void sipPySemsB2ABDialog::onSessionStart(const AmSipRequest&) (this=0x%08x)\n",this); + + extern void sipVH_py_sems_lib_2(sip_gilstate_t,PyObject *,const AmSipRequest&); + + sip_gilstate_t sipGILState; + PyObject *meth; + + meth = sipIsPyMethod(&sipGILState,&sipPyMethods[1],sipPySelf,NULL,sipNm_py_sems_lib_onSessionStart); + + if (!meth) + { + PySemsB2ABDialog::onSessionStart(a0); + return; + } + + sipVH_py_sems_lib_2(sipGILState,meth,a0); +} + +void sipPySemsB2ABDialog::onCancel() +{ + sipTrace(SIP_TRACE_CATCHERS,"void sipPySemsB2ABDialog::onCancel() (this=0x%08x)\n",this); + + extern void sipVH_py_sems_lib_3(sip_gilstate_t,PyObject *); + + sip_gilstate_t sipGILState; + PyObject *meth; + + meth = sipIsPyMethod(&sipGILState,&sipPyMethods[2],sipPySelf,NULL,sipNm_py_sems_lib_onCancel); + + if (!meth) + { + PySemsB2ABDialog::onCancel(); + return; + } + + sipVH_py_sems_lib_3(sipGILState,meth); +} + +void sipPySemsB2ABDialog::onBye(const AmSipRequest& a0) +{ + sipTrace(SIP_TRACE_CATCHERS,"void sipPySemsB2ABDialog::onBye(const AmSipRequest&) (this=0x%08x)\n",this); + + extern void sipVH_py_sems_lib_2(sip_gilstate_t,PyObject *,const AmSipRequest&); + + sip_gilstate_t sipGILState; + PyObject *meth; + + meth = sipIsPyMethod(&sipGILState,&sipPyMethods[3],sipPySelf,NULL,sipNm_py_sems_lib_onBye); + + if (!meth) + { + PySemsB2ABDialog::onBye(a0); + return; + } + + sipVH_py_sems_lib_2(sipGILState,meth,a0); +} + +void sipPySemsB2ABDialog::onDtmf(int a0,int a1) +{ + sipTrace(SIP_TRACE_CATCHERS,"void sipPySemsB2ABDialog::onDtmf(int,int) (this=0x%08x)\n",this); + + extern void sipVH_py_sems_lib_1(sip_gilstate_t,PyObject *,int,int); + + sip_gilstate_t sipGILState; + PyObject *meth; + + meth = sipIsPyMethod(&sipGILState,&sipPyMethods[4],sipPySelf,NULL,sipNm_py_sems_lib_onDtmf); + + if (!meth) + { + PySemsB2ABDialog::onDtmf(a0,a1); + return; + } + + sipVH_py_sems_lib_1(sipGILState,meth,a0,a1); +} + +void sipPySemsB2ABDialog::process(AmEvent *a0) +{ + sipTrace(SIP_TRACE_CATCHERS,"void sipPySemsB2ABDialog::process(AmEvent *) (this=0x%08x)\n",this); + + extern void sipVH_py_sems_lib_0(sip_gilstate_t,PyObject *,AmEvent *); + + sip_gilstate_t sipGILState; + PyObject *meth; + + meth = sipIsPyMethod(&sipGILState,&sipPyMethods[5],sipPySelf,NULL,sipNm_py_sems_lib_process); + + if (!meth) + { + PySemsB2ABDialog::process(a0); + return; + } + + sipVH_py_sems_lib_0(sipGILState,meth,a0); +} + + +extern "C" {static PyObject *meth_PySemsB2ABDialog_acceptAudio(PyObject *, PyObject *);} +static PyObject *meth_PySemsB2ABDialog_acceptAudio(PyObject *sipSelf,PyObject *sipArgs) +{ + sipTrace(SIP_TRACE_METHODS,"meth_PySemsB2ABDialog_acceptAudio()\n"); + + int sipArgsParsed = 0; + + { + const string * a0; + int a0State = 0; + const string * a1; + int a1State = 0; + string * a2; + PySemsB2ABDialog *sipCpp; + + if (sipParseArgs(&sipArgsParsed,sipArgs,"BM1M1",&sipSelf,sipClass_PySemsB2ABDialog,&sipCpp,sipMappedType_string,&a0,&a0State,sipMappedType_string,&a1,&a1State)) + { + int sipRes; + a2 = new string(); + + sipRes = sipCpp->acceptAudio(*a0,*a1,a2); + + sipReleaseMappedType(const_cast(a0),sipMappedType_string,a0State); + sipReleaseMappedType(const_cast(a1),sipMappedType_string,a1State); + + return sipBuildResult(0,"(iD)",sipRes,a2,sipMappedType_string,NULL); + } + } + + /* Raise an exception if the arguments couldn't be parsed. */ + sipNoMethod(sipArgsParsed,sipNm_py_sems_lib_PySemsB2ABDialog,sipNm_py_sems_lib_acceptAudio); + + return NULL; +} + + +extern "C" {static PyObject *meth_PySemsB2ABDialog_setStopped(PyObject *, PyObject *);} +static PyObject *meth_PySemsB2ABDialog_setStopped(PyObject *sipSelf,PyObject *sipArgs) +{ + sipTrace(SIP_TRACE_METHODS,"meth_PySemsB2ABDialog_setStopped()\n"); + + int sipArgsParsed = 0; + + { + PySemsB2ABDialog *sipCpp; + + if (sipParseArgs(&sipArgsParsed,sipArgs,"B",&sipSelf,sipClass_PySemsB2ABDialog,&sipCpp)) + { + sipCpp->setStopped(); + + Py_INCREF(Py_None); + return Py_None; + } + } + + /* Raise an exception if the arguments couldn't be parsed. */ + sipNoMethod(sipArgsParsed,sipNm_py_sems_lib_PySemsB2ABDialog,sipNm_py_sems_lib_setStopped); + + return NULL; +} + + +extern "C" {static PyObject *meth_PySemsB2ABDialog_onInvite(PyObject *, PyObject *);} +static PyObject *meth_PySemsB2ABDialog_onInvite(PyObject *sipSelf,PyObject *sipArgs) +{ + sipTrace(SIP_TRACE_METHODS,"meth_PySemsB2ABDialog_onInvite()\n"); + + int sipArgsParsed = 0; + bool sipSelfWasArg = !sipSelf; + + { + const AmSipRequest * a0; + PySemsB2ABDialog *sipCpp; + + if (sipParseArgs(&sipArgsParsed,sipArgs,"BJA",&sipSelf,sipClass_PySemsB2ABDialog,&sipCpp,sipClass_AmSipRequest,&a0)) + { + (sipSelfWasArg ? sipCpp->PySemsB2ABDialog::onInvite(*a0) : sipCpp->onInvite(*a0)); + + Py_INCREF(Py_None); + return Py_None; + } + } + + /* Raise an exception if the arguments couldn't be parsed. */ + sipNoMethod(sipArgsParsed,sipNm_py_sems_lib_PySemsB2ABDialog,sipNm_py_sems_lib_onInvite); + + return NULL; +} + + +extern "C" {static PyObject *meth_PySemsB2ABDialog_onSessionStart(PyObject *, PyObject *);} +static PyObject *meth_PySemsB2ABDialog_onSessionStart(PyObject *sipSelf,PyObject *sipArgs) +{ + sipTrace(SIP_TRACE_METHODS,"meth_PySemsB2ABDialog_onSessionStart()\n"); + + int sipArgsParsed = 0; + bool sipSelfWasArg = !sipSelf; + + { + const AmSipRequest * a0; + PySemsB2ABDialog *sipCpp; + + if (sipParseArgs(&sipArgsParsed,sipArgs,"BJA",&sipSelf,sipClass_PySemsB2ABDialog,&sipCpp,sipClass_AmSipRequest,&a0)) + { + (sipSelfWasArg ? sipCpp->PySemsB2ABDialog::onSessionStart(*a0) : sipCpp->onSessionStart(*a0)); + + Py_INCREF(Py_None); + return Py_None; + } + } + + /* Raise an exception if the arguments couldn't be parsed. */ + sipNoMethod(sipArgsParsed,sipNm_py_sems_lib_PySemsB2ABDialog,sipNm_py_sems_lib_onSessionStart); + + return NULL; +} + + +extern "C" {static PyObject *meth_PySemsB2ABDialog_onCancel(PyObject *, PyObject *);} +static PyObject *meth_PySemsB2ABDialog_onCancel(PyObject *sipSelf,PyObject *sipArgs) +{ + sipTrace(SIP_TRACE_METHODS,"meth_PySemsB2ABDialog_onCancel()\n"); + + int sipArgsParsed = 0; + bool sipSelfWasArg = !sipSelf; + + { + PySemsB2ABDialog *sipCpp; + + if (sipParseArgs(&sipArgsParsed,sipArgs,"B",&sipSelf,sipClass_PySemsB2ABDialog,&sipCpp)) + { + (sipSelfWasArg ? sipCpp->PySemsB2ABDialog::onCancel() : sipCpp->onCancel()); + + Py_INCREF(Py_None); + return Py_None; + } + } + + /* Raise an exception if the arguments couldn't be parsed. */ + sipNoMethod(sipArgsParsed,sipNm_py_sems_lib_PySemsB2ABDialog,sipNm_py_sems_lib_onCancel); + + return NULL; +} + + +extern "C" {static PyObject *meth_PySemsB2ABDialog_onBye(PyObject *, PyObject *);} +static PyObject *meth_PySemsB2ABDialog_onBye(PyObject *sipSelf,PyObject *sipArgs) +{ + sipTrace(SIP_TRACE_METHODS,"meth_PySemsB2ABDialog_onBye()\n"); + + int sipArgsParsed = 0; + bool sipSelfWasArg = !sipSelf; + + { + const AmSipRequest * a0; + PySemsB2ABDialog *sipCpp; + + if (sipParseArgs(&sipArgsParsed,sipArgs,"BJA",&sipSelf,sipClass_PySemsB2ABDialog,&sipCpp,sipClass_AmSipRequest,&a0)) + { + (sipSelfWasArg ? sipCpp->PySemsB2ABDialog::onBye(*a0) : sipCpp->onBye(*a0)); + + Py_INCREF(Py_None); + return Py_None; + } + } + + /* Raise an exception if the arguments couldn't be parsed. */ + sipNoMethod(sipArgsParsed,sipNm_py_sems_lib_PySemsB2ABDialog,sipNm_py_sems_lib_onBye); + + return NULL; +} + + +extern "C" {static PyObject *meth_PySemsB2ABDialog_onDtmf(PyObject *, PyObject *);} +static PyObject *meth_PySemsB2ABDialog_onDtmf(PyObject *sipSelf,PyObject *sipArgs) +{ + sipTrace(SIP_TRACE_METHODS,"meth_PySemsB2ABDialog_onDtmf()\n"); + + int sipArgsParsed = 0; + bool sipSelfWasArg = !sipSelf; + + { + int a0; + int a1; + PySemsB2ABDialog *sipCpp; + + if (sipParseArgs(&sipArgsParsed,sipArgs,"Bii",&sipSelf,sipClass_PySemsB2ABDialog,&sipCpp,&a0,&a1)) + { + (sipSelfWasArg ? sipCpp->PySemsB2ABDialog::onDtmf(a0,a1) : sipCpp->onDtmf(a0,a1)); + + Py_INCREF(Py_None); + return Py_None; + } + } + + /* Raise an exception if the arguments couldn't be parsed. */ + sipNoMethod(sipArgsParsed,sipNm_py_sems_lib_PySemsB2ABDialog,sipNm_py_sems_lib_onDtmf); + + return NULL; +} + + +extern "C" {static PyObject *meth_PySemsB2ABDialog_setInput(PyObject *, PyObject *);} +static PyObject *meth_PySemsB2ABDialog_setInput(PyObject *sipSelf,PyObject *sipArgs) +{ + sipTrace(SIP_TRACE_METHODS,"meth_PySemsB2ABDialog_setInput()\n"); + + int sipArgsParsed = 0; + + { + AmAudioFile * a0; + PySemsB2ABDialog *sipCpp; + + if (sipParseArgs(&sipArgsParsed,sipArgs,"BJ@",&sipSelf,sipClass_PySemsB2ABDialog,&sipCpp,sipClass_AmAudioFile,&a0)) + { + sipCpp->setInput(a0); + + Py_INCREF(Py_None); + return Py_None; + } + } + + /* Raise an exception if the arguments couldn't be parsed. */ + sipNoMethod(sipArgsParsed,sipNm_py_sems_lib_PySemsB2ABDialog,sipNm_py_sems_lib_setInput); + + return NULL; +} + + +extern "C" {static PyObject *meth_PySemsB2ABDialog_setOutput(PyObject *, PyObject *);} +static PyObject *meth_PySemsB2ABDialog_setOutput(PyObject *sipSelf,PyObject *sipArgs) +{ + sipTrace(SIP_TRACE_METHODS,"meth_PySemsB2ABDialog_setOutput()\n"); + + int sipArgsParsed = 0; + + { + AmAudioFile * a0; + PySemsB2ABDialog *sipCpp; + + if (sipParseArgs(&sipArgsParsed,sipArgs,"BJ@",&sipSelf,sipClass_PySemsB2ABDialog,&sipCpp,sipClass_AmAudioFile,&a0)) + { + sipCpp->setOutput(a0); + + Py_INCREF(Py_None); + return Py_None; + } + } + + /* Raise an exception if the arguments couldn't be parsed. */ + sipNoMethod(sipArgsParsed,sipNm_py_sems_lib_PySemsB2ABDialog,sipNm_py_sems_lib_setOutput); + + return NULL; +} + + +extern "C" {static PyObject *meth_PySemsB2ABDialog_setInOut(PyObject *, PyObject *);} +static PyObject *meth_PySemsB2ABDialog_setInOut(PyObject *sipSelf,PyObject *sipArgs) +{ + sipTrace(SIP_TRACE_METHODS,"meth_PySemsB2ABDialog_setInOut()\n"); + + int sipArgsParsed = 0; + + { + AmAudioFile * a0; + AmAudioFile * a1; + PySemsB2ABDialog *sipCpp; + + if (sipParseArgs(&sipArgsParsed,sipArgs,"BJ@J@",&sipSelf,sipClass_PySemsB2ABDialog,&sipCpp,sipClass_AmAudioFile,&a0,sipClass_AmAudioFile,&a1)) + { + sipCpp->setInOut(a0,a1); + + Py_INCREF(Py_None); + return Py_None; + } + } + + /* Raise an exception if the arguments couldn't be parsed. */ + sipNoMethod(sipArgsParsed,sipNm_py_sems_lib_PySemsB2ABDialog,sipNm_py_sems_lib_setInOut); + + return NULL; +} + + +extern "C" {static PyObject *meth_PySemsB2ABDialog_process(PyObject *, PyObject *);} +static PyObject *meth_PySemsB2ABDialog_process(PyObject *sipSelf,PyObject *sipArgs) +{ + sipTrace(SIP_TRACE_METHODS,"meth_PySemsB2ABDialog_process()\n"); + + int sipArgsParsed = 0; + bool sipSelfWasArg = !sipSelf; + + { + AmEvent * a0; + PySemsB2ABDialog *sipCpp; + + if (sipParseArgs(&sipArgsParsed,sipArgs,"BJ@",&sipSelf,sipClass_PySemsB2ABDialog,&sipCpp,sipClass_AmEvent,&a0)) + { + (sipSelfWasArg ? sipCpp->PySemsB2ABDialog::process(a0) : sipCpp->process(a0)); + + Py_INCREF(Py_None); + return Py_None; + } + } + + /* Raise an exception if the arguments couldn't be parsed. */ + sipNoMethod(sipArgsParsed,sipNm_py_sems_lib_PySemsB2ABDialog,sipNm_py_sems_lib_process); + + return NULL; +} + + +/* Cast a pointer to a type somewhere in its superclass hierarchy. */ +extern "C" {static void *cast_PySemsB2ABDialog(void *, sipWrapperType *);} +static void *cast_PySemsB2ABDialog(void *ptr,sipWrapperType *targetClass) +{ + if (targetClass == sipClass_PySemsB2ABDialog) + return ptr; + + return NULL; +} + + +/* Call the instance's destructor. */ +extern "C" {static void release_PySemsB2ABDialog(void *, int);} +static void release_PySemsB2ABDialog(void *ptr,int state) +{ + if (state & SIP_DERIVED_CLASS) + delete reinterpret_cast(ptr); + else + delete reinterpret_cast(ptr); +} + + +extern "C" {static void dealloc_PySemsB2ABDialog(sipWrapper *);} +static void dealloc_PySemsB2ABDialog(sipWrapper *sipSelf) +{ + sipTrace(SIP_TRACE_DEALLOCS,"dealloc_PySemsB2ABDialog()\n"); + + if (sipIsDerived(sipSelf)) + reinterpret_cast(sipSelf->u.cppPtr)->sipPySelf = NULL; + + if (sipIsPyOwned(sipSelf)) + { +#line 17 "PySemsB2ABDialog.sip" + fprintf(stderr,"------------- dealloc_PySemsB2ABDialog ----------\n"); +#line 500 "sippy_sems_libPySemsB2ABDialog.cpp" + + release_PySemsB2ABDialog(sipSelf->u.cppPtr,sipSelf->flags); + } +} + + +extern "C" {static void *init_PySemsB2ABDialog(sipWrapper *, PyObject *, sipWrapper **, int *);} +static void *init_PySemsB2ABDialog(sipWrapper *sipSelf,PyObject *sipArgs,sipWrapper **,int *sipArgsParsed) +{ + sipPySemsB2ABDialog *sipCpp = 0; + + sipTrace(SIP_TRACE_INITS,"init_PySemsB2ABDialog()\n"); + + if (!sipCpp) + { + if (sipParseArgs(sipArgsParsed,sipArgs,"")) + { + sipCpp = new sipPySemsB2ABDialog(); + } + } + + if (sipCpp) + sipCpp->sipPySelf = sipSelf; + + return sipCpp; +} + + +extern "C" {static PyObject *var_PySemsB2ABDialog_dlg(PyObject *, PyObject *);} +static PyObject *var_PySemsB2ABDialog_dlg(PyObject *sipSelf,PyObject *sipPy) +{ + int sipIsErr = 0; + AmSipDialog *sipVal; + PySemsB2ABDialog *sipCpp = reinterpret_cast(sipGetCppPtr((sipWrapper *)sipSelf,sipClass_PySemsB2ABDialog)); + + if (!sipCpp) + return NULL; + + if (sipPy == NULL) + { + sipVal = &sipCpp->dlg; + + sipPy = sipConvertFromInstance(sipVal,sipClass_AmSipDialog,NULL); + + return sipPy; + } + + sipVal = reinterpret_cast(sipForceConvertToInstance(sipPy,sipClass_AmSipDialog,NULL,SIP_NOT_NONE,NULL,&sipIsErr)); + + if (sipIsErr) + return NULL; + + sipCpp->dlg = *sipVal; + + Py_INCREF(Py_None); + return Py_None; +} + +PyMethodDef variables_PySemsB2ABDialog[] = { + {sipNm_py_sems_lib_dlg, var_PySemsB2ABDialog_dlg, 0, NULL}, + {0, 0, 0, 0} +}; + + +extern "C" {static void *forceConvertTo_PySemsB2ABDialog(PyObject *, int *);} +static void *forceConvertTo_PySemsB2ABDialog(PyObject *valobj,int *iserrp) +{ + if (*iserrp || valobj == NULL) + return NULL; + + if (valobj == Py_None || sipIsSubClassInstance(valobj,sipClass_PySemsB2ABDialog)) + return sipConvertToCpp(valobj,sipClass_PySemsB2ABDialog,iserrp); + + sipBadClass(sipNm_py_sems_lib_PySemsB2ABDialog); + + *iserrp = 1; + + return NULL; +} + + +static PyMethodDef methods_PySemsB2ABDialog[] = { + {sipNm_py_sems_lib_acceptAudio, meth_PySemsB2ABDialog_acceptAudio, METH_VARARGS, NULL}, + {sipNm_py_sems_lib_onBye, meth_PySemsB2ABDialog_onBye, METH_VARARGS, NULL}, + {sipNm_py_sems_lib_onCancel, meth_PySemsB2ABDialog_onCancel, METH_VARARGS, NULL}, + {sipNm_py_sems_lib_onDtmf, meth_PySemsB2ABDialog_onDtmf, METH_VARARGS, NULL}, + {sipNm_py_sems_lib_onInvite, meth_PySemsB2ABDialog_onInvite, METH_VARARGS, NULL}, + {sipNm_py_sems_lib_onSessionStart, meth_PySemsB2ABDialog_onSessionStart, METH_VARARGS, NULL}, + {sipNm_py_sems_lib_process, meth_PySemsB2ABDialog_process, METH_VARARGS, NULL}, + {sipNm_py_sems_lib_setInOut, meth_PySemsB2ABDialog_setInOut, METH_VARARGS, NULL}, + {sipNm_py_sems_lib_setInput, meth_PySemsB2ABDialog_setInput, METH_VARARGS, NULL}, + {sipNm_py_sems_lib_setOutput, meth_PySemsB2ABDialog_setOutput, METH_VARARGS, NULL}, + {sipNm_py_sems_lib_setStopped, meth_PySemsB2ABDialog_setStopped, METH_VARARGS, NULL} +}; + + +sipTypeDef sipType_py_sems_lib_PySemsB2ABDialog = { + 0, + 0, + "py_sems_lib.PySemsB2ABDialog", + 0, + {0, 0, 1}, + 0, + 0, + 11, methods_PySemsB2ABDialog, + 0, 0, + variables_PySemsB2ABDialog, + init_PySemsB2ABDialog, + 0, + 0, + 0, + 0, + 0, + 0, + dealloc_PySemsB2ABDialog, + cast_PySemsB2ABDialog, + release_PySemsB2ABDialog, + forceConvertTo_PySemsB2ABDialog, + 0, + 0, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + 0 +}; diff --git a/apps/py_sems/sip/sippy_sems_libPySemsB2ABDialog.h b/apps/py_sems/sip/sippy_sems_libPySemsB2ABDialog.h new file mode 100644 index 00000000..f8796498 --- /dev/null +++ b/apps/py_sems/sip/sippy_sems_libPySemsB2ABDialog.h @@ -0,0 +1,49 @@ +/* + * Interface header file. + * + * Generated by SIP 4.5.2 (4.5.2) on Wed Mar 28 22:59:14 2007 + */ + +#ifndef _py_sems_libPySemsB2ABDialog_h +#define _py_sems_libPySemsB2ABDialog_h + +#line 6 "PySemsB2ABDialog.sip" +#include "../PySemsB2ABDialog.h" +#line 13 "sippy_sems_libPySemsB2ABDialog.h" + +#define sipClass_PySemsB2ABDialog sipModuleAPI_py_sems_lib.em_types[0] +#define sipCast_PySemsB2ABDialog sipType_py_sems_lib_PySemsB2ABDialog.td_cast +#define sipForceConvertTo_PySemsB2ABDialog sipType_py_sems_lib_PySemsB2ABDialog.td_fcto + +extern sipTypeDef sipType_py_sems_lib_PySemsB2ABDialog; + + +class sipPySemsB2ABDialog : public PySemsB2ABDialog +{ +public: + sipPySemsB2ABDialog(); + virtual ~sipPySemsB2ABDialog(); + + /* + * There is a protected method for every virtual method visible from + * this class. + */ +protected: + void onInvite(const AmSipRequest&); + void onSessionStart(const AmSipRequest&); + void onCancel(); + void onBye(const AmSipRequest&); + void onDtmf(int,int); + void process(AmEvent *); + +public: + sipWrapper *sipPySelf; + +private: + sipPySemsB2ABDialog(const sipPySemsB2ABDialog &); + sipPySemsB2ABDialog &operator = (const sipPySemsB2ABDialog &); + + sipMethodCache sipPyMethods[6]; +}; + +#endif diff --git a/apps/py_sems/sip/sippy_sems_libPySemsB2BDialog.cpp b/apps/py_sems/sip/sippy_sems_libPySemsB2BDialog.cpp new file mode 100644 index 00000000..bbc4cb39 --- /dev/null +++ b/apps/py_sems/sip/sippy_sems_libPySemsB2BDialog.cpp @@ -0,0 +1,622 @@ +/* + * Interface wrapper code. + * + * Generated by SIP 4.5.2 (4.5.2) on Wed Mar 28 22:59:14 2007 + */ + +#include "sipAPIpy_sems_lib.h" +#include "sippy_sems_libPySemsB2BDialog.h" + +#include "sippy_sems_libAmSipDialog.h" +#include "sippy_sems_libPySemsB2BDialog.h" +#include "sippy_sems_libAmEvent.h" +#include "sippy_sems_libAmAudioFile.h" +#include "sippy_sems_libAmSipRequest.h" +#include "sippy_sems_libstring.h" + + +sipPySemsB2BDialog::sipPySemsB2BDialog(): PySemsB2BDialog(), sipPySelf(0) +{ + sipTrace(SIP_TRACE_CTORS,"sipPySemsB2BDialog::sipPySemsB2BDialog() (this=0x%08x)\n",this); + + sipCommonCtor(sipPyMethods,6); +} + +sipPySemsB2BDialog::~sipPySemsB2BDialog() +{ + sipTrace(SIP_TRACE_DTORS,"sipPySemsB2BDialog::~sipPySemsB2BDialog() (this=0x%08x)\n",this); + + sipCommonDtor(sipPySelf); +} + +void sipPySemsB2BDialog::onInvite(const AmSipRequest& a0) +{ + sipTrace(SIP_TRACE_CATCHERS,"void sipPySemsB2BDialog::onInvite(const AmSipRequest&) (this=0x%08x)\n",this); + + extern void sipVH_py_sems_lib_2(sip_gilstate_t,PyObject *,const AmSipRequest&); + + sip_gilstate_t sipGILState; + PyObject *meth; + + meth = sipIsPyMethod(&sipGILState,&sipPyMethods[0],sipPySelf,NULL,sipNm_py_sems_lib_onInvite); + + if (!meth) + { + PySemsB2BDialog::onInvite(a0); + return; + } + + sipVH_py_sems_lib_2(sipGILState,meth,a0); +} + +void sipPySemsB2BDialog::onSessionStart(const AmSipRequest& a0) +{ + sipTrace(SIP_TRACE_CATCHERS,"void sipPySemsB2BDialog::onSessionStart(const AmSipRequest&) (this=0x%08x)\n",this); + + extern void sipVH_py_sems_lib_2(sip_gilstate_t,PyObject *,const AmSipRequest&); + + sip_gilstate_t sipGILState; + PyObject *meth; + + meth = sipIsPyMethod(&sipGILState,&sipPyMethods[1],sipPySelf,NULL,sipNm_py_sems_lib_onSessionStart); + + if (!meth) + { + PySemsB2BDialog::onSessionStart(a0); + return; + } + + sipVH_py_sems_lib_2(sipGILState,meth,a0); +} + +void sipPySemsB2BDialog::onCancel() +{ + sipTrace(SIP_TRACE_CATCHERS,"void sipPySemsB2BDialog::onCancel() (this=0x%08x)\n",this); + + extern void sipVH_py_sems_lib_3(sip_gilstate_t,PyObject *); + + sip_gilstate_t sipGILState; + PyObject *meth; + + meth = sipIsPyMethod(&sipGILState,&sipPyMethods[2],sipPySelf,NULL,sipNm_py_sems_lib_onCancel); + + if (!meth) + { + PySemsB2BDialog::onCancel(); + return; + } + + sipVH_py_sems_lib_3(sipGILState,meth); +} + +void sipPySemsB2BDialog::onBye(const AmSipRequest& a0) +{ + sipTrace(SIP_TRACE_CATCHERS,"void sipPySemsB2BDialog::onBye(const AmSipRequest&) (this=0x%08x)\n",this); + + extern void sipVH_py_sems_lib_2(sip_gilstate_t,PyObject *,const AmSipRequest&); + + sip_gilstate_t sipGILState; + PyObject *meth; + + meth = sipIsPyMethod(&sipGILState,&sipPyMethods[3],sipPySelf,NULL,sipNm_py_sems_lib_onBye); + + if (!meth) + { + PySemsB2BDialog::onBye(a0); + return; + } + + sipVH_py_sems_lib_2(sipGILState,meth,a0); +} + +void sipPySemsB2BDialog::onDtmf(int a0,int a1) +{ + sipTrace(SIP_TRACE_CATCHERS,"void sipPySemsB2BDialog::onDtmf(int,int) (this=0x%08x)\n",this); + + extern void sipVH_py_sems_lib_1(sip_gilstate_t,PyObject *,int,int); + + sip_gilstate_t sipGILState; + PyObject *meth; + + meth = sipIsPyMethod(&sipGILState,&sipPyMethods[4],sipPySelf,NULL,sipNm_py_sems_lib_onDtmf); + + if (!meth) + { + PySemsB2BDialog::onDtmf(a0,a1); + return; + } + + sipVH_py_sems_lib_1(sipGILState,meth,a0,a1); +} + +void sipPySemsB2BDialog::process(AmEvent *a0) +{ + sipTrace(SIP_TRACE_CATCHERS,"void sipPySemsB2BDialog::process(AmEvent *) (this=0x%08x)\n",this); + + extern void sipVH_py_sems_lib_0(sip_gilstate_t,PyObject *,AmEvent *); + + sip_gilstate_t sipGILState; + PyObject *meth; + + meth = sipIsPyMethod(&sipGILState,&sipPyMethods[5],sipPySelf,NULL,sipNm_py_sems_lib_process); + + if (!meth) + { + PySemsB2BDialog::process(a0); + return; + } + + sipVH_py_sems_lib_0(sipGILState,meth,a0); +} + + +extern "C" {static PyObject *meth_PySemsB2BDialog_acceptAudio(PyObject *, PyObject *);} +static PyObject *meth_PySemsB2BDialog_acceptAudio(PyObject *sipSelf,PyObject *sipArgs) +{ + sipTrace(SIP_TRACE_METHODS,"meth_PySemsB2BDialog_acceptAudio()\n"); + + int sipArgsParsed = 0; + + { + const string * a0; + int a0State = 0; + const string * a1; + int a1State = 0; + string * a2; + PySemsB2BDialog *sipCpp; + + if (sipParseArgs(&sipArgsParsed,sipArgs,"BM1M1",&sipSelf,sipClass_PySemsB2BDialog,&sipCpp,sipMappedType_string,&a0,&a0State,sipMappedType_string,&a1,&a1State)) + { + int sipRes; + a2 = new string(); + + sipRes = sipCpp->acceptAudio(*a0,*a1,a2); + + sipReleaseMappedType(const_cast(a0),sipMappedType_string,a0State); + sipReleaseMappedType(const_cast(a1),sipMappedType_string,a1State); + + return sipBuildResult(0,"(iD)",sipRes,a2,sipMappedType_string,NULL); + } + } + + /* Raise an exception if the arguments couldn't be parsed. */ + sipNoMethod(sipArgsParsed,sipNm_py_sems_lib_PySemsB2BDialog,sipNm_py_sems_lib_acceptAudio); + + return NULL; +} + + +extern "C" {static PyObject *meth_PySemsB2BDialog_setStopped(PyObject *, PyObject *);} +static PyObject *meth_PySemsB2BDialog_setStopped(PyObject *sipSelf,PyObject *sipArgs) +{ + sipTrace(SIP_TRACE_METHODS,"meth_PySemsB2BDialog_setStopped()\n"); + + int sipArgsParsed = 0; + + { + PySemsB2BDialog *sipCpp; + + if (sipParseArgs(&sipArgsParsed,sipArgs,"B",&sipSelf,sipClass_PySemsB2BDialog,&sipCpp)) + { + sipCpp->setStopped(); + + Py_INCREF(Py_None); + return Py_None; + } + } + + /* Raise an exception if the arguments couldn't be parsed. */ + sipNoMethod(sipArgsParsed,sipNm_py_sems_lib_PySemsB2BDialog,sipNm_py_sems_lib_setStopped); + + return NULL; +} + + +extern "C" {static PyObject *meth_PySemsB2BDialog_onInvite(PyObject *, PyObject *);} +static PyObject *meth_PySemsB2BDialog_onInvite(PyObject *sipSelf,PyObject *sipArgs) +{ + sipTrace(SIP_TRACE_METHODS,"meth_PySemsB2BDialog_onInvite()\n"); + + int sipArgsParsed = 0; + bool sipSelfWasArg = !sipSelf; + + { + const AmSipRequest * a0; + PySemsB2BDialog *sipCpp; + + if (sipParseArgs(&sipArgsParsed,sipArgs,"BJA",&sipSelf,sipClass_PySemsB2BDialog,&sipCpp,sipClass_AmSipRequest,&a0)) + { + (sipSelfWasArg ? sipCpp->PySemsB2BDialog::onInvite(*a0) : sipCpp->onInvite(*a0)); + + Py_INCREF(Py_None); + return Py_None; + } + } + + /* Raise an exception if the arguments couldn't be parsed. */ + sipNoMethod(sipArgsParsed,sipNm_py_sems_lib_PySemsB2BDialog,sipNm_py_sems_lib_onInvite); + + return NULL; +} + + +extern "C" {static PyObject *meth_PySemsB2BDialog_onSessionStart(PyObject *, PyObject *);} +static PyObject *meth_PySemsB2BDialog_onSessionStart(PyObject *sipSelf,PyObject *sipArgs) +{ + sipTrace(SIP_TRACE_METHODS,"meth_PySemsB2BDialog_onSessionStart()\n"); + + int sipArgsParsed = 0; + bool sipSelfWasArg = !sipSelf; + + { + const AmSipRequest * a0; + PySemsB2BDialog *sipCpp; + + if (sipParseArgs(&sipArgsParsed,sipArgs,"BJA",&sipSelf,sipClass_PySemsB2BDialog,&sipCpp,sipClass_AmSipRequest,&a0)) + { + (sipSelfWasArg ? sipCpp->PySemsB2BDialog::onSessionStart(*a0) : sipCpp->onSessionStart(*a0)); + + Py_INCREF(Py_None); + return Py_None; + } + } + + /* Raise an exception if the arguments couldn't be parsed. */ + sipNoMethod(sipArgsParsed,sipNm_py_sems_lib_PySemsB2BDialog,sipNm_py_sems_lib_onSessionStart); + + return NULL; +} + + +extern "C" {static PyObject *meth_PySemsB2BDialog_onCancel(PyObject *, PyObject *);} +static PyObject *meth_PySemsB2BDialog_onCancel(PyObject *sipSelf,PyObject *sipArgs) +{ + sipTrace(SIP_TRACE_METHODS,"meth_PySemsB2BDialog_onCancel()\n"); + + int sipArgsParsed = 0; + bool sipSelfWasArg = !sipSelf; + + { + PySemsB2BDialog *sipCpp; + + if (sipParseArgs(&sipArgsParsed,sipArgs,"B",&sipSelf,sipClass_PySemsB2BDialog,&sipCpp)) + { + (sipSelfWasArg ? sipCpp->PySemsB2BDialog::onCancel() : sipCpp->onCancel()); + + Py_INCREF(Py_None); + return Py_None; + } + } + + /* Raise an exception if the arguments couldn't be parsed. */ + sipNoMethod(sipArgsParsed,sipNm_py_sems_lib_PySemsB2BDialog,sipNm_py_sems_lib_onCancel); + + return NULL; +} + + +extern "C" {static PyObject *meth_PySemsB2BDialog_onBye(PyObject *, PyObject *);} +static PyObject *meth_PySemsB2BDialog_onBye(PyObject *sipSelf,PyObject *sipArgs) +{ + sipTrace(SIP_TRACE_METHODS,"meth_PySemsB2BDialog_onBye()\n"); + + int sipArgsParsed = 0; + bool sipSelfWasArg = !sipSelf; + + { + const AmSipRequest * a0; + PySemsB2BDialog *sipCpp; + + if (sipParseArgs(&sipArgsParsed,sipArgs,"BJA",&sipSelf,sipClass_PySemsB2BDialog,&sipCpp,sipClass_AmSipRequest,&a0)) + { + (sipSelfWasArg ? sipCpp->PySemsB2BDialog::onBye(*a0) : sipCpp->onBye(*a0)); + + Py_INCREF(Py_None); + return Py_None; + } + } + + /* Raise an exception if the arguments couldn't be parsed. */ + sipNoMethod(sipArgsParsed,sipNm_py_sems_lib_PySemsB2BDialog,sipNm_py_sems_lib_onBye); + + return NULL; +} + + +extern "C" {static PyObject *meth_PySemsB2BDialog_onDtmf(PyObject *, PyObject *);} +static PyObject *meth_PySemsB2BDialog_onDtmf(PyObject *sipSelf,PyObject *sipArgs) +{ + sipTrace(SIP_TRACE_METHODS,"meth_PySemsB2BDialog_onDtmf()\n"); + + int sipArgsParsed = 0; + bool sipSelfWasArg = !sipSelf; + + { + int a0; + int a1; + PySemsB2BDialog *sipCpp; + + if (sipParseArgs(&sipArgsParsed,sipArgs,"Bii",&sipSelf,sipClass_PySemsB2BDialog,&sipCpp,&a0,&a1)) + { + (sipSelfWasArg ? sipCpp->PySemsB2BDialog::onDtmf(a0,a1) : sipCpp->onDtmf(a0,a1)); + + Py_INCREF(Py_None); + return Py_None; + } + } + + /* Raise an exception if the arguments couldn't be parsed. */ + sipNoMethod(sipArgsParsed,sipNm_py_sems_lib_PySemsB2BDialog,sipNm_py_sems_lib_onDtmf); + + return NULL; +} + + +extern "C" {static PyObject *meth_PySemsB2BDialog_setInput(PyObject *, PyObject *);} +static PyObject *meth_PySemsB2BDialog_setInput(PyObject *sipSelf,PyObject *sipArgs) +{ + sipTrace(SIP_TRACE_METHODS,"meth_PySemsB2BDialog_setInput()\n"); + + int sipArgsParsed = 0; + + { + AmAudioFile * a0; + PySemsB2BDialog *sipCpp; + + if (sipParseArgs(&sipArgsParsed,sipArgs,"BJ@",&sipSelf,sipClass_PySemsB2BDialog,&sipCpp,sipClass_AmAudioFile,&a0)) + { + sipCpp->setInput(a0); + + Py_INCREF(Py_None); + return Py_None; + } + } + + /* Raise an exception if the arguments couldn't be parsed. */ + sipNoMethod(sipArgsParsed,sipNm_py_sems_lib_PySemsB2BDialog,sipNm_py_sems_lib_setInput); + + return NULL; +} + + +extern "C" {static PyObject *meth_PySemsB2BDialog_setOutput(PyObject *, PyObject *);} +static PyObject *meth_PySemsB2BDialog_setOutput(PyObject *sipSelf,PyObject *sipArgs) +{ + sipTrace(SIP_TRACE_METHODS,"meth_PySemsB2BDialog_setOutput()\n"); + + int sipArgsParsed = 0; + + { + AmAudioFile * a0; + PySemsB2BDialog *sipCpp; + + if (sipParseArgs(&sipArgsParsed,sipArgs,"BJ@",&sipSelf,sipClass_PySemsB2BDialog,&sipCpp,sipClass_AmAudioFile,&a0)) + { + sipCpp->setOutput(a0); + + Py_INCREF(Py_None); + return Py_None; + } + } + + /* Raise an exception if the arguments couldn't be parsed. */ + sipNoMethod(sipArgsParsed,sipNm_py_sems_lib_PySemsB2BDialog,sipNm_py_sems_lib_setOutput); + + return NULL; +} + + +extern "C" {static PyObject *meth_PySemsB2BDialog_setInOut(PyObject *, PyObject *);} +static PyObject *meth_PySemsB2BDialog_setInOut(PyObject *sipSelf,PyObject *sipArgs) +{ + sipTrace(SIP_TRACE_METHODS,"meth_PySemsB2BDialog_setInOut()\n"); + + int sipArgsParsed = 0; + + { + AmAudioFile * a0; + AmAudioFile * a1; + PySemsB2BDialog *sipCpp; + + if (sipParseArgs(&sipArgsParsed,sipArgs,"BJ@J@",&sipSelf,sipClass_PySemsB2BDialog,&sipCpp,sipClass_AmAudioFile,&a0,sipClass_AmAudioFile,&a1)) + { + sipCpp->setInOut(a0,a1); + + Py_INCREF(Py_None); + return Py_None; + } + } + + /* Raise an exception if the arguments couldn't be parsed. */ + sipNoMethod(sipArgsParsed,sipNm_py_sems_lib_PySemsB2BDialog,sipNm_py_sems_lib_setInOut); + + return NULL; +} + + +extern "C" {static PyObject *meth_PySemsB2BDialog_process(PyObject *, PyObject *);} +static PyObject *meth_PySemsB2BDialog_process(PyObject *sipSelf,PyObject *sipArgs) +{ + sipTrace(SIP_TRACE_METHODS,"meth_PySemsB2BDialog_process()\n"); + + int sipArgsParsed = 0; + bool sipSelfWasArg = !sipSelf; + + { + AmEvent * a0; + PySemsB2BDialog *sipCpp; + + if (sipParseArgs(&sipArgsParsed,sipArgs,"BJ@",&sipSelf,sipClass_PySemsB2BDialog,&sipCpp,sipClass_AmEvent,&a0)) + { + (sipSelfWasArg ? sipCpp->PySemsB2BDialog::process(a0) : sipCpp->process(a0)); + + Py_INCREF(Py_None); + return Py_None; + } + } + + /* Raise an exception if the arguments couldn't be parsed. */ + sipNoMethod(sipArgsParsed,sipNm_py_sems_lib_PySemsB2BDialog,sipNm_py_sems_lib_process); + + return NULL; +} + + +/* Cast a pointer to a type somewhere in its superclass hierarchy. */ +extern "C" {static void *cast_PySemsB2BDialog(void *, sipWrapperType *);} +static void *cast_PySemsB2BDialog(void *ptr,sipWrapperType *targetClass) +{ + if (targetClass == sipClass_PySemsB2BDialog) + return ptr; + + return NULL; +} + + +/* Call the instance's destructor. */ +extern "C" {static void release_PySemsB2BDialog(void *, int);} +static void release_PySemsB2BDialog(void *ptr,int state) +{ + if (state & SIP_DERIVED_CLASS) + delete reinterpret_cast(ptr); + else + delete reinterpret_cast(ptr); +} + + +extern "C" {static void dealloc_PySemsB2BDialog(sipWrapper *);} +static void dealloc_PySemsB2BDialog(sipWrapper *sipSelf) +{ + sipTrace(SIP_TRACE_DEALLOCS,"dealloc_PySemsB2BDialog()\n"); + + if (sipIsDerived(sipSelf)) + reinterpret_cast(sipSelf->u.cppPtr)->sipPySelf = NULL; + + if (sipIsPyOwned(sipSelf)) + { +#line 17 "PySemsB2BDialog.sip" + fprintf(stderr,"------------- dealloc_PySemsB2BDialog ----------\n"); +#line 500 "sippy_sems_libPySemsB2BDialog.cpp" + + release_PySemsB2BDialog(sipSelf->u.cppPtr,sipSelf->flags); + } +} + + +extern "C" {static void *init_PySemsB2BDialog(sipWrapper *, PyObject *, sipWrapper **, int *);} +static void *init_PySemsB2BDialog(sipWrapper *sipSelf,PyObject *sipArgs,sipWrapper **,int *sipArgsParsed) +{ + sipPySemsB2BDialog *sipCpp = 0; + + sipTrace(SIP_TRACE_INITS,"init_PySemsB2BDialog()\n"); + + if (!sipCpp) + { + if (sipParseArgs(sipArgsParsed,sipArgs,"")) + { + sipCpp = new sipPySemsB2BDialog(); + } + } + + if (sipCpp) + sipCpp->sipPySelf = sipSelf; + + return sipCpp; +} + + +extern "C" {static PyObject *var_PySemsB2BDialog_dlg(PyObject *, PyObject *);} +static PyObject *var_PySemsB2BDialog_dlg(PyObject *sipSelf,PyObject *sipPy) +{ + int sipIsErr = 0; + AmSipDialog *sipVal; + PySemsB2BDialog *sipCpp = reinterpret_cast(sipGetCppPtr((sipWrapper *)sipSelf,sipClass_PySemsB2BDialog)); + + if (!sipCpp) + return NULL; + + if (sipPy == NULL) + { + sipVal = &sipCpp->dlg; + + sipPy = sipConvertFromInstance(sipVal,sipClass_AmSipDialog,NULL); + + return sipPy; + } + + sipVal = reinterpret_cast(sipForceConvertToInstance(sipPy,sipClass_AmSipDialog,NULL,SIP_NOT_NONE,NULL,&sipIsErr)); + + if (sipIsErr) + return NULL; + + sipCpp->dlg = *sipVal; + + Py_INCREF(Py_None); + return Py_None; +} + +PyMethodDef variables_PySemsB2BDialog[] = { + {sipNm_py_sems_lib_dlg, var_PySemsB2BDialog_dlg, 0, NULL}, + {0, 0, 0, 0} +}; + + +extern "C" {static void *forceConvertTo_PySemsB2BDialog(PyObject *, int *);} +static void *forceConvertTo_PySemsB2BDialog(PyObject *valobj,int *iserrp) +{ + if (*iserrp || valobj == NULL) + return NULL; + + if (valobj == Py_None || sipIsSubClassInstance(valobj,sipClass_PySemsB2BDialog)) + return sipConvertToCpp(valobj,sipClass_PySemsB2BDialog,iserrp); + + sipBadClass(sipNm_py_sems_lib_PySemsB2BDialog); + + *iserrp = 1; + + return NULL; +} + + +static PyMethodDef methods_PySemsB2BDialog[] = { + {sipNm_py_sems_lib_acceptAudio, meth_PySemsB2BDialog_acceptAudio, METH_VARARGS, NULL}, + {sipNm_py_sems_lib_onBye, meth_PySemsB2BDialog_onBye, METH_VARARGS, NULL}, + {sipNm_py_sems_lib_onCancel, meth_PySemsB2BDialog_onCancel, METH_VARARGS, NULL}, + {sipNm_py_sems_lib_onDtmf, meth_PySemsB2BDialog_onDtmf, METH_VARARGS, NULL}, + {sipNm_py_sems_lib_onInvite, meth_PySemsB2BDialog_onInvite, METH_VARARGS, NULL}, + {sipNm_py_sems_lib_onSessionStart, meth_PySemsB2BDialog_onSessionStart, METH_VARARGS, NULL}, + {sipNm_py_sems_lib_process, meth_PySemsB2BDialog_process, METH_VARARGS, NULL}, + {sipNm_py_sems_lib_setInOut, meth_PySemsB2BDialog_setInOut, METH_VARARGS, NULL}, + {sipNm_py_sems_lib_setInput, meth_PySemsB2BDialog_setInput, METH_VARARGS, NULL}, + {sipNm_py_sems_lib_setOutput, meth_PySemsB2BDialog_setOutput, METH_VARARGS, NULL}, + {sipNm_py_sems_lib_setStopped, meth_PySemsB2BDialog_setStopped, METH_VARARGS, NULL} +}; + + +sipTypeDef sipType_py_sems_lib_PySemsB2BDialog = { + 0, + 0, + "py_sems_lib.PySemsB2BDialog", + 0, + {0, 0, 1}, + 0, + 0, + 11, methods_PySemsB2BDialog, + 0, 0, + variables_PySemsB2BDialog, + init_PySemsB2BDialog, + 0, + 0, + 0, + 0, + 0, + 0, + dealloc_PySemsB2BDialog, + cast_PySemsB2BDialog, + release_PySemsB2BDialog, + forceConvertTo_PySemsB2BDialog, + 0, + 0, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + 0 +}; diff --git a/apps/py_sems/sip/sippy_sems_libPySemsB2BDialog.h b/apps/py_sems/sip/sippy_sems_libPySemsB2BDialog.h new file mode 100644 index 00000000..e1eb826d --- /dev/null +++ b/apps/py_sems/sip/sippy_sems_libPySemsB2BDialog.h @@ -0,0 +1,49 @@ +/* + * Interface header file. + * + * Generated by SIP 4.5.2 (4.5.2) on Wed Mar 28 22:59:14 2007 + */ + +#ifndef _py_sems_libPySemsB2BDialog_h +#define _py_sems_libPySemsB2BDialog_h + +#line 6 "PySemsB2BDialog.sip" +#include "../PySemsB2BDialog.h" +#line 13 "sippy_sems_libPySemsB2BDialog.h" + +#define sipClass_PySemsB2BDialog sipModuleAPI_py_sems_lib.em_types[1] +#define sipCast_PySemsB2BDialog sipType_py_sems_lib_PySemsB2BDialog.td_cast +#define sipForceConvertTo_PySemsB2BDialog sipType_py_sems_lib_PySemsB2BDialog.td_fcto + +extern sipTypeDef sipType_py_sems_lib_PySemsB2BDialog; + + +class sipPySemsB2BDialog : public PySemsB2BDialog +{ +public: + sipPySemsB2BDialog(); + virtual ~sipPySemsB2BDialog(); + + /* + * There is a protected method for every virtual method visible from + * this class. + */ +protected: + void onInvite(const AmSipRequest&); + void onSessionStart(const AmSipRequest&); + void onCancel(); + void onBye(const AmSipRequest&); + void onDtmf(int,int); + void process(AmEvent *); + +public: + sipWrapper *sipPySelf; + +private: + sipPySemsB2BDialog(const sipPySemsB2BDialog &); + sipPySemsB2BDialog &operator = (const sipPySemsB2BDialog &); + + sipMethodCache sipPyMethods[6]; +}; + +#endif diff --git a/apps/py_sems/sip/sippy_sems_libPySemsDialog.cpp b/apps/py_sems/sip/sippy_sems_libPySemsDialog.cpp index 3d7468ec..294aed8f 100644 --- a/apps/py_sems/sip/sippy_sems_libPySemsDialog.cpp +++ b/apps/py_sems/sip/sippy_sems_libPySemsDialog.cpp @@ -1,7 +1,7 @@ /* * Interface wrapper code. * - * Generated by SIP 4.5.2 (4.5.2) on Tue Feb 20 15:24:56 2007 + * Generated by SIP 4.5.2 (4.5.2) on Wed Mar 28 22:59:14 2007 */ #include "sipAPIpy_sems_lib.h" diff --git a/apps/py_sems/sip/sippy_sems_libPySemsDialog.h b/apps/py_sems/sip/sippy_sems_libPySemsDialog.h index eccdea04..13823c7e 100644 --- a/apps/py_sems/sip/sippy_sems_libPySemsDialog.h +++ b/apps/py_sems/sip/sippy_sems_libPySemsDialog.h @@ -1,17 +1,17 @@ /* * Interface header file. * - * Generated by SIP 4.5.2 (4.5.2) on Tue Feb 20 15:24:56 2007 + * Generated by SIP 4.5.2 (4.5.2) on Wed Mar 28 22:59:14 2007 */ #ifndef _py_sems_libPySemsDialog_h #define _py_sems_libPySemsDialog_h #line 6 "PySemsDialog.sip" -#include "../PySems.h" +#include "../PySemsDialog.h" #line 13 "sippy_sems_libPySemsDialog.h" -#define sipClass_PySemsDialog sipModuleAPI_py_sems_lib.em_types[0] +#define sipClass_PySemsDialog sipModuleAPI_py_sems_lib.em_types[2] #define sipCast_PySemsDialog sipType_py_sems_lib_PySemsDialog.td_cast #define sipForceConvertTo_PySemsDialog sipType_py_sems_lib_PySemsDialog.td_fcto diff --git a/apps/py_sems/sip/sippy_sems_libcmodule.cpp b/apps/py_sems/sip/sippy_sems_libcmodule.cpp index e5190dc1..c13e89dd 100644 --- a/apps/py_sems/sip/sippy_sems_libcmodule.cpp +++ b/apps/py_sems/sip/sippy_sems_libcmodule.cpp @@ -1,11 +1,13 @@ /* * Module code. * - * Generated by SIP 4.5.2 (4.5.2) on Tue Feb 20 15:24:56 2007 + * Generated by SIP 4.5.2 (4.5.2) on Wed Mar 28 22:59:14 2007 */ #include "sipAPIpy_sems_lib.h" +#include "sippy_sems_libPySemsB2ABDialog.h" +#include "sippy_sems_libPySemsB2BDialog.h" #include "sippy_sems_libPySemsDialog.h" #include "sippy_sems_libAmAudioFile.h" #include "sippy_sems_libAmAudioEvent.h" @@ -18,6 +20,8 @@ /* Define the strings used by this module. */ char sipNm_py_sems_lib_get_header_param[] = "get_header_param"; +char sipNm_py_sems_lib_PySemsB2ABDialog[] = "PySemsB2ABDialog"; +char sipNm_py_sems_lib_PySemsB2BDialog[] = "PySemsB2BDialog"; char sipNm_py_sems_lib_process[] = "process"; char sipNm_py_sems_lib_setInOut[] = "setInOut"; char sipNm_py_sems_lib_setOutput[] = "setOutput"; @@ -259,7 +263,7 @@ static sipWrapperType *sipSubClass_AmEvent(void **sipCppRet) else { sipClass = sipClass_AmEvent; } -#line 263 "sippy_sems_libcmodule.cpp" +#line 267 "sippy_sems_libcmodule.cpp" return sipClass; } @@ -270,6 +274,8 @@ static sipWrapperType *sipSubClass_AmEvent(void **sipCppRet) * proper Python types during the export process. */ static sipWrapperType *typesTable[] = { + (sipWrapperType *)(void *)&sipType_py_sems_lib_PySemsB2ABDialog, + (sipWrapperType *)(void *)&sipType_py_sems_lib_PySemsB2BDialog, (sipWrapperType *)(void *)&sipType_py_sems_lib_PySemsDialog, (sipWrapperType *)(void *)&sipType_py_sems_lib_AmAudioFile, (sipWrapperType *)(void *)&sipType_py_sems_lib_AmEvent, @@ -289,9 +295,9 @@ static sipMappedType *mappedTypesTable[] = { /* Define each named enum in this module. */ static sipEnumDef enumTypesTable[] = { - {"py_sems_lib.AmAudioFile.OpenMode", NULL, 1, NULL}, - {"py_sems_lib.AmAudioEvent.EventType", NULL, 3, NULL}, - {"py_sems_lib.AmSipDialog.Status", NULL, 4, NULL}, + {"py_sems_lib.AmAudioFile.OpenMode", NULL, 3, NULL}, + {"py_sems_lib.AmAudioEvent.EventType", NULL, 5, NULL}, + {"py_sems_lib.AmSipDialog.Status", NULL, 6, NULL}, }; @@ -309,7 +315,7 @@ static sipVirtHandlerFunc virtHandlersTable[] = { /* This defines the class sub-convertors that this module defines. */ static sipSubClassConvertorDef convertorsTable[] = { - {sipSubClass_AmEvent, {2, 255, 0}, NULL}, + {sipSubClass_AmEvent, {4, 255, 0}, NULL}, {NULL, {0, 0, 0}, NULL} }; @@ -323,7 +329,7 @@ sipExportedModuleDef sipModuleAPI_py_sems_lib = { 0, NULL, NULL, - 7, + 9, typesTable, NULL, mappedTypesTable, diff --git a/apps/py_sems/sip/sippy_sems_libstring.cpp b/apps/py_sems/sip/sippy_sems_libstring.cpp index 7409fb48..f71bf75c 100644 --- a/apps/py_sems/sip/sippy_sems_libstring.cpp +++ b/apps/py_sems/sip/sippy_sems_libstring.cpp @@ -1,7 +1,7 @@ /* * Interface wrapper code. * - * Generated by SIP 4.5.2 (4.5.2) on Tue Feb 20 15:24:56 2007 + * Generated by SIP 4.5.2 (4.5.2) on Wed Mar 28 22:59:14 2007 */ #include "sipAPIpy_sems_lib.h" diff --git a/apps/py_sems/sip/sippy_sems_libstring.h b/apps/py_sems/sip/sippy_sems_libstring.h index 205dc556..6a2fe05a 100644 --- a/apps/py_sems/sip/sippy_sems_libstring.h +++ b/apps/py_sems/sip/sippy_sems_libstring.h @@ -1,7 +1,7 @@ /* * Interface header file. * - * Generated by SIP 4.5.2 (4.5.2) on Tue Feb 20 15:24:56 2007 + * Generated by SIP 4.5.2 (4.5.2) on Wed Mar 28 22:59:14 2007 */ #ifndef _py_sems_libstring_h