Module: sems Branch: master Commit: 161091d0d4041fa0e713c4c82b3ac3667fea4919 URL: https://github.com/sems-server/sems/commit/161091d0d4041fa0e713c4c82b3ac3667fea4919
Author: juha-h <[email protected]> Committer: juha-h <[email protected]> Date: 2015-05-03T17:04:24+03:00 Merge pull request #1 from kovacsbalu/feat-getheaders-in-ivr Publish getHeaders function for IVR python. --- Modified: apps/ivr/Ivr.cpp --- Diff: https://github.com/sems-server/sems/commit/161091d0d4041fa0e713c4c82b3ac3667fea4919.diff Patch: https://github.com/sems-server/sems/commit/161091d0d4041fa0e713c4c82b3ac3667fea4919.patch --- diff --git a/apps/ivr/Ivr.cpp b/apps/ivr/Ivr.cpp index b7797f6..fb4c449 100644 --- a/apps/ivr/Ivr.cpp +++ b/apps/ivr/Ivr.cpp @@ -94,6 +94,16 @@ extern "C" { return PyString_FromString(res.c_str()); } + static PyObject* ivr_getHeaders(PyObject*, PyObject* args) + { + char* headers; + char* header_name; + if(!PyArg_ParseTuple(args,"ss",&headers,&header_name)) + return NULL; + + string res = getHeader(headers,header_name); + return PyString_FromString(res.c_str()); + } static PyObject* ivr_ignoreSigchld(PyObject*, PyObject* args) { @@ -135,6 +145,7 @@ extern "C" { static PyMethodDef ivr_methods[] = { {"log", (PyCFunction)ivr_log, METH_VARARGS,"Log a message using Sems' logging system"}, {"getHeader", (PyCFunction)ivr_getHeader, METH_VARARGS,"Python getHeader wrapper"}, + {"getHeaders", (PyCFunction)ivr_getHeader, METH_VARARGS,"Python getHeaders wrapper"}, {"createThread", (PyCFunction)ivr_createThread, METH_VARARGS, "Create another interpreter thread"}, {"setIgnoreSigchld", (PyCFunction)ivr_ignoreSigchld, METH_VARARGS, "ignore SIGCHLD signal"}, {NULL} /* Sentinel */ _______________________________________________ Semsdev mailing list [email protected] http://lists.iptel.org/mailman/listinfo/semsdev
