[ekiga] Fixed "busy" or CFWD on busy occuring when connection is released.



commit 2e19bac50e1151117d7adc2a14190d39e17e4e2f
Author: Damien Sandras <dsandras beip be>
Date:   Fri Jan 11 18:15:36 2013 +0100

    Fixed "busy" or CFWD on busy occuring when connection is released.
    
    The connection could be released, but still in the process of being
    destroyed. In that case, we were considering Ekiga to be busy, when it
    was actually able to take and place calls.

 lib/engine/components/opal/h323-endpoint.cpp |   14 ++++++++++++--
 lib/engine/components/opal/sip-endpoint.cpp  |    8 +++++++-
 2 files changed, 19 insertions(+), 3 deletions(-)
---
diff --git a/lib/engine/components/opal/h323-endpoint.cpp b/lib/engine/components/opal/h323-endpoint.cpp
index 99727ef..8344790 100644
--- a/lib/engine/components/opal/h323-endpoint.cpp
+++ b/lib/engine/components/opal/h323-endpoint.cpp
@@ -430,11 +430,21 @@ Opal::H323::EndPoint::OnIncomingConnection (OpalConnection & connection,
 					    G_GNUC_UNUSED unsigned options,
 					    G_GNUC_UNUSED OpalConnection::StringOptions *stroptions)
 {
-  PTRACE (3, "EndPoint\tIncoming connection");
+  bool busy = false;
+
+  PTRACE (3, "Opal::H323::EndPoint\tIncoming connection");
+
+  if (!H323EndPoint::OnIncomingConnection (connection, options, stroptions))
+    return false;
+
+  for (PSafePtr<OpalConnection> conn(connectionsActive, PSafeReference); conn != NULL; ++conn) {
+    if (!conn->IsReleased ())
+      busy = true;
+  }
 
   if (!forward_uri.empty () && manager.get_unconditional_forward ())
     connection.ForwardCall (forward_uri);
-  else if (manager.GetCallCount () > 1) {
+  else if (busy) {
 
     if (!forward_uri.empty () && manager.get_forward_on_busy ())
       connection.ForwardCall (forward_uri);
diff --git a/lib/engine/components/opal/sip-endpoint.cpp b/lib/engine/components/opal/sip-endpoint.cpp
index 02d7923..56ceeca 100644
--- a/lib/engine/components/opal/sip-endpoint.cpp
+++ b/lib/engine/components/opal/sip-endpoint.cpp
@@ -829,14 +829,20 @@ Opal::Sip::EndPoint::OnIncomingConnection (OpalConnection &connection,
 					   unsigned options,
 					   OpalConnection::StringOptions * stroptions)
 {
+  bool busy = false;
   PTRACE (3, "Opal::Sip::EndPoint\tIncoming connection");
 
   if (!SIPEndPoint::OnIncomingConnection (connection, options, stroptions))
     return false;
 
+  for (PSafePtr<OpalConnection> conn(connectionsActive, PSafeReference); conn != NULL; ++conn) {
+    if (!conn->IsReleased ())
+      busy = true;
+  }
+
   if (!forward_uri.empty () && manager.get_unconditional_forward ())
     connection.ForwardCall (forward_uri);
-  else if (manager.GetCallCount () > 1) {
+  else if (busy) {
 
     if (!forward_uri.empty () && manager.get_forward_on_busy ())
       connection.ForwardCall (forward_uri);



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