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



commit acacdea60d983f3c203e39413d83892c9399e42c
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 5b4239a..a5e2aa6 100644
--- a/lib/engine/components/opal/sip-endpoint.cpp
+++ b/lib/engine/components/opal/sip-endpoint.cpp
@@ -841,14 +841,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]