[jitsi-dev] AutoProxyConnection.java does not do properly reset(), so DNS does not observe TTL


#1

We force a reset() on every call to re/register the user agent so that Jitsi observes TTL.

Without getting too long winded in the explanation, DNS lookups are not being made following the initial register. The fix can be seen below.

--- a/src/net/java/sip/communicator/impl/protocol/sip/net/AutoProxyConnection.java
+++ b/src/net/java/sip/communicator/impl/protocol/sip/net/AutoProxyConnection.java
@@ -369,6 +369,7 @@ public class AutoProxyConnection
     {
         super.reset();
         state = State.New;
+ this.socketAddress = null;

         //determine the hostname of the proxy for autodetection:
         //1) server part of the user ID

Oren Forer
Engineer - Junction Networks
sip:oren@junctionnetworks.com
212-933-9190 x 7021


#2

Hey Oren

Although I wrote that code, it's a bit too long time ago too really judge
it. Could you please write a unit test inside TestAutoProxyDetection.java
that demonstrates how it fails currently and how your fix makes it succeed?

As for the TTL stuff itself, Emil, could you please look at it?

Regards,
Ingo

From: Oren Forer [mailto:oren@junctionnetworks.com]
Sent: Dienstag, 2. Oktober 2012 15:45
To: dev@jitsi.java.net
Subject: [jitsi-dev] AutoProxyConnection.java does not do properly

reset(),

so DNS does not observe TTL
We force a reset() on every call to re/register the user agent so that

Jitsi

observes TTL.

Without getting too long winded in the explanation, DNS lookups are not

being

···

-----Original Message-----
made following the initial register. The fix can be seen below.

---
a/src/net/java/sip/communicator/impl/protocol/sip/net/AutoProxyConnection
.jav a +++
b/src/net/java/sip/communicator/impl/protocol/sip/net/AutoProxyConnection
.jav a @@ -369,6 +369,7 @@ public class AutoProxyConnection
     {
         super.reset();
         state = State.New;
+ this.socketAddress = null;

         //determine the hostname of the proxy for autodetection:
         //1) server part of the user ID

Oren Forer
Engineer - Junction Networks
sip:oren@junctionnetworks.com
212-933-9190 x 7021


#3

Hey Oren,

Awfully sorry for the delay. Reply inline.

We force a reset() on every call to re/register the user agent so that Jitsi observes TTL.

Without getting too long winded in the explanation, DNS lookups are not being made following the initial register. The fix can be seen below.

We just had a quick chat with Ingo about this and we can't quite figure
out exactly what it is that you are trying to achieve with this change.

Now, while it is true that we won't blindly resend NAPTR and SRV queries
upon re-registration, the reason for this is not within the SIP
implementation. Our SIP provider queries NetworkUtils for DNS records
every time it registers to a SIP server.

The reason there are no NAPTR/SRV queries every time is due to the fact
that dnsjava implements a cache which respects TTL times in the records
it retrieves.

Have you seen it behaving otherwise?

Clearing the cache would indeed allow for NAPTRs and SRVs to be sent
again but then TTLs are definitely not going to be observed, which seems
to be your original concern.

Either way, I don't see any change in behaviour after applying your
patch. Was there something missing?

Cheers,
Emil

···

On 02.10.12, 20:44, Oren Forer wrote:

--- a/src/net/java/sip/communicator/impl/protocol/sip/net/AutoProxyConnection.java
+++ b/src/net/java/sip/communicator/impl/protocol/sip/net/AutoProxyConnection.java
@@ -369,6 +369,7 @@ public class AutoProxyConnection
     {
         super.reset();
         state = State.New;
+ this.socketAddress = null;

         //determine the hostname of the proxy for autodetection:
         //1) server part of the user ID

Oren Forer
Engineer - Junction Networks
sip:oren@junctionnetworks.com
212-933-9190 x 7021

--
https://jitsi.org