WebRTC connection delay (Auto Changing stun/rtp/dtls port from)
Hi guys, 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: 2015-02-22 21:06:25.920612 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 67.180.21.132:59854 to 166.170.42.141:40334 2015-02-22 21:06:25.960618 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 166.170.42.141:40334 to 67.180.21.132:59854 2015-02-22 21:06:26.080616 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 67.180.21.132:59854 to 54.187.44.182:53379 2015-02-22 21:06:26.680617 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 54.187.44.182:53379 to 166.170.42.141:40334 2015-02-22 21:06:27.040614 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 166.170.42.141:40334 to 67.180.21.132:59854 2015-02-22 21:06:27.880612 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 67.180.21.132:59854 to 166.170.42.141:40334 2015-02-22 21:06:28.020610 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 166.170.42.141:40334 to 67.180.21.132:59854 2015-02-22 21:06:28.600614 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 67.180.21.132:59854 to 166.170.42.141:40334 2015-02-22 21:06:28.980603 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 166.170.42.141:40334 to 67.180.21.132:59854 2015-02-22 21:06:29.560612 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 67.180.21.132:59854 to 166.170.42.141:40334 2015-02-22 21:06:29.940602 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 166.170.42.141:40334 to 67.180.21.132:59854 2015-02-22 21:06:30.540561 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 67.180.21.132:59854 to 166.170.42.141:40334 2015-02-22 21:06:30.940606 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 166.170.42.141:40334 to 67.180.21.132:59854 2015-02-22 21:06:31.500595 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 67.180.21.132:59854 to 166.170.42.141:40334 2015-02-22 21:06:31.900613 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 166.170.42.141:40334 to 67.180.21.132:59854 2015-02-22 21:06:32.460602 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 67.180.21.132:59854 to 166.170.42.141:40334 2015-02-22 21:06:32.860614 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 166.170.42.141:40334 to 67.180.21.132:59854 2015-02-22 21:06:33.040612 [INFO] switch_rtp.c:2926 Changing audio DTLS state from HANDSHAKE to SETUP 2015-02-22 21:06:33.040612 [INFO] switch_rtp.c:2834 audio Fingerprint Verified. 2015-02-22 21:06:33.040612 [INFO] switch_rtp.c:3376 Activating Audio Secure RTP SEND 2015-02-22 21:06:33.040612 [INFO] switch_rtp.c:3354 Activating Audio Secure RTP RECV 2015-02-22 21:06:33.040612 [DEBUG] switch_core_sqldb.c:2599 Secure Type: srtp:dtls:AES_CM_128_HMAC_SHA1_80 2015-02-22 21:06:33.040612 [INFO] switch_rtp.c:2874 Changing audio DTLS state from SETUP to READY 2015-02-22 21:06:33.040612 [DEBUG] switch_core_sqldb.c:2599 Secure Type: srtp:dtls:AES_CM_128_HMAC_SHA1_80 2015-02-22 21:06:33.100606 [DEBUG] switch_rtp.c:1954 rtcp_stats_init: ssrc[-1706748029] base_seq[28893] 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? Here are the ICE candidates from the client SDP: a=candidate:1780409101 1 udp 2122063615 192.168.15.3 56494 typ host generation 0 a=candidate:1780409101 2 udp 2122063615 192.168.15.3 56494 typ host generation 0 a=candidate:4043381328 1 udp 2122129151 10.159.103.156 51485 typ host generation 0 a=candidate:4043381328 2 udp 2122129151 10.159.103.156 51485 typ host generation 0 a=candidate:2618202841 1 udp 1685855999 67.180.21.132 56494 typ srflx raddr 192.168.15.3 rport 56494 generation 0 a=candidate:2618202841 2 udp 1685855999 67.180.21.132 56494 typ srflx raddr 192.168.15.3 rport 56494 generation 0 a=candidate:614277117 1 tcp 1518083839 192.168.15.3 54312 typ host tcptype passive generation 0 a=candidate:614277117 2 tcp 1518083839 192.168.15.3 54312 typ host tcptype passive generation 0 a=candidate:3213026976 1 tcp 1518149375 10.159.103.156 54313 typ host tcptype passive generation 0 a=candidate:3213026976 2 tcp 1518149375 10.159.103.156 54313 typ host tcptype passive generation 0 a=candidate:3054806047 1 udp 24911615 X.X.X.X 65452 typ relay raddr 67.180.21.132 rport 54310 generation 0 a=candidate:3054806047 2 udp 24911615 X.X.X.X 65452 typ relay raddr 67.180.21.132 rport 54310 generation 0 a=candidate:1032594883 1 udp 1685921535 166.170.42.141 64296 typ srflx raddr 10.159.103.156 rport 51485 generation 0 a=candidate:1032594883 2 udp 1685921535 166.170.42.141 64296 typ srflx raddr 10.159.103.156 rport 51485 generation 0 a=candidate:3054806047 1 udp 24977151 X.X.X.X 49737 typ relay raddr 166.170.42.141 rport 56009 generation 0 a=candidate:3054806047 2 udp 24977151 X.X.X.X 49737 typ relay raddr 166.170.42.141 rport 56009 generation 0 Thanks, Adam
Just to clarify: 54.187.44.182 <http://54.187.44.182:53379/> is our TURN server (I actually forgot to replace it with X.X.X.X) 67.180.21.132 is the WiFi interface 166.170.42.141 is the 3G interface On 22 February 2015 at 23:20, Adam Ben-Ayoun <adam.ben.ayoun1@gmail.com> wrote:
Hi guys,
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:
2015-02-22 21:06:25.920612 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 67.180.21.132:59854 to 166.170.42.141:40334 2015-02-22 21:06:25.960618 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 166.170.42.141:40334 to 67.180.21.132:59854 2015-02-22 21:06:26.080616 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 67.180.21.132:59854 to 54.187.44.182:53379 2015-02-22 21:06:26.680617 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 54.187.44.182:53379 to 166.170.42.141:40334 2015-02-22 21:06:27.040614 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 166.170.42.141:40334 to 67.180.21.132:59854 2015-02-22 21:06:27.880612 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 67.180.21.132:59854 to 166.170.42.141:40334 2015-02-22 21:06:28.020610 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 166.170.42.141:40334 to 67.180.21.132:59854 2015-02-22 21:06:28.600614 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 67.180.21.132:59854 to 166.170.42.141:40334 2015-02-22 21:06:28.980603 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 166.170.42.141:40334 to 67.180.21.132:59854 2015-02-22 21:06:29.560612 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 67.180.21.132:59854 to 166.170.42.141:40334 2015-02-22 21:06:29.940602 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 166.170.42.141:40334 to 67.180.21.132:59854 2015-02-22 21:06:30.540561 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 67.180.21.132:59854 to 166.170.42.141:40334 2015-02-22 21:06:30.940606 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 166.170.42.141:40334 to 67.180.21.132:59854 2015-02-22 21:06:31.500595 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 67.180.21.132:59854 to 166.170.42.141:40334 2015-02-22 21:06:31.900613 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 166.170.42.141:40334 to 67.180.21.132:59854 2015-02-22 21:06:32.460602 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 67.180.21.132:59854 to 166.170.42.141:40334 2015-02-22 21:06:32.860614 [NOTICE] switch_rtp.c:1151 Auto Changing stun/rtp/dtls port from 166.170.42.141:40334 to 67.180.21.132:59854 2015-02-22 21:06:33.040612 [INFO] switch_rtp.c:2926 Changing audio DTLS state from HANDSHAKE to SETUP 2015-02-22 21:06:33.040612 [INFO] switch_rtp.c:2834 audio Fingerprint Verified. 2015-02-22 21:06:33.040612 [INFO] switch_rtp.c:3376 Activating Audio Secure RTP SEND 2015-02-22 21:06:33.040612 [INFO] switch_rtp.c:3354 Activating Audio Secure RTP RECV 2015-02-22 21:06:33.040612 [DEBUG] switch_core_sqldb.c:2599 Secure Type: srtp:dtls:AES_CM_128_HMAC_SHA1_80 2015-02-22 21:06:33.040612 [INFO] switch_rtp.c:2874 Changing audio DTLS state from SETUP to READY 2015-02-22 21:06:33.040612 [DEBUG] switch_core_sqldb.c:2599 Secure Type: srtp:dtls:AES_CM_128_HMAC_SHA1_80 2015-02-22 21:06:33.100606 [DEBUG] switch_rtp.c:1954 rtcp_stats_init: ssrc[-1706748029] base_seq[28893]
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?
Here are the ICE candidates from the client SDP: a=candidate:1780409101 1 udp 2122063615 192.168.15.3 56494 typ host generation 0 a=candidate:1780409101 2 udp 2122063615 192.168.15.3 56494 typ host generation 0 a=candidate:4043381328 1 udp 2122129151 10.159.103.156 51485 typ host generation 0 a=candidate:4043381328 2 udp 2122129151 10.159.103.156 51485 typ host generation 0 a=candidate:2618202841 1 udp 1685855999 67.180.21.132 56494 typ srflx raddr 192.168.15.3 rport 56494 generation 0 a=candidate:2618202841 2 udp 1685855999 67.180.21.132 56494 typ srflx raddr 192.168.15.3 rport 56494 generation 0 a=candidate:614277117 1 tcp 1518083839 192.168.15.3 54312 typ host tcptype passive generation 0 a=candidate:614277117 2 tcp 1518083839 192.168.15.3 54312 typ host tcptype passive generation 0 a=candidate:3213026976 1 tcp 1518149375 10.159.103.156 54313 typ host tcptype passive generation 0 a=candidate:3213026976 2 tcp 1518149375 10.159.103.156 54313 typ host tcptype passive generation 0 a=candidate:3054806047 1 udp 24911615 X.X.X.X 65452 typ relay raddr 67.180.21.132 rport 54310 generation 0 a=candidate:3054806047 2 udp 24911615 X.X.X.X 65452 typ relay raddr 67.180.21.132 rport 54310 generation 0 a=candidate:1032594883 1 udp 1685921535 166.170.42.141 64296 typ srflx raddr 10.159.103.156 rport 51485 generation 0 a=candidate:1032594883 2 udp 1685921535 166.170.42.141 64296 typ srflx raddr 10.159.103.156 rport 51485 generation 0 a=candidate:3054806047 1 udp 24977151 X.X.X.X 49737 typ relay raddr 166.170.42.141 rport 56009 generation 0 a=candidate:3054806047 2 udp 24977151 X.X.X.X 49737 typ relay raddr 166.170.42.141 rport 56009 generation 0
Thanks, Adam
Probably FS trying establish connection with different IP addresses (54.187.44.182, 67.180.21.132, 166.170.42.141) and has not getting response. When timeout reached FS trying next IP address. Verify it by command tcpdump -ni <you_server_network_interface> host 54.187.44.182 or host 67.180.21.132 or host 166.170.42.141
You also don't outline which rev of FreeSWITCH you're running, If you're using WebRTC you MUST, I repeat MUST MUST MUST run master. If the issue persists, file a JIRA with all the details of the issue you're experiencing. On Mon, Feb 23, 2015 at 12:36 AM, Sergey Safarov <s.safarov@gmail.com> wrote:
Probably FS trying establish connection with different IP addresses (54.187.44.182, 67.180.21.132, 166.170.42.141) and has not getting response. When timeout reached FS trying next IP address. Verify it by command tcpdump -ni <you_server_network_interface> host 54.187.44.182 or host 67.180.21.132 or host 166.170.42.141
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- *Brian West* brian@freeswitch.org *Twitter: @FreeSWITCH , @briankwest* http://www.freeswitchbook.com http://www.freeswitchcookbook.com *T:*+19184209001 | *F:*+19184209002 | *M:*+1918424WEST (9378) *iNUM:*+883 5100 1420 9001 | *ISN:*410*543 | *Skype:*briankwest
Reading on this issues... I am also testing Freeswitch for WebRTC, currently on 1.4.15+git~20141229T185951Z~507a0f22c5~64bit (git 507a0f2 2014-12-29 18:59:51Z 64bit). I noted some estrange behavior but was going to check them before posting in case was my fault for misconfiguring it. .- I can call from one softphone to the webrtc endpoint using JsSIP, but WebRTC to softphone won't work .- I tried compilling master on Ubuntu LTS, but I simply won't, libzrtp issues Ill report em as soon as Im done with this email. The thing is thata very same machine builds 1.4 just fine, even with the same modules.conf. 2015-02-23 11:39 GMT-04:30 Brian West <brian@freeswitch.org>:
You also don't outline which rev of FreeSWITCH you're running, If you're using WebRTC you MUST, I repeat MUST MUST MUST run master. If the issue persists, file a JIRA with all the details of the issue you're experiencing.
On Mon, Feb 23, 2015 at 12:36 AM, Sergey Safarov <s.safarov@gmail.com> wrote:
Probably FS trying establish connection with different IP addresses (54.187.44.182, 67.180.21.132, 166.170.42.141) and has not getting response. When timeout reached FS trying next IP address. Verify it by command tcpdump -ni <you_server_network_interface> host 54.187.44.182 or host 67.180.21.132 or host 166.170.42.141
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
--
*Brian West* brian@freeswitch.org
*Twitter: @FreeSWITCH , @briankwest* http://www.freeswitchbook.com http://www.freeswitchcookbook.com
*T:*+19184209001 | *F:*+19184209002 | *M:*+1918424WEST (9378) *iNUM:*+883 5100 1420 9001 | *ISN:*410*543 | *Skype:*briankwest
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Víctor E. Medina M. Software +58424 291 4561 BB #79A8AFA2 /@VMCibersys
Yes, it seems like a similar issue. In fact, I installed the master version and it seems to solve the issue. On 24 February 2015 at 15:20, Victor Medina <victor.medina@cibersys.com> wrote:
Reading on this issues...
I am also testing Freeswitch for WebRTC, currently on 1.4.15+git~20141229T185951Z~507a0f22c5~64bit (git 507a0f2 2014-12-29 18:59:51Z 64bit). I noted some estrange behavior but was going to check them before posting in case was my fault for misconfiguring it.
.- I can call from one softphone to the webrtc endpoint using JsSIP, but WebRTC to softphone won't work .- I tried compilling master on Ubuntu LTS, but I simply won't, libzrtp issues Ill report em as soon as Im done with this email. The thing is thata very same machine builds 1.4 just fine, even with the same modules.conf.
2015-02-23 11:39 GMT-04:30 Brian West <brian@freeswitch.org>:
You also don't outline which rev of FreeSWITCH you're running, If you're using WebRTC you MUST, I repeat MUST MUST MUST run master. If the issue persists, file a JIRA with all the details of the issue you're experiencing.
On Mon, Feb 23, 2015 at 12:36 AM, Sergey Safarov <s.safarov@gmail.com> wrote:
Probably FS trying establish connection with different IP addresses (54.187.44.182, 67.180.21.132, 166.170.42.141) and has not getting response. When timeout reached FS trying next IP address. Verify it by command tcpdump -ni <you_server_network_interface> host 54.187.44.182 or host 67.180.21.132 or host 166.170.42.141
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
--
*Brian West* brian@freeswitch.org
*Twitter: @FreeSWITCH , @briankwest* http://www.freeswitchbook.com http://www.freeswitchcookbook.com
*T:*+19184209001 | *F:*+19184209002 | *M:*+1918424WEST (9378) *iNUM:*+883 5100 1420 9001 | *ISN:*410*543 | *Skype:*briankwest
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
--
Víctor E. Medina M. Software +58424 291 4561 BB #79A8AFA2 /@VMCibersys
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (4)
-
Adam Ben-Ayoun
-
Brian West
-
Sergey Safarov
-
Victor Medina