[prev in list] [next in list] [prev in thread] [next in thread] 

List:       semsdev
Subject:    [Semsdev] git:rco/offer_answer: check SDP in onSdpCompleted();
From:       Raphael Coeffic <rco () iptel ! org>
Date:       2011-04-21 15:59:37
Message-ID: 20110421155937.8FB3AEF807A () rimmer
[Download RAW message or body]

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 <rco@iptel.org>
Committer: Raphael Coeffic <rco@iptel.org>
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
Semsdev@lists.iptel.org
http://lists.iptel.org/mailman/listinfo/semsdev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic