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

Author: Stefan Sayer <[email protected]>
Committer: Stefan Sayer <[email protected]>
Date:   Thu Aug  9 15:43:46 2012 +0200

b/f: handle exception in AmRtpStream::init gracefully

based on a patch by Emil Kroymann

---

 core/AmSession.cpp |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/core/AmSession.cpp b/core/AmSession.cpp
index de0d8e5..8e97356 100644
--- a/core/AmSession.cpp
+++ b/core/AmSession.cpp
@@ -1060,20 +1060,23 @@ int AmSession::onSdpCompleted(const AmSdp& local_sdp, 
const AmSdp& remote_sdp)
   //   - check if the stream coresponding to the media ID 
   //     should be created or updated   
   //
-  int ret = RTPStream()->init(local_sdp,remote_sdp);
+  int ret = 0;
+  try {
+    ret = RTPStream()->init(local_sdp,remote_sdp);
+  } catch (const string& s) {
+    ERROR("Error while initializing RTP stream: '%s'\n", s.c_str());
+    ret = -1;
+  } catch (...) {
+    ERROR("Error while initializing RTP stream (unknown exception in 
AmRTPStream::init)\n");
+    ret = -1;
+  }
   unlockAudio();
 
   if (!isProcessingMedia()) {
     setInbandDetector(AmConfig::DefaultDTMFDetector);
   }
 
-  if(ret){
-    ERROR("while initializing RTP stream\n");
-    return -1;
-  }
-
-
-  return 0;
+  return ret;
 }
 
 void AmSession::onEarlySessionStart()

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

Reply via email to