Browse Source

Sends peer connection stats to the focus(written by Boris Grozev).

master
paweldomas 11 years ago
parent
commit
b5ecdc8dee
1 changed files with 6 additions and 3 deletions
  1. 6
    3
      rtp_sts.js

+ 6
- 3
rtp_sts.js View File

@@ -290,6 +290,10 @@ StatsCollector.prototype.addStatsToBeLogged = function (reports) {
290 290
 };
291 291
 
292 292
 StatsCollector.prototype.logStats = function () {
293
+    if (!focusJid) {
294
+        return;
295
+    }
296
+
293 297
     var deflate = true;
294 298
 
295 299
     var content = JSON.stringify(this.statsToBeLogged);
@@ -299,7 +303,7 @@ StatsCollector.prototype.logStats = function () {
299 303
     content = Base64.encode(content);
300 304
 
301 305
     // XEP-0337-ish
302
-    var message = $msg();
306
+    var message = $msg({to: focusJid, type: 'normal'});
303 307
     message.c('log', { xmlns: 'urn:xmpp:eventlog',
304 308
                        id: 'PeerConnectionStats'});
305 309
     message.c('message').t(content).up();
@@ -308,8 +312,7 @@ StatsCollector.prototype.logStats = function () {
308 312
     }
309 313
     message.up();
310 314
 
311
-    //TODO: actually send the message...
312
-    console.log(message.toString());
315
+    connection.send(message);
313 316
 
314 317
     // Reset the stats
315 318
     this.statsToBeLogged.stats = {};

Loading…
Cancel
Save