Re: [Ekiga-devel-list] alien registrar problem



Christian Schäfer schrieb:
Eugen Dedu wrote:
I see a commit in opal which might interest you:
2009-07-13 06:33  rjongbloed

    * src/sip/handlers.cxx: Added special case of m_contactAddress *=
      "%LIMITED" for SIP registration which will only fill the
      "Contact" field of the REGISTER command with addresses that are
      on the same interface as where the packet is being sent.
          This is to address STUPID registrars that refuse the entire
      registration when extra contact addresses are included that it
      doesn't like, e.g. the private address. Correct behaviour is to
      return what it DOES like, not refuse registration completely.

Thanks Eugen. That sounds indeed very interesting.

Chris
_______________________________________________

Yes opal is providing a possibility for handling this kind of brain-dead provider now. Only Ekiga has to pick it up. Since ekiga.net is serviced I worked against the aliens - patch is attached. What it does it lets Ekiga try twice to register, the second time setting %LIMITED. Or if you know before that you have a limited provider you can put the string %limit into the name of your account and Ekiga will succeed without retry. I tried under Linux only and only with sip.1und1.de with which Ekiga could not register before. Now it works.
Michael
diff -ur src/ekiga/lib/engine/components/opal/opal-account.cpp ekiga/lib/engine/components/opal/opal-account.cpp
--- src/ekiga/lib/engine/components/opal/opal-account.cpp	2009-07-16 17:30:46.000000000 +0200
+++ ekiga/lib/engine/components/opal/opal-account.cpp	2009-07-19 12:10:14.000000000 +0200
@@ -127,6 +127,8 @@
     type = Account::SIP;
   else
     type = Account::H323;
+
+  limited = (name.find ("%limit") != std::string::npos);
 }
 
 
@@ -301,6 +303,12 @@
 }
 
 
+bool Opal::Account::is_limited () const
+{
+  return limited;
+}
+
+
 bool Opal::Account::is_active () const
 {
   return enabled;
@@ -494,10 +502,16 @@
 
   case RegistrationFailed:
 
-    status = _("Could not register");
-    if (!info.empty ())
-      status = status + " (" + info + ")";
-    updated.emit ();
+    if (!limited) {
+      limited = true;
+      gmref_ptr<Sip::EndPoint> endpoint = core.get ("opal-sip-endpoint");
+      endpoint->subscribe (*this);
+    } else {
+      status = _("Could not register");
+      if (!info.empty ())
+        status = status + " (" + info + ")";
+      updated.emit ();
+    }
     break;
 
   case Processing:
diff -ur src/ekiga/lib/engine/components/opal/opal-account.h ekiga/lib/engine/components/opal/opal-account.h
--- src/ekiga/lib/engine/components/opal/opal-account.h	2009-07-16 17:30:46.000000000 +0200
+++ ekiga/lib/engine/components/opal/opal-account.h	2009-07-19 12:10:37.000000000 +0200
@@ -128,6 +128,8 @@
 
     bool is_enabled () const;
 
+    bool is_limited () const;
+
     bool is_active () const;
 
     void remove ();
@@ -160,6 +162,7 @@
     RegistrationState state;
     bool dead;
     bool enabled;
+    bool limited;
     unsigned timeout;
     std::string aid;
     std::string name;
diff -ur src/ekiga/lib/engine/components/opal/sip-endpoint.cpp ekiga/lib/engine/components/opal/sip-endpoint.cpp
--- src/ekiga/lib/engine/components/opal/sip-endpoint.cpp	2009-07-16 17:30:46.000000000 +0200
+++ ekiga/lib/engine/components/opal/sip-endpoint.cpp	2009-07-19 12:17:59.000000000 +0200
@@ -82,6 +82,7 @@
 			    account.get_authentication_username (),
 			    account.get_password (),
 			    account.is_enabled (),
+			    account.is_limited (),
 			    account.get_timeout ());
 	} else {
 
@@ -574,6 +575,7 @@
 			       const std::string auth_username,
 			       const std::string password,
 			       bool is_enabled,
+			       bool is_limited,
 			       unsigned timeout)
 {
   PWaitAndSignal mut(listsMutex);
@@ -592,6 +594,8 @@
   SIPRegister::Params params;
   params.m_addressOfRecord = aor.str ();
   params.m_registrarAddress = host;
+  if (is_limited)
+    params.m_contactAddress = "%LIMITED";
   params.m_authID = auth_username;
   params.m_password = password;
   params.m_expire = is_enabled ? timeout : 0;
diff -ur src/ekiga/lib/engine/components/opal/sip-endpoint.h ekiga/lib/engine/components/opal/sip-endpoint.h
--- src/ekiga/lib/engine/components/opal/sip-endpoint.h	2009-07-16 17:30:46.000000000 +0200
+++ ekiga/lib/engine/components/opal/sip-endpoint.h	2009-07-19 12:15:49.000000000 +0200
@@ -160,6 +160,7 @@
 		     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]