ekiga r7318 - in trunk: . lib/engine/addressbook/call-history lib/engine/protocol/skel src/endpoints src/gui
- From: dsandras svn gnome org
- To: svn-commits-list gnome org
- Subject: ekiga r7318 - in trunk: . lib/engine/addressbook/call-history lib/engine/protocol/skel src/endpoints src/gui
- Date: Sat, 8 Nov 2008 20:41:35 +0000 (UTC)
Author: dsandras
Date: Sat Nov 8 20:41:35 2008
New Revision: 7318
URL: http://svn.gnome.org/viewvc/ekiga?rev=7318&view=rev
Log:
Prevent crash on exit using gmref_ptr for the CallProtocolManager
and for the CallManager.
Modified:
trunk/ChangeLog
trunk/lib/engine/addressbook/call-history/history-book.cpp
trunk/lib/engine/addressbook/call-history/history-book.h
trunk/lib/engine/protocol/skel/call-core.cpp
trunk/lib/engine/protocol/skel/call-core.h
trunk/lib/engine/protocol/skel/call-manager.cpp
trunk/lib/engine/protocol/skel/call-manager.h
trunk/lib/engine/protocol/skel/call-protocol-manager.h
trunk/src/endpoints/manager.cpp
trunk/src/endpoints/opal-gmconf-bridge.cpp
trunk/src/endpoints/opal-main.cpp
trunk/src/gui/main.cpp
trunk/src/gui/statusicon.cpp
Modified: trunk/lib/engine/addressbook/call-history/history-book.cpp
==============================================================================
--- trunk/lib/engine/addressbook/call-history/history-book.cpp (original)
+++ trunk/lib/engine/addressbook/call-history/history-book.cpp Sat Nov 8 20:41:35 2008
@@ -189,7 +189,7 @@
}
void
-History::Book::on_missed_call (Ekiga::CallManager &/*manager*/,
+History::Book::on_missed_call (gmref_ptr<Ekiga::CallManager> /*manager*/,
gmref_ptr<Ekiga::Call> call)
{
add (call->get_remote_party_name (),
@@ -200,7 +200,7 @@
}
void
-History::Book::on_cleared_call (Ekiga::CallManager &/*manager*/,
+History::Book::on_cleared_call (gmref_ptr<Ekiga::CallManager> /*manager*/,
gmref_ptr<Ekiga::Call> call,
std::string /*message*/)
{
Modified: trunk/lib/engine/addressbook/call-history/history-book.h
==============================================================================
--- trunk/lib/engine/addressbook/call-history/history-book.h (original)
+++ trunk/lib/engine/addressbook/call-history/history-book.h Sat Nov 8 20:41:35 2008
@@ -39,6 +39,7 @@
#include <libxml/tree.h>
#include "call-core.h"
+#include "call-manager.h"
#include "book-impl.h"
#include "history-contact.h"
@@ -98,10 +99,10 @@
void common_add (Contact &contact);
- void on_missed_call (Ekiga::CallManager &manager,
+ void on_missed_call (gmref_ptr<Ekiga::CallManager> manager,
gmref_ptr<Ekiga::Call> call);
- void on_cleared_call (Ekiga::CallManager &manager,
+ void on_cleared_call (gmref_ptr<Ekiga::CallManager> manager,
gmref_ptr<Ekiga::Call> call,
std::string message);
Modified: trunk/lib/engine/protocol/skel/call-core.cpp
==============================================================================
--- trunk/lib/engine/protocol/skel/call-core.cpp (original)
+++ trunk/lib/engine/protocol/skel/call-core.cpp Sat Nov 8 20:41:35 2008
@@ -46,12 +46,12 @@
using namespace Ekiga;
-void CallCore::add_manager (CallManager &manager)
+void CallCore::add_manager (gmref_ptr<CallManager> manager)
{
- managers.insert (&manager);
+ managers.insert (manager);
manager_added.emit (manager);
- manager.ready.connect (sigc::bind (sigc::mem_fun (this, &CallCore::on_manager_ready), &manager));
+ manager->ready.connect (sigc::bind (sigc::mem_fun (this, &CallCore::on_manager_ready), manager));
}
@@ -81,7 +81,7 @@
bool CallCore::dial (const std::string uri)
{
- for (std::set<CallManager *>::iterator iter = managers.begin ();
+ for (std::set<gmref_ptr<CallManager> >::iterator iter = managers.begin ();
iter != managers.end ();
iter++) {
if ((*iter)->dial (uri))
@@ -92,7 +92,7 @@
}
-void CallCore::add_call (gmref_ptr<Call> call, CallManager *manager)
+void CallCore::add_call (gmref_ptr<Call> call, gmref_ptr<CallManager> manager)
{
std::list<sigc::connection> conns;
@@ -115,87 +115,84 @@
void CallCore::remove_call (gmref_ptr<Call> call)
{
- while (calls.begin () != calls.end ()) {
+ for (std::list<sigc::connection>::iterator iter2 = calls [call->get_id ()].begin ();
+ iter2 != calls [call->get_id ()].end ();
+ ++iter2)
+ iter2->disconnect ();
- for (std::list<sigc::connection>::iterator iter2 = calls.begin()->second.begin ();
- iter2 != calls.begin()->second.end ();
- ++iter2)
- iter2->disconnect ();
-
- calls.erase (calls.begin()->first);
- }
+ calls.erase (call->get_id ());
}
-void CallCore::on_ringing_call (gmref_ptr<Call> call, CallManager *manager)
+void CallCore::on_ringing_call (gmref_ptr<Call> call, gmref_ptr<CallManager> manager)
{
- ringing_call.emit (*manager, call);
+ ringing_call.emit (manager, call);
}
-void CallCore::on_setup_call (gmref_ptr<Call> call, CallManager *manager)
+void CallCore::on_setup_call (gmref_ptr<Call> call, gmref_ptr<CallManager> manager)
{
- setup_call.emit (*manager, call);
+ setup_call.emit (manager, call);
}
-void CallCore::on_missed_call (gmref_ptr<Call> call, CallManager *manager)
+void CallCore::on_missed_call (gmref_ptr<Call> call, gmref_ptr<CallManager> manager)
{
- missed_call.emit (*manager, call);
+ missed_call.emit (manager, call);
}
-void CallCore::on_cleared_call (std::string reason, gmref_ptr<Call> call, CallManager *manager)
+void CallCore::on_cleared_call (std::string reason, gmref_ptr<Call> call, gmref_ptr<CallManager> manager)
{
- cleared_call.emit (*manager, call, reason);
+ cleared_call.emit (manager, call, reason);
}
-void CallCore::on_established_call (gmref_ptr<Call> call, CallManager *manager)
+void CallCore::on_established_call (gmref_ptr<Call> call, gmref_ptr<CallManager> manager)
{
- established_call.emit (*manager, call);
+ established_call.emit (manager, call);
}
-void CallCore::on_held_call (gmref_ptr<Call> call, CallManager *manager)
+void CallCore::on_held_call (gmref_ptr<Call> call, gmref_ptr<CallManager> manager)
{
- held_call.emit (*manager, call);
+ held_call.emit (manager, call);
}
-void CallCore::on_retrieved_call (gmref_ptr<Call> call, CallManager *manager)
+void CallCore::on_retrieved_call (gmref_ptr<Call> call, gmref_ptr<CallManager> manager)
{
- retrieved_call.emit (*manager, call);
+ retrieved_call.emit (manager, call);
}
-void CallCore::on_stream_opened (std::string name, Call::StreamType type, bool is_transmitting, gmref_ptr<Call> call, CallManager *manager)
+void CallCore::on_stream_opened (std::string name, Call::StreamType type, bool is_transmitting, gmref_ptr<Call> call, gmref_ptr<CallManager> manager)
{
- stream_opened.emit (*manager, call, name, type, is_transmitting);
+ stream_opened.emit (manager, call, name, type, is_transmitting);
}
-void CallCore::on_stream_closed (std::string name, Call::StreamType type, bool is_transmitting, gmref_ptr<Call> call, CallManager *manager)
+void CallCore::on_stream_closed (std::string name, Call::StreamType type, bool is_transmitting, gmref_ptr<Call> call, gmref_ptr<CallManager> manager)
{
- stream_closed.emit (*manager, call, name, type, is_transmitting);
+ stream_closed.emit (manager, call, name, type, is_transmitting);
}
-void CallCore::on_stream_paused (std::string name, Call::StreamType type, gmref_ptr<Call> call, CallManager *manager)
+void CallCore::on_stream_paused (std::string name, Call::StreamType type, gmref_ptr<Call> call, gmref_ptr<CallManager> manager)
{
- stream_paused.emit (*manager, call, name, type);
+ stream_paused.emit (manager, call, name, type);
}
-void CallCore::on_stream_resumed (std::string name, Call::StreamType type, gmref_ptr<Call> call, CallManager *manager)
+void CallCore::on_stream_resumed (std::string name, Call::StreamType type, gmref_ptr<Call> call, gmref_ptr<CallManager> manager)
{
- stream_resumed.emit (*manager, call, name, type);
+ stream_resumed.emit (manager, call, name, type);
}
-void CallCore::on_manager_ready (CallManager *manager)
+void CallCore::on_manager_ready (gmref_ptr<CallManager> manager)
{
- manager_ready.emit (*manager);
+ manager_ready.emit (manager);
nr_ready++;
if (nr_ready >= managers.size ())
Modified: trunk/lib/engine/protocol/skel/call-core.h
==============================================================================
--- trunk/lib/engine/protocol/skel/call-core.h (original)
+++ trunk/lib/engine/protocol/skel/call-core.h Sat Nov 8 20:41:35 2008
@@ -41,6 +41,8 @@
#include "chain-of-responsibility.h"
#include "services.h"
#include "call.h"
+#include "call-manager.h"
+#include "call-protocol-manager.h"
#include "gmref.h"
#include <sigc++/sigc++.h>
@@ -64,8 +66,8 @@
{
public:
- typedef std::set<CallManager *>::iterator iterator;
- typedef std::set<CallManager *>::const_iterator const_iterator;
+ typedef std::set<gmref_ptr<CallManager> >::iterator iterator;
+ typedef std::set<gmref_ptr<CallManager> >::const_iterator const_iterator;
/** The constructor
*/
@@ -96,7 +98,7 @@
* @param call is the call to be added.
* @param manager is the CallManager handling it.
*/
- void add_call (gmref_ptr<Call> call, CallManager *manager);
+ void add_call (gmref_ptr<Call> call, gmref_ptr<CallManager> manager);
/** Remove a call handled by the CallCore serice.
* @param call is the call to be removed.
@@ -106,7 +108,7 @@
/** Adds a CallManager to the CallCore service.
* @param The manager to be added.
*/
- void add_manager (CallManager &manager);
+ void add_manager (gmref_ptr<CallManager> manager);
/** Return iterator to beginning
* @return iterator to beginning
@@ -123,7 +125,7 @@
/** This signal is emitted when a Ekiga::CallManager has been
* added to the CallCore Service.
*/
- sigc::signal<void, CallManager &> manager_added;
+ sigc::signal<void, gmref_ptr<CallManager> > manager_added;
/*** Call Management ***/
@@ -138,20 +140,20 @@
/** See call.h for the API
*/
- sigc::signal<void, CallManager &, gmref_ptr<Call> > ringing_call;
- sigc::signal<void, CallManager &, gmref_ptr<Call> > setup_call;
- sigc::signal<void, CallManager &, gmref_ptr<Call> > missed_call;
- sigc::signal<void, CallManager &, gmref_ptr<Call>, std::string> cleared_call;
- sigc::signal<void, CallManager &, gmref_ptr<Call> > established_call;
- sigc::signal<void, CallManager &, gmref_ptr<Call> > held_call;
- sigc::signal<void, CallManager &, gmref_ptr<Call> > retrieved_call;
- sigc::signal<void, CallManager &, gmref_ptr<Call>, std::string, Call::StreamType, bool> stream_opened;
- sigc::signal<void, CallManager &, gmref_ptr<Call>, std::string, Call::StreamType, bool> stream_closed;
- sigc::signal<void, CallManager &, gmref_ptr<Call>, std::string, Call::StreamType> stream_paused;
- sigc::signal<void, CallManager &, gmref_ptr<Call>, std::string, Call::StreamType> stream_resumed;
+ sigc::signal<void, gmref_ptr<CallManager> , gmref_ptr<Call> > ringing_call;
+ sigc::signal<void, gmref_ptr<CallManager> , gmref_ptr<Call> > setup_call;
+ sigc::signal<void, gmref_ptr<CallManager> , gmref_ptr<Call> > missed_call;
+ sigc::signal<void, gmref_ptr<CallManager> , gmref_ptr<Call>, std::string> cleared_call;
+ sigc::signal<void, gmref_ptr<CallManager> , gmref_ptr<Call> > established_call;
+ sigc::signal<void, gmref_ptr<CallManager> , gmref_ptr<Call> > held_call;
+ sigc::signal<void, gmref_ptr<CallManager> , gmref_ptr<Call> > retrieved_call;
+ sigc::signal<void, gmref_ptr<CallManager> , gmref_ptr<Call>, std::string, Call::StreamType, bool> stream_opened;
+ sigc::signal<void, gmref_ptr<CallManager> , gmref_ptr<Call>, std::string, Call::StreamType, bool> stream_closed;
+ sigc::signal<void, gmref_ptr<CallManager> , gmref_ptr<Call>, std::string, Call::StreamType> stream_paused;
+ sigc::signal<void, gmref_ptr<CallManager> , gmref_ptr<Call>, std::string, Call::StreamType> stream_resumed;
/*** Misc ***/
- sigc::signal<void, CallManager &> manager_ready;
+ sigc::signal<void, gmref_ptr<CallManager> > manager_ready;
sigc::signal<void> ready;
/** This chain allows the CallCore to report errors to the user
@@ -159,30 +161,30 @@
ChainOfResponsibility<std::string> errors;
private:
- void on_new_call (gmref_ptr<Call> call, CallManager *manager);
- void on_ringing_call (gmref_ptr<Call> call, CallManager *manager);
- void on_setup_call (gmref_ptr<Call> call, CallManager *manager);
- void on_missed_call (gmref_ptr<Call> call, CallManager *manager);
- void on_cleared_call (std::string, gmref_ptr<Call> call, CallManager *manager);
- void on_established_call (gmref_ptr<Call> call, CallManager *manager);
- void on_held_call (gmref_ptr<Call> call, CallManager *manager);
- void on_retrieved_call (gmref_ptr<Call> call, CallManager *manager);
- void on_stream_opened (std::string name, Call::StreamType type, bool is_transmitting, gmref_ptr<Call> call, CallManager *manager);
- void on_stream_closed (std::string name, Call::StreamType type, bool is_transmitting, gmref_ptr<Call> call, CallManager *manager);
- void on_stream_paused (std::string name, Call::StreamType type, gmref_ptr<Call> call, CallManager *manager);
- void on_stream_resumed (std::string name, Call::StreamType type, gmref_ptr<Call> call, CallManager *manager);
-
- void on_im_failed (std::string, std::string, CallManager *manager);
- void on_im_sent (std::string, std::string, CallManager *manager);
- void on_im_received (std::string, std::string, std::string, CallManager *manager);
- void on_new_chat (std::string, std::string, CallManager *manager);
+ void on_new_call (gmref_ptr<Call> call, gmref_ptr<CallManager> manager);
+ void on_ringing_call (gmref_ptr<Call> call, gmref_ptr<CallManager> manager);
+ void on_setup_call (gmref_ptr<Call> call, gmref_ptr<CallManager> manager);
+ void on_missed_call (gmref_ptr<Call> call, gmref_ptr<CallManager> manager);
+ void on_cleared_call (std::string, gmref_ptr<Call> call, gmref_ptr<CallManager> manager);
+ void on_established_call (gmref_ptr<Call> call, gmref_ptr<CallManager> manager);
+ void on_held_call (gmref_ptr<Call> call, gmref_ptr<CallManager> manager);
+ void on_retrieved_call (gmref_ptr<Call> call, gmref_ptr<CallManager> manager);
+ void on_stream_opened (std::string name, Call::StreamType type, bool is_transmitting, gmref_ptr<Call> call, gmref_ptr<CallManager> manager);
+ void on_stream_closed (std::string name, Call::StreamType type, bool is_transmitting, gmref_ptr<Call> call, gmref_ptr<CallManager> manager);
+ void on_stream_paused (std::string name, Call::StreamType type, gmref_ptr<Call> call, gmref_ptr<CallManager> manager);
+ void on_stream_resumed (std::string name, Call::StreamType type, gmref_ptr<Call> call, gmref_ptr<CallManager> manager);
+
+ void on_im_failed (std::string, std::string, gmref_ptr<CallManager> manager);
+ void on_im_sent (std::string, std::string, gmref_ptr<CallManager> manager);
+ void on_im_received (std::string, std::string, std::string, gmref_ptr<CallManager> manager);
+ void on_new_chat (std::string, std::string, gmref_ptr<CallManager> manager);
- void on_manager_ready (CallManager *manager);
+ void on_manager_ready (gmref_ptr<CallManager> manager);
void on_call_removed (gmref_ptr<Call> call);
- std::set<CallManager *> managers;
+ std::set<gmref_ptr<CallManager> > managers;
std::map<std::string, std::list<sigc::connection> > calls;
unsigned nr_ready;
};
Modified: trunk/lib/engine/protocol/skel/call-manager.cpp
==============================================================================
--- trunk/lib/engine/protocol/skel/call-manager.cpp (original)
+++ trunk/lib/engine/protocol/skel/call-manager.cpp Sat Nov 8 20:41:35 2008
@@ -43,14 +43,14 @@
using namespace Ekiga;
-void CallManager::add_protocol_manager (CallProtocolManager &manager)
+void CallManager::add_protocol_manager (gmref_ptr<CallProtocolManager> manager)
{
- managers.insert (&manager);
+ managers.insert (manager);
manager_added.emit (manager);
}
-CallProtocolManager* CallManager::get_protocol_manager (const std::string &protocol) const
+gmref_ptr<CallProtocolManager> CallManager::get_protocol_manager (const std::string &protocol) const
{
for (CallManager::iterator iter = begin ();
iter != end ();
Modified: trunk/lib/engine/protocol/skel/call-manager.h
==============================================================================
--- trunk/lib/engine/protocol/skel/call-manager.h (original)
+++ trunk/lib/engine/protocol/skel/call-manager.h Sat Nov 8 20:41:35 2008
@@ -39,6 +39,8 @@
#ifndef __CALL_MANAGER_H__
#define __CALL_MANAGER_H__
+#include "gmref.h"
+
#include "call-core.h"
#include "call-protocol-manager.h"
#include "codec-description.h"
@@ -51,161 +53,160 @@
* @{
*/
- class CallManager
- {
+ class CallManager : public virtual GmRefCounted
+ {
- public:
- typedef std::list<CallProtocolManager::Interface> InterfaceList;
- typedef std::set<CallProtocolManager *>::iterator iterator;
- typedef std::set<CallProtocolManager *>::const_iterator const_iterator;
-
- /* The constructor
- */
- CallManager () {};
-
- /* The destructor
- */
- virtual ~CallManager () {}
-
- /** Add a CallProtocolManager to the CallManager.
- * @param The manager to be added.
- */
- void add_protocol_manager (CallProtocolManager &manager);
-
- /** Return a pointer to a CallProtocolManager of the CallManager.
- * @param protocol is the protcol name.
- * @return a pointer to the CallProtocolManager or NULL if none.
- */
- CallProtocolManager* get_protocol_manager (const std::string &protocol) const;
-
- /** Return iterator to beginning
- * @return iterator to beginning
- */
- iterator begin ();
- const_iterator begin () const;
-
- /** Return iterator to end
- * @return iterator to end
- */
- iterator end ();
- const_iterator end () const;
-
- /** This signal is emitted when a Ekiga::CallProtocolManager has been
- * added to the CallManager.
- */
- sigc::signal<void, CallProtocolManager &> manager_added;
-
-
- /*
- * 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;
-
-
- /*
- * PROTOCOL INFORMATION
- */
-
- /**
- * @return the protocol name
- */
- const std::list<std::string> get_protocol_names () const;
-
- /**
- * @return the interface on which we are accepting calls. Generally,
- * under the form protocol:IP:port.
- */
- const CallManager::InterfaceList get_interfaces () const;
-
-
- /*
- * Misc
- */
-
- /** Enable the given codecs
- * @param codecs is a set of the codecs and their descriptions
- * when the function returns, the list also contains disabled
- * codecs supported by the CallManager. Unsupported codecs
- * have been removed.
- */
- virtual void set_codecs (CodecList & codecs) = 0;
-
- /** Return the list of available codecs
- * @return a set of the codecs and their descriptions
- */
- virtual const Ekiga::CodecList & get_codecs () const = 0;
-
- /** Set the display name used on outgoing calls
- * @param name is the display name to use.
- */
- virtual void set_display_name (const std::string & name) = 0;
-
- /** Return the display name used on outgoing calls
- */
- virtual const std::string & get_display_name () const = 0;
-
- /** Enable echo cancellation
- * @param enabled is true if echo cancellation should be enabled, false
- * otherwise.
- */
- virtual void set_echo_cancellation (bool enabled) = 0;
-
- /** Get echo cancellation setting
- * @return true if echo cancellation is enabled.
- */
- virtual bool get_echo_cancellation () const = 0;
-
- /** Enable silence detection
- * @param enabled is true if silence detection should be enabled, false
- * otherwise.
- */
- virtual void set_silence_detection (bool enabled) = 0;
-
- /** Get silence detection setting
- * @return true if silence detection is enabled.
- */
- virtual bool get_silence_detection () const = 0;
-
- /** Set maximum jitter
- * @param max_val is the maximum jitter for calls in seconds.
- */
- virtual void set_maximum_jitter (unsigned max_val) = 0;
-
- /** Get maximum jitter
- * @return the maximum jitter for calls in seconds.
- */
- virtual unsigned get_maximum_jitter () const = 0;
-
- /** Set delay before dropping an incoming call
- * @param delay is the delay after which the call should be rejected
- * (or forwarded if supported by the CallManager).
- */
- virtual void set_reject_delay (unsigned delay) = 0;
-
- /** Get delay before dropping an incoming call
- * @return the delay in seconds after which a call should be rejected
- * (or forwarded if supported by the CallManager).
- */
- virtual unsigned get_reject_delay () const = 0;
-
- /*
- * MISC
- */
- sigc::signal<void> ready;
+ public:
- private:
- std::set<CallProtocolManager *> managers;
- };
+ typedef std::list<CallProtocolManager::Interface> InterfaceList;
+ typedef std::set<gmref_ptr<CallProtocolManager> >::iterator iterator;
+ typedef std::set<gmref_ptr<CallProtocolManager> >::const_iterator const_iterator;
+
+ /* The constructor
+ */
+ CallManager () {};
+
+ /* The destructor
+ */
+ virtual ~CallManager () {}
+
+ /** Add a CallProtocolManager to the CallManager.
+ * @param The manager to be added.
+ */
+ void add_protocol_manager (gmref_ptr<CallProtocolManager> manager);
+
+ /** Return a pointer to a CallProtocolManager of the CallManager.
+ * @param protocol is the protcol name.
+ * @return a pointer to the CallProtocolManager or NULL if none.
+ */
+ gmref_ptr<CallProtocolManager> get_protocol_manager (const std::string &protocol) const;
+
+ /** Return iterator to beginning
+ * @return iterator to beginning
+ */
+ iterator begin ();
+ const_iterator begin () const;
+
+ /** Return iterator to end
+ * @return iterator to end
+ */
+ iterator end ();
+ const_iterator end () const;
+
+ /** This signal is emitted when a Ekiga::CallProtocolManager has been
+ * added to the CallManager.
+ */
+ sigc::signal<void, gmref_ptr<CallProtocolManager> > manager_added;
+
+
+ /*
+ * 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;
+
+
+ /*
+ * PROTOCOL INFORMATION
+ */
+
+ /**
+ * @return the protocol name
+ */
+ const std::list<std::string> get_protocol_names () const;
+
+ /**
+ * @return the interface on which we are accepting calls. Generally,
+ * under the form protocol:IP:port.
+ */
+ const CallManager::InterfaceList get_interfaces () const;
+
+
+ /*
+ * Misc
+ */
+
+ /** Enable the given codecs
+ * @param codecs is a set of the codecs and their descriptions
+ * when the function returns, the list also contains disabled
+ * codecs supported by the CallManager. Unsupported codecs
+ * have been removed.
+ */
+ virtual void set_codecs (CodecList & codecs) = 0;
+
+ /** Return the list of available codecs
+ * @return a set of the codecs and their descriptions
+ */
+ virtual const Ekiga::CodecList & get_codecs () const = 0;
+
+ /** Set the display name used on outgoing calls
+ * @param name is the display name to use.
+ */
+ virtual void set_display_name (const std::string & name) = 0;
+
+ /** Return the display name used on outgoing calls
+ */
+ virtual const std::string & get_display_name () const = 0;
+
+ /** Enable echo cancellation
+ * @param enabled is true if echo cancellation should be enabled, false
+ * otherwise.
+ */
+ virtual void set_echo_cancellation (bool enabled) = 0;
+
+ /** Get echo cancellation setting
+ * @return true if echo cancellation is enabled.
+ */
+ virtual bool get_echo_cancellation () const = 0;
+
+ /** Enable silence detection
+ * @param enabled is true if silence detection should be enabled, false
+ * otherwise.
+ */
+ virtual void set_silence_detection (bool enabled) = 0;
+
+ /** Get silence detection setting
+ * @return true if silence detection is enabled.
+ */
+ virtual bool get_silence_detection () const = 0;
+
+ /** Set maximum jitter
+ * @param max_val is the maximum jitter for calls in seconds.
+ */
+ virtual void set_maximum_jitter (unsigned max_val) = 0;
+
+ /** Get maximum jitter
+ * @return the maximum jitter for calls in seconds.
+ */
+ virtual unsigned get_maximum_jitter () const = 0;
+
+ /** Set delay before dropping an incoming call
+ * @param delay is the delay after which the call should be rejected
+ * (or forwarded if supported by the CallManager).
+ */
+ virtual void set_reject_delay (unsigned delay) = 0;
+
+ /** Get delay before dropping an incoming call
+ * @return the delay in seconds after which a call should be rejected
+ * (or forwarded if supported by the CallManager).
+ */
+ virtual unsigned get_reject_delay () const = 0;
+
+ /*
+ * MISC
+ */
+ sigc::signal<void> ready;
-/**
- * @}
- */
+ private:
+ std::set<gmref_ptr<CallProtocolManager> > managers;
+ };
+ /**
+ * @}
+ */
};
-
#endif
Modified: trunk/lib/engine/protocol/skel/call-protocol-manager.h
==============================================================================
--- trunk/lib/engine/protocol/skel/call-protocol-manager.h (original)
+++ trunk/lib/engine/protocol/skel/call-protocol-manager.h Sat Nov 8 20:41:35 2008
@@ -49,77 +49,76 @@
* @{:
*/
- class CallProtocolManager
+ class CallProtocolManager: public virtual GmRefCounted
+ {
+
+ public:
+ class Interface
{
+ public:
+ std::string voip_protocol;
+ std::string protocol;
+ std::string id;
+ bool publish;
+ unsigned port;
+ };
- public:
- class Interface
- {
- public:
- std::string voip_protocol;
- std::string protocol;
- std::string id;
- bool publish;
- unsigned port;
- };
-
-
- /* The constructor
- */
- CallProtocolManager () {};
-
- /* The destructor
- */
- virtual ~CallProtocolManager () {};
-
-
- /*
- * 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;
-
-
- /*
- * PROTOCOL INFORMATION
- */
-
- /** Return the protocol name
- * @return the protocol name
- */
- virtual const std::string & get_protocol_name () const = 0;
-
-
- /*
- * MISC
- */
-
- /** Return the listen interface
- * @return the interface on which we are accepting calls. Generally,
- * under the form protocol:IP:port.
- */
- virtual const Interface & get_listen_interface () const = 0;
-
- /** Set the DTMF mode to use to send DTMFs
- * @param mode is the desired DTMF mode
- */
- virtual void set_dtmf_mode (unsigned mode) = 0;
-
- /** Return the current DTMF mode
- * @return the desired DTMF mode
- */
- virtual unsigned get_dtmf_mode () const = 0;
-
- /** Set the port to listen to for incoming calls
- * @param port is the port on which we should bind
- */
- virtual bool set_listen_port (unsigned port) = 0;
- };
+ /* The constructor
+ */
+ CallProtocolManager () {};
+
+ /* The destructor
+ */
+ virtual ~CallProtocolManager () {};
+
+
+ /*
+ * 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;
+
+
+ /*
+ * PROTOCOL INFORMATION
+ */
+
+ /** Return the protocol name
+ * @return the protocol name
+ */
+ virtual const std::string & get_protocol_name () const = 0;
+
+
+ /*
+ * MISC
+ */
+
+ /** Return the listen interface
+ * @return the interface on which we are accepting calls. Generally,
+ * under the form protocol:IP:port.
+ */
+ virtual const Interface & get_listen_interface () const = 0;
+
+ /** Set the DTMF mode to use to send DTMFs
+ * @param mode is the desired DTMF mode
+ */
+ virtual void set_dtmf_mode (unsigned mode) = 0;
+
+ /** Return the current DTMF mode
+ * @return the desired DTMF mode
+ */
+ virtual unsigned get_dtmf_mode () const = 0;
+
+ /** Set the port to listen to for incoming calls
+ * @param port is the port on which we should bind
+ */
+ virtual bool set_listen_port (unsigned port) = 0;
+ };
/**
* @}
Modified: trunk/src/endpoints/manager.cpp
==============================================================================
--- trunk/src/endpoints/manager.cpp (original)
+++ trunk/src/endpoints/manager.cpp Sat Nov 8 20:41:35 2008
@@ -163,6 +163,8 @@
g_async_queue_unref (queue);
gmref_dec (runtime);
+
+ std::cout << "bye callmanager" << std::endl << std::flush;
}
Modified: trunk/src/endpoints/opal-gmconf-bridge.cpp
==============================================================================
--- trunk/src/endpoints/opal-gmconf-bridge.cpp (original)
+++ trunk/src/endpoints/opal-gmconf-bridge.cpp Sat Nov 8 20:41:35 2008
@@ -239,7 +239,7 @@
#ifdef HAVE_SIP
else if (key.find (SIP_KEY) != string::npos) {
- Opal::Sip::EndPoint *sip_manager = dynamic_cast<Opal::Sip::EndPoint *> (manager.get_protocol_manager ("sip"));
+ gmref_ptr<Opal::Sip::EndPoint> sip_manager = manager.get_protocol_manager ("sip");
if (sip_manager) {
if (key == SIP_KEY "outbound_proxy_host") {
@@ -272,7 +272,7 @@
#ifdef HAVE_H323
else if (key.find (SIP_KEY) != string::npos) {
- Opal::H323::EndPoint *h323_manager = dynamic_cast<Opal::H323::EndPoint *> (manager.get_protocol_manager ("h323"));
+ gmref_ptr<Opal::H323::EndPoint> h323_manager = manager.get_protocol_manager ("h323");
if (h323_manager) {
if (key == H323_KEY "enable_h245_tunneling") {
Modified: trunk/src/endpoints/opal-main.cpp
==============================================================================
--- trunk/src/endpoints/opal-main.cpp (original)
+++ trunk/src/endpoints/opal-main.cpp Sat Nov 8 20:41:35 2008
@@ -107,18 +107,18 @@
#ifdef HAVE_SIP
unsigned sip_port = gm_conf_get_int (SIP_KEY "listen_port");
gmref_ptr<Sip::EndPoint> sip_manager = new Sip::EndPoint (*call_manager, core, sip_port);
- call_manager->add_protocol_manager (*sip_manager);
+ call_manager->add_protocol_manager (sip_manager);
account_core->add_account_subscriber (*sip_manager);
#endif
#ifdef HAVE_H323
unsigned h323_port = gm_conf_get_int (H323_KEY "listen_port");
gmref_ptr<H323::EndPoint> h323_manager = new H323::EndPoint (*call_manager, core, h323_port);
- call_manager->add_protocol_manager (*h323_manager);
+ call_manager->add_protocol_manager (h323_manager);
account_core->add_account_subscriber (*h323_manager);
#endif
- call_core->add_manager (*call_manager);
+ call_core->add_manager (call_manager);
new ConfBridge (*call_manager); // FIXME: isn't that leaked!?
Modified: trunk/src/gui/main.cpp
==============================================================================
--- trunk/src/gui/main.cpp (original)
+++ trunk/src/gui/main.cpp Sat Nov 8 20:41:35 2008
@@ -541,7 +541,7 @@
}
-static void on_setup_call_cb (Ekiga::CallManager & /*manager*/,
+static void on_setup_call_cb (gmref_ptr<Ekiga::CallManager> /*manager*/,
gmref_ptr<Ekiga::Call> call,
gpointer self)
{
@@ -567,7 +567,7 @@
}
-static void on_ringing_call_cb (Ekiga::CallManager & /*manager*/,
+static void on_ringing_call_cb (gmref_ptr<Ekiga::CallManager> /*manager*/,
gmref_ptr<Ekiga::Call> call,
gpointer self)
{
@@ -634,7 +634,7 @@
return true;
}
-static void on_established_call_cb (Ekiga::CallManager & /*manager*/,
+static void on_established_call_cb (gmref_ptr<Ekiga::CallManager> /*manager*/,
gmref_ptr<Ekiga::Call> call,
gpointer self)
{
@@ -668,7 +668,7 @@
}
-static void on_cleared_call_cb (Ekiga::CallManager & /*manager*/,
+static void on_cleared_call_cb (gmref_ptr<Ekiga::CallManager> /*manager*/,
gmref_ptr<Ekiga::Call> call,
std::string reason,
gpointer self)
@@ -730,7 +730,7 @@
}
-static void on_held_call_cb (Ekiga::CallManager & /*manager*/,
+static void on_held_call_cb (gmref_ptr<Ekiga::CallManager> /*manager*/,
gmref_ptr<Ekiga::Call> /*call*/,
gpointer self)
{
@@ -741,7 +741,7 @@
}
-static void on_retrieved_call_cb (Ekiga::CallManager & /*manager*/,
+static void on_retrieved_call_cb (gmref_ptr<Ekiga::CallManager> /*manager*/,
gmref_ptr<Ekiga::Call> /*call*/,
gpointer self)
{
@@ -752,7 +752,7 @@
}
-static void on_missed_call_cb (Ekiga::CallManager & /*manager*/,
+static void on_missed_call_cb (gmref_ptr<Ekiga::CallManager> /*manager*/,
gmref_ptr<Ekiga::Call> call,
gpointer self)
{
@@ -771,7 +771,7 @@
}
-static void on_stream_opened_cb (Ekiga::CallManager & /*manager*/,
+static void on_stream_opened_cb (gmref_ptr<Ekiga::CallManager> /*manager*/,
gmref_ptr<Ekiga::Call> /* call */,
std::string name,
Ekiga::Call::StreamType type,
@@ -820,7 +820,7 @@
}
-static void on_stream_closed_cb (Ekiga::CallManager & /*manager*/,
+static void on_stream_closed_cb (gmref_ptr<Ekiga::CallManager> /*manager*/,
gmref_ptr<Ekiga::Call> /* call */,
std::string name,
Ekiga::Call::StreamType type,
@@ -869,7 +869,7 @@
}
-static void on_stream_paused_cb (Ekiga::CallManager & /*manager*/,
+static void on_stream_paused_cb (gmref_ptr<Ekiga::CallManager> /*manager*/,
gmref_ptr<Ekiga::Call> /*call*/,
std::string /*name*/,
Ekiga::Call::StreamType type,
@@ -879,7 +879,7 @@
}
-static void on_stream_resumed_cb (Ekiga::CallManager & /*manager*/,
+static void on_stream_resumed_cb (gmref_ptr<Ekiga::CallManager> /*manager*/,
gmref_ptr<Ekiga::Call> /*call*/,
std::string /*name*/,
Ekiga::Call::StreamType type,
Modified: trunk/src/gui/statusicon.cpp
==============================================================================
--- trunk/src/gui/statusicon.cpp (original)
+++ trunk/src/gui/statusicon.cpp Sat Nov 8 20:41:35 2008
@@ -126,12 +126,12 @@
bool inacall);
static void
-established_call_cb (Ekiga::CallManager & manager,
+established_call_cb (gmref_ptr<Ekiga::CallManager> manager,
gmref_ptr<Ekiga::Call> call,
gpointer self);
static void
-cleared_call_cb (Ekiga::CallManager & manager,
+cleared_call_cb (gmref_ptr<Ekiga::CallManager> manager,
gmref_ptr<Ekiga::Call> call,
std::string reason,
gpointer self);
@@ -355,7 +355,7 @@
static void
-established_call_cb (Ekiga::CallManager & /*manager*/,
+established_call_cb (gmref_ptr<Ekiga::CallManager> /*manager*/,
gmref_ptr<Ekiga::Call> /*call*/,
gpointer self)
{
@@ -364,7 +364,7 @@
static void
-cleared_call_cb (Ekiga::CallManager & /*manager*/,
+cleared_call_cb (gmref_ptr<Ekiga::CallManager> /*manager*/,
gmref_ptr<Ekiga::Call> /*call*/,
std::string /*reason*/,
gpointer self)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]