[ekiga/gnome-2-26] Fixed regression concerning several call features.
- From: Damien Sandras <dsandras src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [ekiga/gnome-2-26] Fixed regression concerning several call features.
- Date: Tue, 1 Sep 2009 17:51:08 +0000 (UTC)
commit 5dfd6b7e69e158ff1e7d140c23e15ccbaad75ac9
Author: Damien Sandras <dsandras seconix com>
Date: Tue Sep 1 19:50:18 2009 +0200
Fixed regression concerning several call features.
Hopefully, it also fixes possible crashes when manipulating connections.
lib/engine/components/opal/opal-call.cpp | 17 +++++++++--------
lib/engine/components/opal/opal-call.h | 14 ++++++++++++++
2 files changed, 23 insertions(+), 8 deletions(-)
---
diff --git a/lib/engine/components/opal/opal-call.cpp b/lib/engine/components/opal/opal-call.cpp
index 2a4a9d4..32bb512 100644
--- a/lib/engine/components/opal/opal-call.cpp
+++ b/lib/engine/components/opal/opal-call.cpp
@@ -141,8 +141,8 @@ Opal::Call::answer ()
void
Opal::Call::transfer (std::string uri)
{
- PSafePtr<OpalPCSSConnection> connection = GetConnectionAs<OpalPCSSConnection>();
- if (connection)
+ PSafePtr<OpalConnection> connection = get_remote_connection ();
+ if (connection != NULL)
connection->TransferConnection (uri);
}
@@ -151,8 +151,8 @@ void
Opal::Call::toggle_hold ()
{
bool on_hold = false;
- PSafePtr<OpalPCSSConnection> connection = GetConnectionAs<OpalPCSSConnection>();
- if (connection) {
+ PSafePtr<OpalConnection> connection = get_remote_connection ();
+ if (connection != NULL) {
on_hold = connection->IsConnectionOnHold ();
if (!on_hold)
@@ -172,7 +172,7 @@ Opal::Call::toggle_stream_pause (StreamType type)
bool paused = false;
- PSafePtr<OpalPCSSConnection> connection = GetConnectionAs<OpalPCSSConnection>();
+ PSafePtr<OpalConnection> connection = get_remote_connection ();
if (connection != NULL) {
stream = connection->GetMediaStream ((type == Audio) ? OpalMediaType::Audio () : OpalMediaType::Video (), false);
@@ -195,9 +195,10 @@ Opal::Call::toggle_stream_pause (StreamType type)
void
Opal::Call::send_dtmf (const char dtmf)
{
- PSafePtr<OpalPCSSConnection> connection = GetConnectionAs<OpalPCSSConnection>();
- if (connection != NULL)
+ PSafePtr<OpalConnection> connection = get_remote_connection ();
+ if (connection != NULL) {
connection->SendUserInputTone (dtmf, 180);
+ }
}
@@ -636,7 +637,7 @@ Opal::Call::OnNoAnswerTimeout (PTimer &,
if (!forward_uri.empty ()) {
- PSafePtr<OpalPCSSConnection> connection = GetConnectionAs<OpalPCSSConnection>();
+ PSafePtr<OpalConnection> connection = get_remote_connection ();
if (connection != NULL)
connection->ForwardCall (forward_uri);
}
diff --git a/lib/engine/components/opal/opal-call.h b/lib/engine/components/opal/opal-call.h
index bcd63d3..9b92f9f 100644
--- a/lib/engine/components/opal/opal-call.h
+++ b/lib/engine/components/opal/opal-call.h
@@ -195,6 +195,20 @@ private:
*/
void parse_info (OpalConnection & connection);
+ PSafePtr<OpalConnection> get_remote_connection ()
+ {
+ PSafePtr<OpalConnection> connection;
+ for (PSafePtr<OpalConnection> iterConn (connectionsActive, PSafeReference); iterConn != NULL; ++iterConn) {
+ if (PSafePtrCast<OpalConnection, OpalPCSSConnection> (iterConn) == NULL) {
+ connection = iterConn;
+ if (!connection.SetSafetyMode(PSafeReadWrite))
+ connection.SetNULL();
+ break;
+ }
+ }
+ return connection;
+ }
+
/*
*
*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]