[ekiga] SIP: Fixed TCP usage when dialing out.



commit 10a9c06ccffcfea9f1a1677529a7de1bfb3dfec2
Author: Damien Sandras <dsandras seconix com>
Date:   Sat Jan 17 15:00:53 2015 +0100

    SIP: Fixed TCP usage when dialing out.

 lib/engine/components/opal/sip-endpoint.cpp |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/lib/engine/components/opal/sip-endpoint.cpp b/lib/engine/components/opal/sip-endpoint.cpp
index 59b8948..b9225da 100644
--- a/lib/engine/components/opal/sip-endpoint.cpp
+++ b/lib/engine/components/opal/sip-endpoint.cpp
@@ -141,8 +141,19 @@ Opal::Sip::EndPoint::dial (const std::string & uri)
   else
     ustr << uri;
 
+  PStringList registrations = GetRegistrations ();
+  SIPURL remote_uri = ustr.str ().c_str ();
+  for (int i = 0 ; i < registrations.GetSize () ; i++) {
+    SIPURL registered_uri = registrations [i];
+    if (registered_uri.GetHostPort () == remote_uri.GetHostPort ()) {
+      PString transport = registered_uri.GetParamVars ()("transport");
+      if (!transport.IsEmpty ())
+        ustr << ";transport=" << (const char *) transport;
+    }
+  }
+
   PString token;
-  manager.SetUpCall("pc:*", ustr.str(), token, (void*) ustr.str().c_str());
+  manager.SetUpCall ("pc:*", ustr.str(), token, (void*) ustr.str().c_str());
 
   return true;
 }


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