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

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

multi-mime: dsm: adapt to core API changes

---

 apps/dsm/DSMCall.cpp             |   26 +++++++++++++++++---------
 apps/dsm/mods/mod_dlg/ModDlg.cpp |    7 ++-----
 2 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/apps/dsm/DSMCall.cpp b/apps/dsm/DSMCall.cpp
index 7a02438..ce86ab5 100644
--- a/apps/dsm/DSMCall.cpp
+++ b/apps/dsm/DSMCall.cpp
@@ -179,7 +179,18 @@ void DSMCall::onSessionStart()
 
 int DSMCall::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);
 }
 
@@ -263,8 +274,11 @@ void DSMCall::onSipRequest(const AmSipRequest& req) {
     params["to"] = req.to;
     params["hdrs"] = req.hdrs;
 
-    params["content_type"] = req.content_type;
-    params["body"] = req.body;
+    //TODO: find some sort of solution for this one....
+    //      Stefan? any clue?????
+    //
+    //params["content_type"] = req.content_type;
+    //params["body"] = req.body;
 
     params["cseq"] = int2str(req.cseq);
 
@@ -294,9 +308,6 @@ void DSMCall::onSipReply(const AmSipReply& reply, 
AmSipDialog::Status old_dlg_st
     params["code"] = int2str(reply.code);
     params["reason"] = reply.reason;
     params["hdrs"] = reply.hdrs;
-    params["content_type"] = reply.content_type;
-    params["body"] = reply.body;
-
     params["cseq"] = int2str(reply.cseq);
 
     params["dlg_status"] = dlgStatusStr(dlg.getStatus());
@@ -337,9 +348,6 @@ void DSMCall::onRemoteDisappeared(const AmSipReply& reply) {
   params["code"] = int2str(reply.code);
   params["reason"] = reply.reason;
   params["hdrs"] = reply.hdrs;
-  params["content_type"] = reply.content_type;
-  params["body"] = reply.body;
-
   params["cseq"] = int2str(reply.cseq);
 
   params["dlg_status"] = dlgStatusStr(dlg.getStatus());
diff --git a/apps/dsm/mods/mod_dlg/ModDlg.cpp b/apps/dsm/mods/mod_dlg/ModDlg.cpp
index 740410a..d51648a 100644
--- a/apps/dsm/mods/mod_dlg/ModDlg.cpp
+++ b/apps/dsm/mods/mod_dlg/ModDlg.cpp
@@ -136,12 +136,9 @@ EXEC_ACTION_START(DLGAcceptInviteAction) {
   }
 
   try {
-    string sdp_reply;
-
-    // sess->acceptAudio(sc_sess->last_req.get()->body,
-    //                       sc_sess->last_req.get()->hdrs,&sdp_reply);
+    AmMimeBody sdp_body;
     if(sess->dlg.reply(*sc_sess->last_req.get(),code_i, reason,
-                "application/sdp",sdp_reply) != 0)
+                      sdp_body.addPart(SIP_APPLICATION_SDP)) != 0)
       throw AmSession::Exception(500,"could not send response");
        
   }catch(const AmSession::Exception& e){

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to