<div dir="ltr">Just to clarify:<div><a href="http://54.187.44.182:53379/" target="_blank" style="font-size:12.8000001907349px">54.187.44.182</a> is our TURN server (I actually forgot to replace it with X.X.X.X)<br></div><div><span style="font-size:12.8000001907349px">67.180.21.132 is the WiFi interface</span><br></div><div><span style="font-size:12.8000001907349px">166.170.42.141 is the 3G interface</span><span style="font-size:12.8000001907349px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 22 February 2015 at 23:20, Adam Ben-Ayoun <span dir="ltr"><<a href="mailto:adam.ben.ayoun1@gmail.com" target="_blank">adam.ben.ayoun1@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi guys,<div><br></div><div>We are using Freeswitch as an MCU for WebRTC (only for audio conferences), most of the times connecting from our WebRTC client is pretty quick, however, on some WiFi's (probably with a certain NAT/topology), the audio connection can take up to 10sec to initialize when using STUN and TURN, we also see there are differences on the Freeswitch logs when it happens:</div><div><br></div><div><div>2015-02-22 21:06:25.920612 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from <a href="http://67.180.21.132:59854" target="_blank">67.180.21.132:59854</a> to <a href="http://166.170.42.141:40334" target="_blank">166.170.42.141:40334</a></div><div>2015-02-22 21:06:25.960618 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from <a href="http://166.170.42.141:40334" target="_blank">166.170.42.141:40334</a> to <a href="http://67.180.21.132:59854" target="_blank">67.180.21.132:59854</a></div><div>2015-02-22 21:06:26.080616 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from <a href="http://67.180.21.132:59854" target="_blank">67.180.21.132:59854</a> to <a href="http://54.187.44.182:53379" target="_blank">54.187.44.182:53379</a></div><div>2015-02-22 21:06:26.680617 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from <a href="http://54.187.44.182:53379" target="_blank">54.187.44.182:53379</a> to <a href="http://166.170.42.141:40334" target="_blank">166.170.42.141:40334</a></div><div>2015-02-22 21:06:27.040614 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from <a href="http://166.170.42.141:40334" target="_blank">166.170.42.141:40334</a> to <a href="http://67.180.21.132:59854" target="_blank">67.180.21.132:59854</a></div><div>2015-02-22 21:06:27.880612 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from <a href="http://67.180.21.132:59854" target="_blank">67.180.21.132:59854</a> to <a href="http://166.170.42.141:40334" target="_blank">166.170.42.141:40334</a></div><div>2015-02-22 21:06:28.020610 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from <a href="http://166.170.42.141:40334" target="_blank">166.170.42.141:40334</a> to <a href="http://67.180.21.132:59854" target="_blank">67.180.21.132:59854</a></div><div>2015-02-22 21:06:28.600614 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from <a href="http://67.180.21.132:59854" target="_blank">67.180.21.132:59854</a> to <a href="http://166.170.42.141:40334" target="_blank">166.170.42.141:40334</a></div><div>2015-02-22 21:06:28.980603 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from <a href="http://166.170.42.141:40334" target="_blank">166.170.42.141:40334</a> to <a href="http://67.180.21.132:59854" target="_blank">67.180.21.132:59854</a></div><div>2015-02-22 21:06:29.560612 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from <a href="http://67.180.21.132:59854" target="_blank">67.180.21.132:59854</a> to <a href="http://166.170.42.141:40334" target="_blank">166.170.42.141:40334</a></div><div>2015-02-22 21:06:29.940602 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from <a href="http://166.170.42.141:40334" target="_blank">166.170.42.141:40334</a> to <a href="http://67.180.21.132:59854" target="_blank">67.180.21.132:59854</a></div><div>2015-02-22 21:06:30.540561 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from <a href="http://67.180.21.132:59854" target="_blank">67.180.21.132:59854</a> to <a href="http://166.170.42.141:40334" target="_blank">166.170.42.141:40334</a></div><div>2015-02-22 21:06:30.940606 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from <a href="http://166.170.42.141:40334" target="_blank">166.170.42.141:40334</a> to <a href="http://67.180.21.132:59854" target="_blank">67.180.21.132:59854</a></div><div>2015-02-22 21:06:31.500595 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from <a href="http://67.180.21.132:59854" target="_blank">67.180.21.132:59854</a> to <a href="http://166.170.42.141:40334" target="_blank">166.170.42.141:40334</a></div><div>2015-02-22 21:06:31.900613 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from <a href="http://166.170.42.141:40334" target="_blank">166.170.42.141:40334</a> to <a href="http://67.180.21.132:59854" target="_blank">67.180.21.132:59854</a></div><div>2015-02-22 21:06:32.460602 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from <a href="http://67.180.21.132:59854" target="_blank">67.180.21.132:59854</a> to <a href="http://166.170.42.141:40334" target="_blank">166.170.42.141:40334</a></div><div>2015-02-22 21:06:32.860614 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from <a href="http://166.170.42.141:40334" target="_blank">166.170.42.141:40334</a> to <a href="http://67.180.21.132:59854" target="_blank">67.180.21.132:59854</a></div><div>2015-02-22 21:06:33.040612 [INFO] switch_rtp.c:2926 Changing audio DTLS state from HANDSHAKE to SETUP</div><div>2015-02-22 21:06:33.040612 [INFO] switch_rtp.c:2834 audio Fingerprint Verified.</div><div>2015-02-22 21:06:33.040612 [INFO] switch_rtp.c:3376 Activating Audio Secure RTP SEND</div><div>2015-02-22 21:06:33.040612 [INFO] switch_rtp.c:3354 Activating Audio Secure RTP RECV</div><div>2015-02-22 21:06:33.040612 [DEBUG] switch_core_sqldb.c:2599 Secure Type: srtp:dtls:AES_CM_128_HMAC_SHA1_80</div><div>2015-02-22 21:06:33.040612 [INFO] switch_rtp.c:2874 Changing audio DTLS state from SETUP to READY</div><div>2015-02-22 21:06:33.040612 [DEBUG] switch_core_sqldb.c:2599 Secure Type: srtp:dtls:AES_CM_128_HMAC_SHA1_80</div><div>2015-02-22 21:06:33.100606 [DEBUG] switch_rtp.c:1954 rtcp_stats_init: ssrc[-1706748029] base_seq[28893]</div></div><div><br></div><div><br></div><div>X.X.X.X is the IP of our TURN server, now, it seems like although we have a good reflexive candidate, it takes some time for Freeswitch to pick it up and it actually tries to use the relay (TURN)... Any idea what is happening and what we can do to solve that?<br></div><div><br></div><div>Here are the ICE candidates from the client SDP:</div><div><div>a=candidate:1780409101 1 udp 2122063615 192.168.15.3 56494 typ host generation 0</div><div>a=candidate:1780409101 2 udp 2122063615 192.168.15.3 56494 typ host generation 0</div><div>a=candidate:4043381328 1 udp 2122129151 10.159.103.156 51485 typ host generation 0</div><div>a=candidate:4043381328 2 udp 2122129151 10.159.103.156 51485 typ host generation 0</div><div>a=candidate:2618202841 1 udp 1685855999 67.180.21.132 56494 typ srflx raddr 192.168.15.3 rport 56494 generation 0</div><div>a=candidate:2618202841 2 udp 1685855999 67.180.21.132 56494 typ srflx raddr 192.168.15.3 rport 56494 generation 0</div><div>a=candidate:614277117 1 tcp 1518083839 192.168.15.3 54312 typ host tcptype passive generation 0</div><div>a=candidate:614277117 2 tcp 1518083839 192.168.15.3 54312 typ host tcptype passive generation 0</div><div>a=candidate:3213026976 1 tcp 1518149375 10.159.103.156 54313 typ host tcptype passive generation 0</div><div>a=candidate:3213026976 2 tcp 1518149375 10.159.103.156 54313 typ host tcptype passive generation 0</div><div>a=candidate:3054806047 1 udp 24911615 X.X.X.X 65452 typ relay raddr 67.180.21.132 rport 54310 generation 0</div><div>a=candidate:3054806047 2 udp 24911615 X.X.X.X 65452 typ relay raddr 67.180.21.132 rport 54310 generation 0</div><div>a=candidate:1032594883 1 udp 1685921535 166.170.42.141 64296 typ srflx raddr 10.159.103.156 rport 51485 generation 0</div><div>a=candidate:1032594883 2 udp 1685921535 166.170.42.141 64296 typ srflx raddr 10.159.103.156 rport 51485 generation 0</div><div>a=candidate:3054806047 1 udp 24977151 X.X.X.X 49737 typ relay raddr 166.170.42.141 rport 56009 generation 0</div><div>a=candidate:3054806047 2 udp 24977151 X.X.X.X 49737 typ relay raddr 166.170.42.141 rport 56009 generation 0</div></div><div><br></div><div>Thanks,</div><div>Adam</div></div>
</blockquote></div><br></div>