<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>Bugs get reported to Jira @ <a href="https://freeswitch.org/jira">https://freeswitch.org/jira</a>  so they don’t fall thru the cracks<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] <b>On Behalf Of </b>????????? ????????<br><b>Sent:</b> Tuesday, September 27, 2016 4:10 AM<br><b>To:</b> freeswitch-users@lists.freeswitch.org<br><b>Subject:</b> [Freeswitch-users] Fwd: Freeswitch uses wrong ICE candidate to establish connection<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><div><p class=MsoNormal><o:p>&nbsp;</o:p></p><div><p class=MsoNormal style='margin-bottom:12.0pt'>---------- Forwarded message ----------<br>From: <b>Александр Дружилов</b> &lt;<a href="mailto:alexdruzhilov@gmail.com">alexdruzhilov@gmail.com</a>&gt;<br>Date: 2016-09-26 14:31 GMT+03:00<br>Subject: Freeswitch uses wrong ICE candidate to establish connection<br>To: <a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a><br><br><o:p></o:p></p><div><div><p class=MsoNormal><b>The short description of problem</b><o:p></o:p></p></div><div><p class=MsoNormal>We are using Freeswitch for conference calls through webRTC. Chrome collects ICE candidates (from two net interfaces: ethernet and wifi), sends them to Freeswitch and Freeswitch accepts one of this candidates. After that Freeswitch tries to make DTLS handshake, but Chrome ignores it and sends STUN pings over and over again. But if I disable one of this network interfaces, then everything works fine. From my point of view the problem is that Freeswitch uses wrong ICE candidate (it takes this candidate from STUN pings, but there is no exactly such candidate in SDP). I also admit that may be the root of the problem is inside Chrome (because Firefox works properly in this case), but I interested in possible explanations an may be solutions from the Freeswitch side.&nbsp;<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><p class=MsoNormal><b>Versions</b><br>Freeswitch 1.6.9, 1.6.10<br>Chrome 52, 53, 54<o:p></o:p></p><div><p class=MsoNormal>Server OS: CentOS&nbsp;7.2.1511<br>Client OS: Ubuntu 16.04<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal><b>IP addresses</b><o:p></o:p></p></div><div><p class=MsoNormal>1)&nbsp;172.15.1.1 - local VM (VirtualBox)<br>2)&nbsp;192.168.22.57 - local ethernet interface<br>3)&nbsp;192.168.41.185 - local wi-fi interface<o:p></o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'>4)&nbsp;52.202.171.116 - Freeswitch IP<o:p></o:p></p></div><div><p class=MsoNormal><b>Succsess case</b><o:p></o:p></p></div><div><p class=MsoNormal>Chrome sends offer with this candidates (Ethernet and WI-FI addresses)<o:p></o:p></p></div><div><div><p class=MsoNormal>a=candidate:988003974 1 udp 2122260223 192.168.22.57 56687 typ host generation 0 network-id 1<o:p></o:p></p></div><div><p class=MsoNormal>a=candidate:3404510875 1 udp 2122194687 192.168.41.185 57467 typ host generation 0 network-id 4 network-cost 10<o:p></o:p></p></div><div><p class=MsoNormal>a=candidate:988003974 2 udp 2122260222 192.168.22.57 60099 typ host generation 0 network-id 1<o:p></o:p></p></div><div><p class=MsoNormal>a=candidate:3404510875 2 udp 2122194686 192.168.41.185 54887 typ host generation 0 network-id 4 network-cost 10<o:p></o:p></p></div><div><p class=MsoNormal>a=candidate:3148593202 1 udp 1686052607 80.254.60.17 56687 typ srflx raddr 192.168.22.57 rport 56687 generation 0 network-id 1<o:p></o:p></p></div><div><p class=MsoNormal>a=candidate:3148593202 2 udp 1686052606 80.254.60.17 60099 typ srflx raddr 192.168.22.57 rport 60099 generation 0 network-id 1<o:p></o:p></p></div></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>Freeswitch choose srflx candidate<br>2016-09-26 10:54:28.337897 [DEBUG] switch_core_media.c:6434 AUDIO RTP [sofia/external576460752303423473@wrike] 172.16.106.100 port 17052 -&gt; 80.254.60.17 port 56687 codec: 111 ms: 20<o:p></o:p></p></div><div><p class=MsoNormal>Receives STUN pings from this interface and everything goes as expected - media stream established.<br><br><b>Failure case (add one interface (VirtualBox) or disable one of existing interfaces)</b><o:p></o:p></p></div><div><p class=MsoNormal>Chrome sends offer with one additional interface (VirtualBox).<o:p></o:p></p><div><p class=MsoNormal>a=candidate:1861086701 1 udp 2122260223 172.15.1.1 43367 typ host generation 0 network-id 3<o:p></o:p></p></div><div><p class=MsoNormal>a=candidate:988003974 1 udp 2122194687 192.168.22.57 54230 typ host generation 0 network-id 1<o:p></o:p></p></div><div><p class=MsoNormal>a=candidate:3404510875 1 udp 2122129151 192.168.41.185 42752 typ host generation 0 network-id 4 network-cost 10<o:p></o:p></p></div><div><p class=MsoNormal>a=candidate:1861086701 2 udp 2122260222 172.15.1.1 55301 typ host generation 0 network-id 3<o:p></o:p></p></div><div><p class=MsoNormal>a=candidate:988003974 2 udp 2122194686 192.168.22.57 44112 typ host generation 0 network-id 1<o:p></o:p></p></div><div><p class=MsoNormal>a=candidate:3404510875 2 udp 2122129150 192.168.41.185 46978 typ host generation 0 network-id 4 network-cost 10<o:p></o:p></p></div><div><p class=MsoNormal>a=candidate:3148593202 1 udp 1685987071 80.254.60.17 54230 typ srflx raddr 192.168.22.57 rport 54230 generation 0 network-id 1<o:p></o:p></p></div><div><p class=MsoNormal>a=candidate:3148593202 2 udp 1685987070 80.254.60.17 44112 typ srflx raddr 192.168.22.57 rport 44112 generation 0 network-id 1<o:p></o:p></p></div></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>Freeswitch choose VirtualBox interface as main candidate<o:p></o:p></p></div><div><div><p class=MsoNormal>2016-09-26 11:03:40.513295 [DEBUG] switch_core_media.c:6434 AUDIO RTP [sofia/external/576460752303423471@wrike] 172.16.106.100 port 17000 -&gt; 172.15.1.1 port 42374 codec: 111 ms: 20<o:p></o:p></p></div></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>After a few STUN pings Freeswitch changes his main candidate to the public address of my Wi-Fi interface (but it was not included in SDP by chrome and I don't know exactly why).<o:p></o:p></p></div><div><p class=MsoNormal>2016-09-26 11:03:40.912987 [NOTICE] switch_rtp.c:1258 Auto Changing video stun/rtp/dtls port from <a href="http://172.15.1.1:43367" target="_blank">172.15.1.1:43367</a> to <a href="http://80.254.60.17:42752" target="_blank">80.254.60.17:42752</a><br><br>Freeswitch tries to make DTLS handshake with this candidate, but fails because Chrome ingores this &quot;Client Hello&quot; request.<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>All necessary data attached for success and failure cases (freeswitch logs, wireshark dump made on client, SDP).<o:p></o:p></p></div></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></div></body></html>