[ekiga] Replace deprecated methods from ptlib/opal v14 transition



commit 9810d664775a17b5fc5c2866759f7876988726e0
Author: Eugen Dedu <eugen dedu univ-fcomte fr>
Date:   Wed Aug 13 11:19:14 2014 +0200

    Replace deprecated methods from ptlib/opal v14 transition

 lib/engine/components/opal/h323-endpoint.cpp |    5 +++-
 lib/engine/components/opal/opal-account.cpp  |   19 +++++++++++++++-
 lib/engine/components/opal/opal-call.cpp     |   10 +++++++-
 lib/engine/components/opal/sip-endpoint.cpp  |   28 ++++++++++++++++++++++---
 4 files changed, 53 insertions(+), 9 deletions(-)
---
diff --git a/lib/engine/components/opal/h323-endpoint.cpp b/lib/engine/components/opal/h323-endpoint.cpp
index 32ed608..43dff54 100644
--- a/lib/engine/components/opal/h323-endpoint.cpp
+++ b/lib/engine/components/opal/h323-endpoint.cpp
@@ -314,9 +314,12 @@ Opal::H323::EndPoint::Register (const Opal::Account& account)
         case H323Gatekeeper::UnregisteredByGatekeeper:
         case H323Gatekeeper::GatekeeperLostRegistration:
         case H323Gatekeeper::InvalidListener:
+        case H323Gatekeeper::TryingAlternate:
         case H323Gatekeeper::NumRegistrationFailReasons:
+        case H323Gatekeeper::GatekeeperRejectReasonMask:
         case H323Gatekeeper::RegistrationRejectReasonMask:
-        default :
+        case H323Gatekeeper::UnregistrationRejectReasonMask:
+        default:
           info = _("Failed");
           break;
         }
