Module: sems Branch: 1.5 Commit: 2351ef6281fdd371a91939bed442ed8ff9dc2f77 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=2351ef6281fdd371a91939bed442ed8ff9dc2f77
Author: Stefan Sayer <[email protected]> Committer: Stefan Sayer <[email protected]> Date: Tue Aug 7 15:45:47 2012 +0200 b/f: restore request body functionality to 1.4 level for non-multipart patch by Robert Szokovacs --- apps/ivr/IvrSipRequest.cpp | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/apps/ivr/IvrSipRequest.cpp b/apps/ivr/IvrSipRequest.cpp index 9f91794..f07cfe8 100644 --- a/apps/ivr/IvrSipRequest.cpp +++ b/apps/ivr/IvrSipRequest.cpp @@ -120,7 +120,6 @@ def_IvrSipRequest_GETTER(IvrSipRequest_getcallid, callid) def_IvrSipRequest_GETTER(IvrSipRequest_getfrom_tag, from_tag) def_IvrSipRequest_GETTER(IvrSipRequest_getto_tag, to_tag) def_IvrSipRequest_GETTER(IvrSipRequest_getroute, route) -//def_IvrSipRequest_GETTER(IvrSipRequest_getbody, body) def_IvrSipRequest_GETTER(IvrSipRequest_gethdrs, hdrs) #undef def_IvrSipRequest_GETTER @@ -136,6 +135,18 @@ IvrSipRequest_getcseq(IvrSipRequest *self, void *closure) return PyInt_FromLong(self->p_req->cseq); } +static PyObject* +IvrSipRequest_getbody(IvrSipRequest *self, void *closure) +{ + if(self->p_req->body.getLen()) + { + string body; + self->p_req->body.print(body); + return PyString_FromString(body.c_str()); + } + return PyString_FromString(""); +} + #define def_IvrSipRequest_SETTER(setter_name, attr) \ static int \ setter_name(IvrSipRequest *self, PyObject* value, void *closure) \ @@ -165,7 +176,7 @@ static PyGetSetDef IvrSipRequest_getset[] = { {(char*)"to_tag", (getter)IvrSipRequest_getto_tag, NULL, (char*)"local tag", NULL}, {(char*)"route", (getter)IvrSipRequest_getroute, NULL, (char*)"record routing", NULL}, {(char*)"cseq", (getter)IvrSipRequest_getcseq, NULL, (char*)"CSeq for next request", NULL}, - //{(char*)"body", (getter)IvrSipRequest_getbody, NULL, (char*)"Body", NULL}, + {(char*)"body", (getter)IvrSipRequest_getbody, NULL, (char*)"Body", NULL}, {(char*)"hdrs", (getter)IvrSipRequest_gethdrs, (setter)IvrSipRequest_sethdrs, (char*)"Additional headers", NULL}, {NULL} /* Sentinel */ }; _______________________________________________ Semsdev mailing list [email protected] http://lists.iptel.org/mailman/listinfo/semsdev
