Module: sems
Branch: rco/offer_answer
Commit: 625064dded810631408668ea432557db42576bb9
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=625064dded810631408668ea432557db42576bb9

Author: Raphael Coeffic <[email protected]>
Committer: Raphael Coeffic <[email protected]>
Date:   Thu Apr 21 17:53:31 2011 +0200

check SDP in onSdpCompleted();

---

 core/AmSession.cpp |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/core/AmSession.cpp b/core/AmSession.cpp
index 29374d4..36366fa 100644
--- a/core/AmSession.cpp
+++ b/core/AmSession.cpp
@@ -1004,6 +1004,24 @@ int AmSession::onSdpCompleted(const AmSdp& local_sdp, 
const AmSdp& remote_sdp)
 {
   DBG("AmSession::onSdpCompleted(...) ...\n");
 
+  if(local_sdp.media.empty() || remote_sdp.media.empty()) {
+
+    ERROR("Invalid SDP");
+
+    string debug_str;
+    local_sdp.print(debug_str);
+    ERROR("Local SDP:\n%s",
+         debug_str.empty() ? "<empty>"
+         : debug_str.c_str());
+    
+    remote_sdp.print(debug_str);
+    ERROR("Remote SDP:\n%s",
+         debug_str.empty() ? "<empty>"
+         : debug_str.c_str());
+
+    return -1;
+  }
+
   lockAudio();
   // TODO: 
   //   - get the right media ID

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

Reply via email to