[jitsi-dev] Creating ICE SUN harvesters for GTalk accounts


#1

Hi Seb, devs,

When trying to get specific STUN servers for a google account, Jitsi sends an IQ->request stanza with a google:jingleinfo extension. Then, Jitsi adds a listener to the XMPP connection and adds a timer (3 seconds):

- If a IQ->response (like the one below) is received before the timer has expired, then all works well.

<iq id="WhnvB-94" to="toto@gmail.com/jitsi-2gs5A7BD47F9" from="toto@gmail.com" type="result">
     <query xmlns='google:jingleinfo'>
         <stun >
             <server host='stun.l.google.com' udp='19302'/>
             <server host='alt1.stun.l.google.com' udp='19302'/>
             <server host='alt3.stun.l.google.com' udp='19302'/>
             <server host='alt4.stun.l.google.com' udp='19302'/>
             <server host='alt2.stun.l.google.com' udp='19302'/>
         </stun>
         <relay>
      <token>CAE....</token>
             <server host='relay.google.com' udp='19295' tcp='19294' tcpssl='443'/>
         </relay>
     </query>
</iq>

- If the timer expired first, then Jitsi switches to the default STUN server.

The problem is that most of the time (at least at home), Jitsi falls back to the default STUN server. Changing the listener into a collector (cf. patch joined) with a time sets to SmackConfiguration.getPacketReplyTimeout (corresponding to 5 seconds) corrects this problem. Indeed, when receiving a packet, the collectors are called first and the listeners afterwards.

Is there a specific reason to use a listener or to set the timer to 3 seconds?

Cheers,
Chenzo

gtalk_create_stun_harvester.patch (16 KB)

···

--
Vincent Lucas, Ph.D. Jitsi developer
chenzo@jitsi.org http://jitsi.org


#2

Hi Vincent,

In one of my latest commit of march, I put some Jingle message processing in a separate thread so now I think it is safe (and better) to use a Collector (because it will not blocked the response from the Smack reader thread).

Best regards,

···

--
Seb

Le 28/03/12 16:23, Vincent Lucas a écrit :

Hi Seb, devs,

When trying to get specific STUN servers for a google account, Jitsi sends an IQ->request stanza with a google:jingleinfo extension. Then, Jitsi adds a listener to the XMPP connection and adds a timer (3 seconds):

- If a IQ->response (like the one below) is received before the timer has expired, then all works well.

<iq id="WhnvB-94" to="toto@gmail.com/jitsi-2gs5A7BD47F9" from="toto@gmail.com" type="result">
<query xmlns='google:jingleinfo'>
<stun >
<server host='stun.l.google.com' udp='19302'/>
<server host='alt1.stun.l.google.com' udp='19302'/>
<server host='alt3.stun.l.google.com' udp='19302'/>
<server host='alt4.stun.l.google.com' udp='19302'/>
<server host='alt2.stun.l.google.com' udp='19302'/>
</stun>
<relay>
<token>CAE....</token>
<server host='relay.google.com' udp='19295' tcp='19294' tcpssl='443'/>
</relay>
</query>
</iq>

- If the timer expired first, then Jitsi switches to the default STUN server.

The problem is that most of the time (at least at home), Jitsi falls back to the default STUN server. Changing the listener into a collector (cf. patch joined) with a time sets to SmackConfiguration.getPacketReplyTimeout (corresponding to 5 seconds) corrects this problem. Indeed, when receiving a packet, the collectors are called first and the listeners afterwards.

Is there a specific reason to use a listener or to set the timer to 3 seconds?

Cheers,
Chenzo