diff --git a/lib/engine/components/opal/opal-account.cpp b/lib/engine/components/opal/opal-account.cpp
index d3e38f7..4d2fdc6 100644
--- a/lib/engine/components/opal/opal-account.cpp
+++ b/lib/engine/components/opal/opal-account.cpp
@@ -996,9 +996,15 @@ Opal::Account::handle_registration_event (RegistrationState state_,
         call_manager->subscribe (*this, presentity);
         break;
       case SIPRegister::e_HasApplicationLayerGateway:
-        // HasAppLG did not work, stop registration with error
+        // HasAppLG did not work, try next compat mode
+        compat_mode = SIPRegister::e_RFC5626;
+        PTRACE (4, "Register failed in HasApplicationLayerGateway mode, retrying in RFC5626 mode");
+        call_manager->subscribe (*this, presentity);
+        break;
+      case SIPRegister::e_RFC5626:
+        // RFC5626 did not work, stop registration with error
         compat_mode = SIPRegister::e_FullyCompliant;
-        PTRACE (4, "Register failed in HasApplicationLayerGateway mode, aborting registration");
+        PTRACE (4, "Register failed in RFC5626 mode, aborting registration");
         status = _("Could not register");
         if (!info.empty ())
           status = status + " (" + info + ")";
@@ -1013,6 +1019,9 @@ Opal::Account::handle_registration_event (RegistrationState state_,
         updated ();
         failed_registration_already_notified = true;
         break;
+      case SIPRegister::EndCompatibilityModes:
+        // bookkeeping code, to remove a compile warning
+        break;
       default:
 
         state = state_;
@@ -1131,6 +1140,7 @@ Opal::Account::OnPresenceChange (OpalPresentity& /*presentity*/,
   case OpalPresenceInfo::InternalError:
   case OpalPresenceInfo::Forbidden:
   case OpalPresenceInfo::Unavailable:
+  case OpalPresenceInfo::UnknownUser:
   //case OpalPresenceInfo::UnknownExtended:
     new_presence = "unknown";
     break;
@@ -1219,6 +1229,11 @@ Opal::Account::OnPresenceChange (OpalPresentity& /*presentity*/,
     new_presence = "away";
     break;
   */
+  case OpalPresenceInfo::EndState:
+  case OpalPresenceInfo::StateCount:
+    // the above two items are bookkeeping code, so do not consider them
+    // shut up the compiler which checks all cases in switch
+    break;
   default:
     break;
   }
diff --git a/lib/engine/components/opal/opal-call.cpp b/lib/engine/components/opal/opal-call.cpp
index dc7eb2a..003463d 100644
--- a/lib/engine/components/opal/opal-call.cpp
+++ b/lib/engine/components/opal/opal-call.cpp
@@ -313,7 +313,7 @@ Opal::Call::parse_info (OpalConnection & connection)
 
   if (!PIsDescendant(&connection, OpalPCSSConnection)) {
 
-    remote_uri = (const char *) connection.GetRemotePartyAddress ();
+    remote_uri = (const char *) connection.GetRemotePartyURL ();
 
     l_party_name = (const char *) connection.GetLocalPartyName ();
     r_party_name = (const char *) connection.GetRemotePartyName ();
@@ -483,14 +483,20 @@ Opal::Call::OnCleared ()
     case OpalConnection::EndedByOutOfService:
       reason = _("Service unavailable");  // this appears when 500 does not work
       break;
+    case OpalConnection::EndedByCertificateAuthority:
+      reason = _("Remote certifcate not authenticated");
+      break;
     case OpalConnection::EndedByQ931Cause:
     case OpalConnection::EndedByDurationLimit:
     case OpalConnection::EndedByInvalidConferenceID:
     case OpalConnection::EndedByNoDialTone:
     case OpalConnection::EndedByNoRingBackTone:
     case OpalConnection::EndedByAcceptingCallWaiting:
+    case OpalConnection::EndedByMediaFailed:
+    case OpalConnection::EndedByCallCompletedElsewhere:
+    case OpalConnection::EndedByIllegalAddress:
     case OpalConnection::NumCallEndReasons:
-    default :
+    default:
       reason = _("Call completed");
     }
 
diff --git a/lib/engine/components/opal/sip-endpoint.cpp b/lib/engine/components/opal/sip-endpoint.cpp
index 179c072..36bfa6e 100644
--- a/lib/engine/components/opal/sip-endpoint.cpp
+++ b/lib/engine/components/opal/sip-endpoint.cpp
@@ -142,7 +142,10 @@ Opal::Sip::EndPoint::EndPoint (Opal::CallManager & _manager,
   manager.AddRouteEntry("pc:.* = sip:<da>");
 
   /* NAT Binding */
-  SetNATBindingRefreshMethod (KeepAliveByOPTION);
+  PTimeInterval timeout;
+  KeepAliveType type;
+  GetKeepAlive (timeout, type);
+  SetKeepAlive(timeout, KeepAliveByOPTION);
 
   settings = boost::shared_ptr<Ekiga::Settings> (new Ekiga::Settings (SIP_SCHEMA));
   settings->changed.connect (boost::bind (&EndPoint::setup, this, _1));
@@ -365,7 +368,10 @@ Opal::Sip::EndPoint::set_nat_binding_delay (unsigned delay)
 {
   if (delay > 0) {
     PTRACE (4, "Opal::Sip::EndPoint\tNat binding delay set to " << delay);
-    SetNATBindingTimeout (PTimeInterval (0, delay));
+    PTimeInterval timeout;
+    KeepAliveType type;
+    GetKeepAlive (timeout, type);
+    SetKeepAlive (PTimeInterval (0, delay), type);
   }
 }
 
@@ -373,7 +379,10 @@ Opal::Sip::EndPoint::set_nat_binding_delay (unsigned delay)
 unsigned
 Opal::Sip::EndPoint::get_nat_binding_delay ()
 {
-  return GetNATBindingTimeout ().GetSeconds ();
+  PTimeInterval timeout;
+  KeepAliveType type;
+  GetKeepAlive (timeout, type);
+  return timeout.GetSeconds ();
 }
 
 
@@ -713,9 +722,18 @@ Opal::Sip::EndPoint::OnRegistrationStatus (const RegistrationStatus & status)
       info = _("Globally not acceptable");
       break;
 
+    case SIP_PDU::Local_NotAuthenticated:
+      info = _("Invalid certificates");
+      break;
+
     case SIP_PDU::Failure_TransactionDoesNotExist:
     case SIP_PDU::Failure_Gone:
     case SIP_PDU::MaxStatusCode:
+    case SIP_PDU::Local_NoCompatibleListener:
+    case SIP_PDU::Local_CannotMapScheme:
+    case SIP_PDU::Local_KeepAlive:
+    case SIP_PDU::Local_TransportLost:
+    case SIP_PDU::Failure_UnresolvableDestination:
     default:
       info = _("Failed");
     }
@@ -899,9 +917,11 @@ Opal::Sip::EndPoint::OnDialogInfoReceived (const SIPDialogNotification & info)
     presence = "inacall";
     status = _status;
     break;
-  default:
+  case SIPDialogNotification::EndStates:  // bookkeeping code
+    break;
   case SIPDialogNotification::Trying:
   case SIPDialogNotification::Terminated:
+  default:
     break;
   }
 }


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