[ekiga/gnome-2-26] Added workaround for registrars which refuse registrations containing extra contact addresses



commit 067463bf06eb11040122520a1f53c2e724fddb63
Author: Michael Rickmann <mrickma gwdg de>
Date:   Sun Sep 20 21:12:40 2009 +0200

    Added workaround for registrars which refuse registrations containing extra contact addresses
    
    This patch makes Ekiga setting %LIMITED during account registration
    for accounts containing "%limit" in their name.

 lib/engine/components/opal/opal-account.cpp |    8 ++++++++
 lib/engine/components/opal/opal-account.h   |    3 +++
 lib/engine/components/opal/sip-endpoint.cpp |    4 ++++
 lib/engine/components/opal/sip-endpoint.h   |    1 +
 4 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/lib/engine/components/opal/opal-account.cpp b/lib/engine/components/opal/opal-account.cpp
index 17854d2..76d988f 100644
--- a/lib/engine/components/opal/opal-account.cpp
+++ b/lib/engine/components/opal/opal-account.cpp
@@ -122,6 +122,8 @@ Opal::Account::Account (Ekiga::ServiceCore & _core,
   else
     type = Account::H323;
 
+  limited = (name.find ("%limit") != std::string::npos);
+
   registration_event.connect (sigc::mem_fun (this, &Opal::Account::on_registration_event));
 }
 
@@ -280,6 +282,12 @@ bool Opal::Account::is_enabled () const
 }
 
 
+bool Opal::Account::is_limited () const
+{
+  return limited;
+}
+
+
 bool Opal::Account::is_active () const
 {
   return active;
diff --git a/lib/engine/components/opal/opal-account.h b/lib/engine/components/opal/opal-account.h
index 2cf551d..817a4c6 100644
--- a/lib/engine/components/opal/opal-account.h
+++ b/lib/engine/components/opal/opal-account.h
@@ -122,6 +122,8 @@ public:
 
     bool is_enabled () const;
 
+    bool is_limited () const;
+
     bool is_active () const;
 
     void remove ();
@@ -145,6 +147,7 @@ private:
     bool dead;
     bool active;
     bool enabled;
+    bool limited;
     unsigned timeout;
     std::string aid;
     std::string name;
diff --git a/lib/engine/components/opal/sip-endpoint.cpp b/lib/engine/components/opal/sip-endpoint.cpp
index 8358fe0..783cb5e 100644
--- a/lib/engine/components/opal/sip-endpoint.cpp
+++ b/lib/engine/components/opal/sip-endpoint.cpp
@@ -82,6 +82,7 @@ namespace Opal {
 			    account.get_authentication_username (),
 			    account.get_password (),
 			    account.is_enabled (),
+			    account.is_limited (),
 			    account.get_timeout ());
 	} else {
 
@@ -559,6 +560,7 @@ Opal::Sip::EndPoint::Register (const std::string username,
 			       const std::string auth_username,
 			       const std::string password,
 			       bool is_enabled,
+			       bool is_limited,
 			       unsigned timeout)
 {
   PString _aor;
@@ -576,6 +578,8 @@ Opal::Sip::EndPoint::Register (const std::string username,
   SIPRegister::Params params;
   params.m_addressOfRecord = aor.str ();
   params.m_registrarAddress = host_;
+  if (is_limited)
+    params.m_compatibility = SIPRegister::e_CannotRegisterMultipleContacts;
   params.m_authID = auth_username;
   params.m_password = password;
   params.m_expire = is_enabled ? timeout : 0;
diff --git a/lib/engine/components/opal/sip-endpoint.h b/lib/engine/components/opal/sip-endpoint.h
index 6c08bd4..7fbd6b2 100644
--- a/lib/engine/components/opal/sip-endpoint.h
+++ b/lib/engine/components/opal/sip-endpoint.h
@@ -153,6 +153,7 @@ namespace Opal {
 		     const std::string auth_username,
 		     const std::string password,
 		     bool is_enabled,
+		     bool is_limited,
 		     unsigned timeout);
 
       void OnRegistered (const PString & aor,



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