Bläddra i källkod

map tcptype for tcp candidates

j8
Philipp Hancke 11 år sedan
förälder
incheckning
0d0c1b9516
1 ändrade filer med 12 tillägg och 1 borttagningar
  1. 12
    1
      libs/strophe/strophe.jingle.sdp.util.js

+ 12
- 1
libs/strophe/strophe.jingle.sdp.util.js Visa fil

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

Laddar…
Avbryt
Spara