Bladeren bron

map tcptype for tcp candidates

j8
Philipp Hancke 11 jaren geleden
bovenliggende
commit
0d0c1b9516
1 gewijzigde bestanden met toevoegingen van 12 en 1 verwijderingen
  1. 12
    1
      libs/strophe/strophe.jingle.sdp.util.js

+ 12
- 1
libs/strophe/strophe.jingle.sdp.util.js Bestand weergeven

@@ -174,6 +174,9 @@ SDPUtil = {
174 174
                 case 'generation':
175 175
                     candidate.generation = elems[i + 1];
176 176
                     break;
177
+                case 'tcptype':
178
+                    candidate.tcptype = elems[i + 1];
179
+                    break;
177 180
                 default: // TODO
178 181
                     console.log('parse_icecandidate not translating "' + elems[i] + '" = "' + elems[i + 1] + '"');
179 182
             }
@@ -201,6 +204,11 @@ SDPUtil = {
201 204
                 }
202 205
                 break;
203 206
         }
207
+        if (cand.hasOwnAttribute('tcptype')) {
208
+            line += 'tcptype';
209
+            line += ' ';
210
+            line += cand.tcptype;
211
+        }
204 212
         line += 'generation';
205 213
         line += ' ';
206 214
         line += cand.hasOwnAttribute('generation') ? cand.generation : '0';
@@ -283,7 +291,7 @@ SDPUtil = {
283 291
     candidateToJingle: function (line) {
284 292
         // a=candidate:2979166662 1 udp 2113937151 192.168.2.100 57698 typ host generation 0
285 293
         //      <candidate component=... foundation=... generation=... id=... ip=... network=... port=... priority=... protocol=... type=.../>
286
-        if (line.indexOf('candidate:') == 0) {
294
+        if (line.indexOf('candidate:') === 0) {
287 295
             line = 'a=' + line;
288 296
         } else if (line.substring(0, 12) != 'a=candidate:') {
289 297
             console.log('parseCandidate called with a line that is not a candidate line');
@@ -321,6 +329,9 @@ SDPUtil = {
321 329
                 case 'generation':
322 330
                     candidate.generation = elems[i + 1];
323 331
                     break;
332
+                case 'tcptype':
333
+                    candidate.tcptype = elems[i + 1];
334
+                    break;
324 335
                 default: // TODO
325 336
                     console.log('not translating "' + elems[i] + '" = "' + elems[i + 1] + '"');
326 337
             }

Laden…
Annuleren
Opslaan