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="firstname.lastname@example.org/jitsi-2gs5A7BD47F9" from="email@example.com" type="result">
<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'/>
<server host='relay.google.com' udp='19295' tcp='19294' tcpssl='443'/>
- 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?