ekiga r6138 - in trunk: . src/endpoints src/gui
- From: dsandras svn gnome org
- To: svn-commits-list gnome org
- Subject: ekiga r6138 - in trunk: . src/endpoints src/gui
- Date: Sun, 6 Apr 2008 20:44:21 +0100 (BST)
Author: dsandras
Date: Sun Apr 6 20:44:21 2008
New Revision: 6138
URL: http://svn.gnome.org/viewvc/ekiga?rev=6138&view=rev
Log:
Simplified GMManager. Removed all deprecated methods
like GetCurrentCallToken, SetCurrentCallToken, GetCallingState,
SetCallingState, ... as the engine is ready to handle several
simultaneous calls.
Modified:
trunk/ChangeLog
trunk/src/endpoints/h323.cpp
trunk/src/endpoints/manager.cpp
trunk/src/endpoints/manager.h
trunk/src/endpoints/sip.cpp
trunk/src/endpoints/urlhandler.cpp
trunk/src/gui/main.cpp
Modified: trunk/src/endpoints/h323.cpp
==============================================================================
--- trunk/src/endpoints/h323.cpp (original)
+++ trunk/src/endpoints/h323.cpp Sun Apr 6 20:44:21 2008
@@ -308,17 +308,10 @@
gnomemeeting_threads_leave ();
- call = endpoint.FindCallWithLock (endpoint.GetCurrentCallToken());
- if (call)
- con = endpoint.GetConnection (call, TRUE);
- if ((con && con->GetIdentifier () == connection.GetIdentifier())
- || (status == CONTACT_DND))
- reason = 1;
-
- else if (forward_host && always_forward)
+ if (forward_host && always_forward)
reason = 2; // Forward
/* We are in a call */
- else if (endpoint.GetCallingState () != GMManager::Standby) {
+ else if (endpoint.GetCallsNumber () >= 1) {
if (forward_host && busy_forward)
reason = 2; // Forward
Modified: trunk/src/endpoints/manager.cpp
==============================================================================
--- trunk/src/endpoints/manager.cpp (original)
+++ trunk/src/endpoints/manager.cpp Sun Apr 6 20:44:21 2008
@@ -39,7 +39,6 @@
#include "config.h"
#include "manager.h"
-#include "pcss.h"
#include "h323.h"
#include "sip.h"
@@ -55,6 +54,7 @@
#include "opal-gmconf-bridge.h"
#include "opal-call.h"
#include "opal-codec-description.h"
+#include "pcss.h"
#include "vidinput-info.h"
@@ -183,8 +183,6 @@
//FIXME: we shouldnt call sound events here but signal to the frontend which then triggers them
{
/* Initialise the endpoint paramaters */
- SetCallingState (GMManager::Standby);
-
#ifdef HAVE_AVAHI
zcp = NULL;
#endif
@@ -226,7 +224,7 @@
sipEP = new GMSIPEndpoint (*this, core);
AddRouteEntry("pc:.* = sip:<da>");
- pcssEP = new GMPCSSEndpoint (*this, core);
+ pcssEP = new GMPCSSEndpoint (*this);
pcssEP->SetSoundChannelPlayDevice("EKIGA");
pcssEP->SetSoundChannelRecordDevice("EKIGA");
AddRouteEntry("h323:.* = pc:<db>");
@@ -597,37 +595,6 @@
}
-bool
-GMManager::AcceptCurrentIncomingCall ()
-{
- if (pcssEP) {
-
- pcssEP->AcceptCurrentIncomingCall ();
- return TRUE;
- }
-
- return FALSE;
-}
-
-
-void
-GMManager::SetCallingState (CallingState i)
-{
- PWaitAndSignal m(cs_access_mutex);
-
- calling_state = i;
-}
-
-
-GMManager::CallingState
-GMManager::GetCallingState ()
-{
- PWaitAndSignal m(cs_access_mutex);
-
- return calling_state;
-}
-
-
Ekiga::CodecList GMManager::get_codecs ()
{
return codecs;
@@ -680,7 +647,7 @@
}
codecs = _codecs;
-
+
//
// Update OPAL
//
@@ -703,7 +670,7 @@
if (name == (const char *) all_media_formats [j].GetEncodingName ()
&& rate == all_media_formats [j].GetClockRate ()) {
-
+
// Found something
order += all_media_formats [j];
}
@@ -747,13 +714,6 @@
}
-GMPCSSEndpoint *
-GMManager::GetPCSSEndpoint ()
-{
- return pcssEP;
-}
-
-
PString
GMManager::GetCurrentAddress (PString protocol)
{
@@ -763,13 +723,13 @@
WORD port = 0;
ep = FindEndPoint (protocol.IsEmpty () ? "sip" : protocol);
-
+
if (!ep)
return PString ();
-
+
if (!ep->GetListeners ().IsEmpty ())
ep->GetListeners()[0].GetLocalAddress().GetIpAndPort (ip, port);
-
+
return ip.AsString () + ":" + PString (port);
}
@@ -790,13 +750,13 @@
if (account->enabled)
account_url = g_strdup_printf ("%s:%s %s", (const char *) protocol,
- account->username, account->host);
+ account->username, account->host);
gm_account_delete (account);
}
if (!account_url)
account_url = g_strdup_printf ("%s:%s", (const char *) protocol,
- (const char *) GetCurrentAddress (protocol));
+ (const char *) GetCurrentAddress (protocol));
url = account_url;
g_free (account_url);
@@ -840,24 +800,6 @@
}
-void
-GMManager::SetCurrentCallToken (PString s)
-{
- PWaitAndSignal m(ct_access_mutex);
-
- current_call_token = s;
-}
-
-
-PString
-GMManager::GetCurrentCallToken ()
-{
- PWaitAndSignal m(ct_access_mutex);
-
- return current_call_token;
-}
-
-
#ifdef HAVE_AVAHI
void
GMManager::CreateZeroconfClient ()
@@ -884,12 +826,12 @@
}
#endif
-
+
void
GMManager::CreateSTUNClient (bool display_progress,
- bool display_config_dialog,
- bool wait,
- GtkWidget *parent)
+ bool display_config_dialog,
+ bool wait,
+ GtkWidget *parent)
{
PWaitAndSignal m(sc_mutex);
@@ -897,13 +839,13 @@
delete (sc);
SetSTUNServer (PString ());
-
+
/* Be a client for the specified STUN Server */
sc = new GMStunClient (display_progress,
- display_config_dialog,
- wait,
- parent,
- *this);
+ display_config_dialog,
+ wait,
+ parent,
+ *this);
}
@@ -914,9 +856,9 @@
if (sc)
delete (sc);
-
+
SetSTUNServer (PString ());
-
+
sc = NULL;
ResetListeners ();
@@ -925,7 +867,7 @@
PSafePtr<OpalConnection> GMManager::GetConnection (PSafePtr<OpalCall> call,
- bool is_remote)
+ bool is_remote)
{
PSafePtr<OpalConnection> connection = NULL;
@@ -983,26 +925,14 @@
res = OpalManager::OnIncomingConnection (connection, 0, NULL);
break;
}
-
- /* Update the current state if action is 0 or 4.
- * Show popup if action is 1 (show popup)
- */
- if (reason == 0 || reason == 4) {
-
- SetCallingState (GMManager::Called);
- SetCurrentCallToken (connection.GetCall ().GetToken ());
- }
return res;
}
void
-GMManager::OnEstablishedCall (OpalCall &call)
+GMManager::OnEstablishedCall (OpalCall &/*call*/)
{
- /* Update internal state */
- SetCallingState (GMManager::Connected);
- SetCurrentCallToken (call.GetToken ());
}
@@ -1039,19 +969,14 @@
void
-GMManager::OnClearedCall (OpalCall & call)
+GMManager::OnClearedCall (OpalCall & /*call*/)
{
- if (GetCurrentCallToken() != PString::Empty()
- && GetCurrentCallToken () != call.GetToken())
- return;
-
/* Play busy tone if we were connected */
+ /*
if (GetCallingState () == GMManager::Connected)
audiooutput_core.play_event("busy_tone_sound");
+*/
- /* Update internal state */
- SetCallingState (GMManager::Standby);
- SetCurrentCallToken ("");
/* Reinitialize codecs */
re_audio_codec = tr_audio_codec = re_video_codec = tr_video_codec = "";
@@ -1320,26 +1245,10 @@
bool set,
unsigned int &vol)
{
- bool err = TRUE;
-
- if (sound_channel && GetCallingState () == GMManager::Connected) {
-
-
- if (set) {
-
- err =
- sound_channel->SetVolume (vol)
- && err;
- }
- else {
-
- err =
- sound_channel->GetVolume (vol)
- && err;
- }
- }
+ if (sound_channel == NULL)
+ return false;
- return err;
+ return set ? sound_channel->SetVolume (vol) : sound_channel->GetVolume (vol);
}
Modified: trunk/src/endpoints/manager.h
==============================================================================
--- trunk/src/endpoints/manager.h (original)
+++ trunk/src/endpoints/manager.h Sun Apr 6 20:44:21 2008
@@ -68,9 +68,9 @@
class GMLid;
class GMH323Gatekeeper;
-class GMPCSSEndpoint;
class GMH323Endpoint;
class GMSIPEndpoint;
+class GMPCSSEndpoint;
PDICTIONARY (mwiDict, PString, PString);
@@ -88,16 +88,12 @@
PCLASSINFO(GMManager, OpalManager);
friend class GMAccountsEndpoint;
- friend class GMPCSSEndpoint;
friend class GMH323Endpoint;
friend class GMSIPEndpoint;
public:
- enum CallingState {Standby, Calling, Connected, Called};
-
-
/* DESCRIPTION : The constructor.
* BEHAVIOR : Creates the supported endpoints
* and initialises the variables
@@ -198,18 +194,6 @@
void ResetListeners ();
-
- /* DESCRIPTION : /
- * BEHAVIOR : Accepts the current incoming call, if any.
- * There is always only one current incoming call at a time.
- * If there is another incoming call in-between,
- * it is rejected.
- * PRE : /
- */
- bool AcceptCurrentIncomingCall ();
-
-
-
/* DESCRIPTION : /
* BEHAVIOR : Returns the local or remote OpalConnection for the
* given call. If there are several remote connections,
@@ -279,28 +263,6 @@
/* DESCRIPTION : /
- * BEHAVIOR : Set the current calling state :
- * { Standby,
- * Calling,
- * Connected,
- * Called }
- * PRE : /
- */
- void SetCallingState (CallingState);
-
-
- /* DESCRIPTION : /
- * BEHAVIOR : Returns the current calling state :
- * { Standby,
- * Calling,
- * Connected,
- * Called }
- * PRE : /
- */
- CallingState GetCallingState (void);
-
-
- /* DESCRIPTION : /
* BEHAVIOR : Returns the H.323 endpoint.
* PRE : /
*/
@@ -313,13 +275,6 @@
*/
GMSIPEndpoint *GetSIPEndpoint ();
-
- /* DESCRIPTION : /
- * BEHAVIOR : Returns the PCSS endpoint.
- * PRE : /
- */
- GMPCSSEndpoint *GetPCSSEndpoint ();
-
/* DESCRIPTION : /
* BEHAVIOR : Return the current listener address of the endpoint.
@@ -339,21 +294,6 @@
PString GetURL (PString);
- /* DESCRIPTION : /
- * BEHAVIOR : Set the current call token.
- * PRE : A valid PString for a call token.
- */
- void SetCurrentCallToken (PString);
-
-
- /* DESCRIPTION : /
- * BEHAVIOR : Return the current call token (empty if
- * no call is in progress).
- * PRE : /
- */
- PString GetCurrentCallToken (void);
-
-
#ifdef HAVE_AVAHI
/* DESCRIPTION : /
* BEHAVIOR : Create a zeroconf client that will publish information
@@ -493,10 +433,6 @@
private:
void GetAllowedFormats (OpalMediaFormatList & full_list);
- PString current_call_token;
-
- CallingState calling_state;
-
PTimer GatewayIPTimer;
PTimer IPChangedTimer;
@@ -525,8 +461,6 @@
/* Various mutexes to ensure thread safeness around internal
variables */
PMutex vg_access_mutex;
- PMutex cs_access_mutex;
- PMutex ct_access_mutex;
PMutex tct_access_mutex;
PMutex lid_access_mutex;
PMutex mwi_access_mutex;
Modified: trunk/src/endpoints/sip.cpp
==============================================================================
--- trunk/src/endpoints/sip.cpp (original)
+++ trunk/src/endpoints/sip.cpp Sun Apr 6 20:44:21 2008
@@ -607,16 +607,10 @@
PTRACE (3, "GMSIPEndpoint\tIncoming connection");
- call = endpoint.FindCallWithLock (endpoint.GetCurrentCallToken());
- if (call)
- con = endpoint.GetConnection (call, TRUE);
- if ((con && con->GetIdentifier () == connection.GetIdentifier())) {
- return TRUE;
- }
-
+ std::cout << endpoint.GetCallsNumber() << std::endl << std::flush;
if (!forward_uri.empty () && unconditional_forward)
reason = 2; // Forward
- else if (endpoint.GetCallingState () != GMManager::Standby) { // TODO : to remove
+ else if (endpoint.GetCallsNumber () >= 1) {
if (!forward_uri.empty () && forward_on_busy)
reason = 2; // Forward
Modified: trunk/src/endpoints/urlhandler.cpp
==============================================================================
--- trunk/src/endpoints/urlhandler.cpp (original)
+++ trunk/src/endpoints/urlhandler.cpp Sun Apr 6 20:44:21 2008
@@ -398,18 +398,6 @@
endpoint = dynamic_cast<GMManager *> (core.get ("opal-component"));
- /* Answer the current call in a separate thread if we are called
- * and return
- */
- if (endpoint->GetCallingState () == GMManager::Called) {
-
- if (!transfer_call) {
-
- endpoint->AcceptCurrentIncomingCall ();
- return;
- }
- }
-
/* #INV: We have not been called to answer a call
*/
if (url.IsEmpty ())
@@ -447,20 +435,13 @@
/* Connect to the URL */
if (!transfer_call) {
- /* Update the state to "calling" */
- gnomemeeting_threads_enter ();
- gm_main_window_update_calling_state (main_window, GMManager::Calling);
- gnomemeeting_threads_leave ();
-
- endpoint->SetCallingState (GMManager::Calling);
-
result = endpoint->SetUpCall ("pc:*", call_address, current_call_token);
/* If we have a valid URL, we a have a valid connection, if not
we put things back in the initial state */
if (result) {
- endpoint->SetCurrentCallToken (current_call_token);
+ //endpoint->SetCurrentCallToken (current_call_token);
}
else {
@@ -468,9 +449,9 @@
/* The call failed, put back the state to "Standby", should
* be done in OnConnectionEstablished if con exists.
*/
- gnomemeeting_threads_enter ();
- gm_main_window_update_calling_state (main_window,
- GMManager::Standby);
+ //gnomemeeting_threads_enter ();
+ //gm_main_window_update_calling_state (main_window,
+ // GMManager::Standby);
/*
call_history_item = gm_calls_history_item_new ();
@@ -479,25 +460,27 @@
call_history_item->duration = g_strdup ("0.00");
FIXME */
- gm_main_window_flash_message (main_window, "%s", _("Failed to call user"));
+ //gm_main_window_flash_message (main_window, "%s", _("Failed to call user"));
//call_history_item->end_reason = g_strdup (_("Failed to call user"));
//gm_calls_history_add_call (call_history_item);
//gm_calls_history_item_free (call_history_item);
- gnomemeeting_threads_leave ();
+ //gnomemeeting_threads_leave ();
//FIXME pcssEP->PlaySoundEvent ("busy_tone_sound");
}
}
else {
+ // FIXME
+ /*
PSafePtr<OpalCall> call = endpoint->FindCallWithLock (endpoint->GetCurrentCallToken ());
PSafePtr<OpalConnection> con = endpoint->GetConnection (call, TRUE);
- // Forward or transfer
if (endpoint->GetCallingState () == GMManager::Called)
con->ForwardCall (call_address);
else
con->TransferConnection (call_address);
+ */
}
}
Modified: trunk/src/gui/main.cpp
==============================================================================
--- trunk/src/gui/main.cpp (original)
+++ trunk/src/gui/main.cpp Sun Apr 6 20:44:21 2008
@@ -40,7 +40,6 @@
#include "main.h"
-#include "pcss.h"
#include "ekiga.h"
#include "conf.h"
#include "misc.h"
@@ -100,6 +99,8 @@
#include "../devices/videooutput.h"
+enum CallingState {Standby, Calling, Connected, Called};
+
/* Declarations */
struct _GmMainWindow
{
@@ -700,7 +701,7 @@
gm_main_window_flash_message (GTK_WIDGET (self), "%s", info.str ().c_str ());
if (!gm_conf_get_bool (USER_INTERFACE_KEY "main_window/show_call_panel"))
gm_main_window_show_call_panel (GTK_WIDGET (self));
- gm_main_window_update_calling_state (GTK_WIDGET (self), GMManager::Connected);
+ gm_main_window_update_calling_state (GTK_WIDGET (self), Connected);
mw->current_call = &call;
@@ -728,7 +729,7 @@
GmMainWindow *mw = gm_mw_get_mw (GTK_WIDGET (self));
gm_main_window_set_stay_on_top (GTK_WIDGET (self), FALSE);
- gm_main_window_update_calling_state (GTK_WIDGET (self), GMManager::Standby);
+ gm_main_window_update_calling_state (GTK_WIDGET (self), Standby);
gm_main_window_set_status (GTK_WIDGET (self), _("Standby"));
gm_main_window_set_call_duration (GTK_WIDGET (self), NULL);
gm_main_window_set_call_info (GTK_WIDGET (self), NULL, NULL, NULL, NULL);
@@ -1226,7 +1227,6 @@
uri = gm_main_window_get_call_url (GTK_WIDGET (data));
call_core->dial (uri);
}
-
}
@@ -2431,16 +2431,11 @@
gpointer data)
{
GmMainWindow *mw = NULL;
- GMManager *endpoint = NULL;
mw = gm_mw_get_mw (GTK_WIDGET (data));
- // FIXME API SHOULD CHANGE
- endpoint = dynamic_cast<GMManager *> (mw->core.get ("opal-component"));
-
- if (endpoint
- && gm_conf_get_bool (VIDEO_DISPLAY_KEY "stay_on_top")
- && endpoint->GetCallingState () == GMManager::Connected)
+ if (gm_conf_get_bool (VIDEO_DISPLAY_KEY "stay_on_top")
+ && mw->current_call)
gdk_window_set_always_on_top (GDK_WINDOW (w->window), TRUE);
}
@@ -2922,7 +2917,7 @@
switch (calling_state)
{
- case GMManager::Standby:
+ case Standby:
/* Update the hold state */
gm_main_window_set_call_hold (main_window, FALSE);
@@ -2949,7 +2944,7 @@
break;
- case GMManager::Calling:
+ case Calling:
/* Update the menus and toolbar items */
gtk_menu_set_sensitive (mw->main_menu, "connect", FALSE);
@@ -2963,7 +2958,7 @@
break;
- case GMManager::Connected:
+ case Connected:
/* Update the menus and toolbar items */
gtk_menu_set_sensitive (mw->main_menu, "connect", FALSE);
@@ -2978,7 +2973,7 @@
break;
- case GMManager::Called:
+ case Called:
/* Update the menus and toolbar items */
gtk_menu_set_sensitive (mw->main_menu, "disconnect", TRUE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]