[ekiga/ds-gtk-application] Protocol: Added method allowing to hangup all calls.
- From: Damien Sandras <dsandras src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga/ds-gtk-application] Protocol: Added method allowing to hangup all calls.
- Date: Sun, 9 Feb 2014 12:38:10 +0000 (UTC)
commit 37a223fa08abc08969280116e3aef60bbfe46803
Author: Damien Sandras <dsandras beip be>
Date: Sun Feb 9 13:17:27 2014 +0100
Protocol: Added method allowing to hangup all calls.
lib/engine/components/opal/opal-call-manager.cpp | 7 +++++++
lib/engine/components/opal/opal-call-manager.h | 3 ++-
lib/engine/protocol/call-core.cpp | 9 +++++++++
lib/engine/protocol/call-core.h | 5 +++++
lib/engine/protocol/call-manager.h | 12 ++++++++----
5 files changed, 31 insertions(+), 5 deletions(-)
---
diff --git a/lib/engine/components/opal/opal-call-manager.cpp
b/lib/engine/components/opal/opal-call-manager.cpp
index 2e0ba0a..70c4074 100644
--- a/lib/engine/components/opal/opal-call-manager.cpp
+++ b/lib/engine/components/opal/opal-call-manager.cpp
@@ -223,6 +223,7 @@ CallManager::~CallManager ()
g_async_queue_unref (queue);
}
+
bool
CallManager::populate_menu (const std::string fullname,
const std::string uri,
@@ -647,6 +648,12 @@ bool CallManager::dial (const std::string & uri)
}
+void CallManager::hang_up ()
+{
+ ClearAllCalls (OpalConnection::EndedByLocalUser, true);
+}
+
+
void CallManager::set_video_options (const CallManager::VideoOptions & options)
{
OpalMediaFormatList media_formats_list;
diff --git a/lib/engine/components/opal/opal-call-manager.h b/lib/engine/components/opal/opal-call-manager.h
index 80bd1a0..a1c0527 100644
--- a/lib/engine/components/opal/opal-call-manager.h
+++ b/lib/engine/components/opal/opal-call-manager.h
@@ -96,7 +96,8 @@ public:
void setup (const std::string & setting = "");
/** Call Manager **/
- bool dial (const std::string & uri);
+ bool dial (const std::string & uri);
+ void hang_up ();
void set_display_name (const std::string & name);
const std::string & get_display_name () const;
diff --git a/lib/engine/protocol/call-core.cpp b/lib/engine/protocol/call-core.cpp
index 9b0ad4c..8ed0027 100644
--- a/lib/engine/protocol/call-core.cpp
+++ b/lib/engine/protocol/call-core.cpp
@@ -86,6 +86,15 @@ bool CallCore::dial (const std::string uri)
}
+void CallCore::hang_up ()
+{
+ for (std::set<boost::shared_ptr<CallManager> >::iterator iter = managers.begin ();
+ iter != managers.end ();
+ iter++)
+ (*iter)->hang_up ();
+}
+
+
void CallCore::add_call (boost::shared_ptr<Call> call, boost::shared_ptr<CallManager> manager)
{
boost::shared_ptr<Ekiga::scoped_connections> conns(new Ekiga::scoped_connections);
diff --git a/lib/engine/protocol/call-core.h b/lib/engine/protocol/call-core.h
index cb4a987..945acbe 100644
--- a/lib/engine/protocol/call-core.h
+++ b/lib/engine/protocol/call-core.h
@@ -134,6 +134,11 @@ namespace Ekiga
*/
bool dial (const std::string uri);
+ /** Hang up all active calls (if any).
+ */
+ void hang_up ();
+
+
/*** Call Related Signals ***/
/** See call.h for the API
diff --git a/lib/engine/protocol/call-manager.h b/lib/engine/protocol/call-manager.h
index 2a0df32..b3934bf 100644
--- a/lib/engine/protocol/call-manager.h
+++ b/lib/engine/protocol/call-manager.h
@@ -102,15 +102,19 @@ namespace Ekiga
boost::signals2::signal<void(boost::shared_ptr<CallProtocolManager>)> manager_added;
- /*
- * CALL MANAGEMENT
- */
+ /*
+ * CALL MANAGEMENT
+ */
/** Create a call based on the remote uri given as parameter
* @param: An uri
* @return: true if a Ekiga::Call could be created
*/
- virtual bool dial (const std::string & uri) = 0;
+ virtual bool dial (const std::string & uri) = 0;
+
+ /** Hang up all active calls (if any).
+ */
+ virtual void hang_up () = 0;
/*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]