From d148161a4246f73ed603608d469b32e02c557711 Mon Sep 17 00:00:00 2001 From: Damian Minkov Date: Fri, 29 Aug 2014 16:03:04 +0300 Subject: [PATCH] Uses the type of the turn coming from the server turn or turns. --- libs/strophe/strophe.jingle.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/strophe/strophe.jingle.js b/libs/strophe/strophe.jingle.js index 21addf163..b15702411 100644 --- a/libs/strophe/strophe.jingle.js +++ b/libs/strophe/strophe.jingle.js @@ -253,7 +253,8 @@ Strophe.addConnectionPlugin('jingle', { $(res).find('>services>service').each(function (idx, el) { el = $(el); var dict = {}; - switch (el.attr('type')) { + var type = el.attr('type'); + switch (type) { case 'stun': dict.url = 'stun:' + el.attr('host'); if (el.attr('port')) { @@ -262,7 +263,8 @@ Strophe.addConnectionPlugin('jingle', { iceservers.push(dict); break; case 'turn': - dict.url = 'turn:'; + case 'turns': + dict.url = type + ':'; if (el.attr('username')) { // https://code.google.com/p/webrtc/issues/detail?id=1508 if (navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./) && parseInt(navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)[2], 10) < 28) { dict.url += el.attr('username') + '@';