Module: sems
Branch: master
Commit: f738b2dbeb49f2b4516bb77ec00c46d560c1f61b
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=f738b2dbeb49f2b4516bb77ec00c46d560c1f61b

Author: Raphael Coeffic <[email protected]>
Committer: Raphael Coeffic <[email protected]>
Date:   Mon Feb 20 10:11:53 2012 +0100

multi-mime: ivr: adapt to core API changes (wip)

---

 apps/ivr/Ivr.cpp           |   13 ++++++++++++-
 apps/ivr/IvrSipReply.cpp   |    4 ++--
 apps/ivr/IvrSipRequest.cpp |    4 ++--
 3 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/apps/ivr/Ivr.cpp b/apps/ivr/Ivr.cpp
index c7b7d5c..a334e74 100644
--- a/apps/ivr/Ivr.cpp
+++ b/apps/ivr/Ivr.cpp
@@ -678,7 +678,18 @@ void IvrDialog::onSessionStart()
 
 int IvrDialog::onSdpCompleted(const AmSdp& offer, const AmSdp& answer)
 {
-  answer.print(invite_req.body);
+  AmMimeBody* sdp_body = invite_req.body.hasContentType(SIP_APPLICATION_SDP);
+  if(!sdp_body) {
+    sdp_body = invite_req.body.addPart(SIP_APPLICATION_SDP);
+  }
+
+  if(sdp_body) {
+    string sdp_buf;
+    answer.print(sdp_buf);
+    sdp_body->setPayload((const unsigned char*)sdp_buf.c_str(),
+                        sdp_buf.length());
+  }
+
   return AmB2BCallerSession::onSdpCompleted(offer,answer);
 }
 
diff --git a/apps/ivr/IvrSipReply.cpp b/apps/ivr/IvrSipReply.cpp
index 4eeb994..b66942c 100644
--- a/apps/ivr/IvrSipReply.cpp
+++ b/apps/ivr/IvrSipReply.cpp
@@ -80,7 +80,7 @@ def_IvrSipReply_GETTER(IvrSipReply_gethdrs,       hdrs)
 def_IvrSipReply_GETTER(IvrSipReply_getfrom_tag,   from_tag)
 def_IvrSipReply_GETTER(IvrSipReply_getto_tag,     to_tag)
 def_IvrSipReply_GETTER(IvrSipReply_getroute,      route)
-def_IvrSipReply_GETTER(IvrSipReply_getbody,       body)
+//def_IvrSipReply_GETTER(IvrSipReply_getbody,       body)
 
 static PyObject*
 IvrSipReply_getcseq(IvrSipReply *self, void *closure)
@@ -100,7 +100,7 @@ static PyGetSetDef IvrSipReply_getset[] = {
   {(char*)"contact",(getter)IvrSipReply_getcontact, NULL, (char*)"contact", 
NULL},
   {(char*)"route",    (getter)IvrSipReply_getroute, NULL, (char*)"route", 
NULL},
   {(char*)"hdrs",     (getter)IvrSipReply_gethdrs, NULL, (char*)"hdrs", NULL},
-  {(char*)"body",     (getter)IvrSipReply_getbody, NULL, (char*)"body", NULL},
+  //{(char*)"body",     (getter)IvrSipReply_getbody, NULL, (char*)"body", 
NULL},
   {(char*)"from_tag", (getter)IvrSipReply_getfrom_tag, NULL, 
(char*)"from_tag", NULL},
   {(char*)"to_tag",   (getter)IvrSipReply_getto_tag, NULL, (char*)"to_tag", 
NULL},
   {(char*)"cseq",     (getter)IvrSipReply_getcseq, NULL, (char*)"cseq", NULL},
diff --git a/apps/ivr/IvrSipRequest.cpp b/apps/ivr/IvrSipRequest.cpp
index 4ce2374..9f91794 100644
--- a/apps/ivr/IvrSipRequest.cpp
+++ b/apps/ivr/IvrSipRequest.cpp
@@ -120,7 +120,7 @@ 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_getbody,         body)
 def_IvrSipRequest_GETTER(IvrSipRequest_gethdrs,         hdrs)
 
 #undef def_IvrSipRequest_GETTER
@@ -165,7 +165,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

Reply via email to