[prev in list] [next in list] [prev in thread] [next in thread]
List: semsdev
Subject: [Semsdev] git:master: b/f: handle exception in AmRtpStream::init gracefully
From: Stefan Sayer <stefan.sayer () googlemail ! com>
Date: 2012-08-09 13:46:33
Message-ID: 20120809134633.6850BEF8074 () rimmer ! ryngle ! com
[Download RAW message or body]
Module: sems
Branch: master
Commit: 45e213964120b7ba8e922f42b78c72b9f4cc8b92
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=45e213964120b7ba8e922f42b78c72b9f4cc8b92
Author: Stefan Sayer <stefan.sayer@googlemail.com>
Committer: Stefan Sayer <stefan.sayer@googlemail.com>
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
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