From 4eba991fd354cb3002ea26e592eec158fe822953 Mon Sep 17 00:00:00 2001 From: Stefan Sayer Date: Tue, 19 May 2009 13:24:09 +0000 Subject: [PATCH] optional headers to bye. based on patch by Balint Kovacs git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1389 8eb893ce-cfd4-0310-b710-fb5ebe64c474 --- apps/ivr/IVRInterface.txt | 2 +- apps/ivr/IvrDialogBase.cpp | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/apps/ivr/IVRInterface.txt b/apps/ivr/IVRInterface.txt index f2dc5cf3..2b1b0010 100644 --- a/apps/ivr/IVRInterface.txt +++ b/apps/ivr/IVRInterface.txt @@ -37,7 +37,7 @@ class IvrDialogBase: def stopSession(self): # stop everything pass - def bye(self): # BYEs (or CANCELs) the SIP dialog + def bye(self [, headers]): # BYEs (or CANCELs) the SIP dialog pass diff --git a/apps/ivr/IvrDialogBase.cpp b/apps/ivr/IvrDialogBase.cpp index d45e3248..578e4867 100644 --- a/apps/ivr/IvrDialogBase.cpp +++ b/apps/ivr/IvrDialogBase.cpp @@ -182,10 +182,16 @@ static PyObject* IvrDialogBase_dropSession(IvrDialogBase* self, PyObject*) return Py_None; } -static PyObject* IvrDialogBase_bye(IvrDialogBase* self, PyObject*) +static PyObject* IvrDialogBase_bye(IvrDialogBase* self, PyObject* args) { + char* hdrs = ""; + assert(self->p_dlg); - self->p_dlg->dlg.bye(); + + if(!PyArg_ParseTuple(args,"|s", &hdrs)) + return NULL; + + self->p_dlg->dlg.bye(hdrs); Py_INCREF(Py_None); return Py_None; } @@ -518,7 +524,7 @@ static PyMethodDef IvrDialogBase_methods[] = { {"stopSession", (PyCFunction)IvrDialogBase_stopSession, METH_NOARGS, "Stop the session" }, - {"bye", (PyCFunction)IvrDialogBase_bye, METH_NOARGS, + {"bye", (PyCFunction)IvrDialogBase_bye, METH_VARARGS, "Send a BYE" }, {"redirect", (PyCFunction)IvrDialogBase_redirect, METH_VARARGS,