ekiga r6145 - in trunk: . lib/engine/protocol/skel src/endpoints src/gui



Author: dsandras
Date: Mon Apr  7 21:54:13 2008
New Revision: 6145
URL: http://svn.gnome.org/viewvc/ekiga?rev=6145&view=rev

Log:
Added ringing_call signal and make use of it. The Ringing tone should
only be played when the remote party answers with a 180 Ringing, and
not in other cases. That bug was already fixed in 2.0.x and was
reintroduced later.


Modified:
   trunk/ChangeLog
   trunk/lib/engine/protocol/skel/call-core.cpp
   trunk/lib/engine/protocol/skel/call-core.h
   trunk/lib/engine/protocol/skel/call.h
   trunk/src/endpoints/manager.cpp
   trunk/src/endpoints/manager.h
   trunk/src/endpoints/pcss.cpp
   trunk/src/endpoints/pcss.h
   trunk/src/endpoints/sip.cpp
   trunk/src/gui/main.cpp

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	Mon Apr  7 21:54:13 2008
@@ -102,6 +102,7 @@
 
 void CallCore::on_new_call (Call *call, CallManager *manager)
 {
+  call->ringing.connect (sigc::bind (sigc::mem_fun (this, &CallCore::on_ringing_call), call, manager));
   call->setup.connect (sigc::bind (sigc::mem_fun (this, &CallCore::on_setup_call), call, manager));
   call->missed.connect (sigc::bind (sigc::mem_fun (this, &CallCore::on_missed_call), call, manager));
   call->cleared.connect (sigc::bind (sigc::mem_fun (this, &CallCore::on_cleared_call), call, manager));
@@ -115,6 +116,12 @@
 }
 
 
+void CallCore::on_ringing_call (Call *call, CallManager *manager)
+{
+  ringing_call.emit (*manager, *call);
+}
+
+
 void CallCore::on_setup_call (Call *call, CallManager *manager)
 {
   setup_call.emit (*manager, *call);

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	Mon Apr  7 21:54:13 2008
@@ -117,6 +117,7 @@
       
       /** See call.h for the API
        */
+      sigc::signal<void, CallManager &, Call &> ringing_call;
       sigc::signal<void, CallManager &, Call &> setup_call;
       sigc::signal<void, CallManager &, Call &> missed_call;
       sigc::signal<void, CallManager &, Call &, std::string> cleared_call;
@@ -162,6 +163,7 @@
 
   private:
       void on_new_call (Call *call, CallManager *manager);
+      void on_ringing_call (Call *call, CallManager *manager);
       void on_setup_call (Call *call, CallManager *manager);
       void on_missed_call (Call *call, CallManager *manager);
       void on_cleared_call (std::string, Call *call, CallManager *manager);

Modified: trunk/lib/engine/protocol/skel/call.h
==============================================================================
--- trunk/lib/engine/protocol/skel/call.h	(original)
+++ trunk/lib/engine/protocol/skel/call.h	Mon Apr  7 21:54:13 2008
@@ -203,10 +203,14 @@
        */
       sigc::signal<void> retrieved;
 
-      /* Signal emitted when the call has been setup
+      /* Signal emitted when the call is being setup
        */
       sigc::signal<void> setup;
 
+      /* Signal emitted when the remote party is ringing
+       */
+      sigc::signal<void> ringing;
+
       /* Signal emitted when a stream is opened
        * @param the stream name
        * @param the stream type

Modified: trunk/src/endpoints/manager.cpp
==============================================================================
--- trunk/src/endpoints/manager.cpp	(original)
+++ trunk/src/endpoints/manager.cpp	Mon Apr  7 21:54:13 2008
@@ -224,7 +224,7 @@
   sipEP = new GMSIPEndpoint (*this, core);
   AddRouteEntry("pc:.* = sip:<da>");
 
-  pcssEP = new GMPCSSEndpoint (*this);
+  pcssEP = new GMPCSSEndpoint (*this, core);
   pcssEP->SetSoundChannelPlayDevice("EKIGA");
   pcssEP->SetSoundChannelRecordDevice("EKIGA");
   AddRouteEntry("h323:.* = pc:<db>");
@@ -931,12 +931,6 @@
 
 
 void 
-GMManager::OnEstablishedCall (OpalCall &/*call*/)
-{
-}
-
-
-void 
 GMManager::OnEstablished (OpalConnection &connection)
 {
   RTP_Session *audio_session = NULL;

Modified: trunk/src/endpoints/manager.h
==============================================================================
--- trunk/src/endpoints/manager.h	(original)
+++ trunk/src/endpoints/manager.h	Mon Apr  7 21:54:13 2008
@@ -218,13 +218,6 @@
 			     const std::string & forward_uri);
 
   
-  /* DESCRIPTION  :  This callback is called when a call is established. 
-   * BEHAVIOR     :  Updates the GUI to put it in the Established mode.
-   * PRE          :  /
-   */
-  void OnEstablishedCall (OpalCall &);
-
-  
   /* DESCRIPTION  :  This callback is called when the connection is 
    *                 established and everything is ok.
    * BEHAVIOR     :  Sets the proper values for the current connection 

Modified: trunk/src/endpoints/pcss.cpp
==============================================================================
--- trunk/src/endpoints/pcss.cpp	(original)
+++ trunk/src/endpoints/pcss.cpp	Mon Apr  7 21:54:13 2008
@@ -41,9 +41,14 @@
 #include "pcss.h"
 #include "manager.h"
 
+#include "call.h"
 
-GMPCSSEndpoint::GMPCSSEndpoint (GMManager & ep) 
-: OpalPCSSEndPoint (ep) 
+
+GMPCSSEndpoint::GMPCSSEndpoint (GMManager & ep,
+                                Ekiga::ServiceCore & _core) 
+:   OpalPCSSEndPoint (ep),
+    core (_core),
+    runtime (*dynamic_cast<Ekiga::Runtime*>(core.get ("runtime")))
 {
 #ifdef WIN32
   SetSoundChannelBufferDepth (20);
@@ -59,7 +64,12 @@
 }
 
 
-bool GMPCSSEndpoint::OnShowOutgoing (const OpalPCSSConnection & /*connection*/)
+bool GMPCSSEndpoint::OnShowOutgoing (const OpalPCSSConnection &connection)
 {
+  Ekiga::Call *call = dynamic_cast<Ekiga::Call *> (&connection.GetCall ());
+
+  if (call)
+    runtime.run_in_main (call->ringing.make_slot ());
+
   return true;
 }

Modified: trunk/src/endpoints/pcss.h
==============================================================================
--- trunk/src/endpoints/pcss.h	(original)
+++ trunk/src/endpoints/pcss.h	Mon Apr  7 21:54:13 2008
@@ -41,6 +41,9 @@
 
 #include "common.h"
 
+#include "services.h"
+#include "runtime.h"
+
 class GMManager;
 
 class GMPCSSEndpoint : public OpalPCSSEndPoint
@@ -48,11 +51,15 @@
   PCLASSINFO (GMPCSSEndpoint, OpalPCSSEndPoint);
 
 public:
-  GMPCSSEndpoint (GMManager &);
+  GMPCSSEndpoint (GMManager &manager, Ekiga::ServiceCore & _core);
 
   bool OnShowIncoming (const OpalPCSSConnection &connection);
 
   bool OnShowOutgoing (const OpalPCSSConnection &connection);  
+
+private:
+  Ekiga::ServiceCore & core;
+  Ekiga::Runtime & runtime;
 };
 
 #endif

Modified: trunk/src/endpoints/sip.cpp
==============================================================================
--- trunk/src/endpoints/sip.cpp	(original)
+++ trunk/src/endpoints/sip.cpp	Mon Apr  7 21:54:13 2008
@@ -607,7 +607,7 @@
 
   PTRACE (3, "GMSIPEndpoint\tIncoming connection");
 
-  std::cout << endpoint.GetCallsNumber() << std::endl << std::flush;
+  std::cout << "OnIncomingConnection " << endpoint.GetCallsNumber() << std::endl << std::flush;
   if (!forward_uri.empty () && unconditional_forward)
     reason = 2; // Forward
   else if (endpoint.GetCallsNumber () >= 1) { 

Modified: trunk/src/gui/main.cpp
==============================================================================
--- trunk/src/gui/main.cpp	(original)
+++ trunk/src/gui/main.cpp	Mon Apr  7 21:54:13 2008
@@ -617,16 +617,27 @@
   GmMainWindow *mw = gm_mw_get_mw (GTK_WIDGET (self));
   Ekiga::AudioOutputCore *audiooutput_core = dynamic_cast<Ekiga::AudioOutputCore *> (mw->core.get ("audiooutput-core"));
 
-  if (call.is_outgoing ()) {
-    audiooutput_core->start_play_event("ring_tone_sound", 3000, 256);
-  }
-  else {
+  if (!call.is_outgoing ()) {
     audiooutput_core->start_play_event("incoming_call_sound", 3000, 256);
     gm_main_window_incoming_call_dialog_show (GTK_WIDGET (self), call);
   }
 }
 
 
+static void on_ringing_call_cb (Ekiga::CallManager & /*manager*/,
+                                Ekiga::Call & call,
+                                gpointer self)
+{
+  GmMainWindow *mw = gm_mw_get_mw (GTK_WIDGET (self));
+  Ekiga::AudioOutputCore *audiooutput_core = dynamic_cast<Ekiga::AudioOutputCore *> (mw->core.get ("audiooutput-core"));
+
+  if (call.is_outgoing ()) {
+    audiooutput_core->start_play_event("ring_tone_sound", 3000, 256);
+  }
+}
+
+
+
 static gboolean on_stats_refresh_cb (gpointer self) 
 {
   gchar *msg = NULL;
@@ -3935,6 +3946,9 @@
 
   conn = call_core->setup_call.connect (sigc::bind (sigc::ptr_fun (on_setup_call_cb), (gpointer) window));
   mw->connections.push_back (conn);
+
+  conn = call_core->ringing_call.connect (sigc::bind (sigc::ptr_fun (on_ringing_call_cb), (gpointer) window));
+  mw->connections.push_back (conn);
   
   conn = call_core->established_call.connect (sigc::bind (sigc::ptr_fun (on_established_call_cb), (gpointer) window));
   mw->connections.push_back (conn);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]