@observertc/observer-js 0.41.7 → 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ObservedCall.d.ts +10 -3
- package/lib/ObservedCall.d.ts.map +1 -1
- package/lib/ObservedCall.js +28 -0
- package/lib/ObservedClient.d.ts +4 -0
- package/lib/ObservedClient.d.ts.map +1 -1
- package/lib/ObservedClient.js +81 -32
- package/lib/ObservedInboundAudioTrack.d.ts +94 -0
- package/lib/ObservedInboundAudioTrack.d.ts.map +1 -0
- package/lib/ObservedInboundAudioTrack.js +215 -0
- package/lib/ObservedInboundVideoTrack.d.ts +98 -0
- package/lib/ObservedInboundVideoTrack.d.ts.map +1 -0
- package/lib/{ObservedInboundTrack.js → ObservedInboundVideoTrack.js} +53 -44
- package/lib/ObservedOutboundAudioTrack.d.ts +85 -0
- package/lib/ObservedOutboundAudioTrack.d.ts.map +1 -0
- package/lib/{ObservedOutboundTrack.js → ObservedOutboundAudioTrack.js} +35 -58
- package/lib/ObservedOutboundVideoTrack.d.ts +88 -0
- package/lib/ObservedOutboundVideoTrack.d.ts.map +1 -0
- package/lib/ObservedOutboundVideoTrack.js +204 -0
- package/lib/ObservedPeerConnection.d.ts +26 -16
- package/lib/ObservedPeerConnection.d.ts.map +1 -1
- package/lib/ObservedPeerConnection.js +157 -86
- package/lib/RemoteTrackAssigner.d.ts +14 -0
- package/lib/RemoteTrackAssigner.d.ts.map +1 -0
- package/lib/RemoteTrackAssigner.js +52 -0
- package/lib/common/CalculatedScore.d.ts +79 -0
- package/lib/common/CalculatedScore.d.ts.map +1 -0
- package/lib/common/CalculatedScore.js +155 -0
- package/lib/common/QualityScoreUtils.d.ts +1 -0
- package/lib/common/QualityScoreUtils.d.ts.map +1 -0
- package/lib/common/QualityScoreUtils.js +1 -0
- package/lib/common/utils.d.ts +1 -0
- package/lib/common/utils.d.ts.map +1 -1
- package/lib/common/utils.js +14 -1
- package/lib/index.d.ts +4 -2
- package/lib/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ObservedCall.ts +40 -4
- package/src/ObservedClient.ts +77 -17
- package/src/ObservedInboundAudioTrack.ts +336 -0
- package/src/{ObservedInboundTrack.ts → ObservedInboundVideoTrack.ts} +85 -66
- package/src/{ObservedOutboundTrack.ts → ObservedOutboundAudioTrack.ts} +59 -74
- package/src/ObservedOutboundVideoTrack.ts +326 -0
- package/src/ObservedPeerConnection.ts +205 -131
- package/src/RemoteTrackAssigner.ts +68 -0
- package/src/common/CalculatedScore.ts +180 -0
- package/src/common/QualityScoreUtils.ts +0 -0
- package/src/common/utils.ts +17 -1
- package/src/index.ts +4 -2
- package/src/monitors/CallSummaryMonitor.ts +3 -3
- package/lib/ObservedInboundTrack.d.ts +0 -96
- package/lib/ObservedInboundTrack.d.ts.map +0 -1
- package/lib/ObservedOutboundTrack.d.ts +0 -84
- package/lib/ObservedOutboundTrack.d.ts.map +0 -1
package/lib/ObservedCall.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
3
|
import { ObservedClient, ObservedClientModel } from './ObservedClient';
|
|
4
|
-
import { ObservedOutboundTrack } from './ObservedOutboundTrack';
|
|
5
4
|
import { Observer } from './Observer';
|
|
6
5
|
import { PartialBy } from './common/utils';
|
|
7
6
|
import { CallEventReport } from '@observertc/report-schemas-js';
|
|
8
7
|
import { ClientSample } from '@observertc/sample-schemas-js';
|
|
9
8
|
import { ClientIssue } from './monitors/CallSummary';
|
|
9
|
+
import { ObservedOutboundAudioTrack } from './ObservedOutboundAudioTrack';
|
|
10
|
+
import { ObservedOutboundVideoTrack } from './ObservedOutboundVideoTrack';
|
|
11
|
+
import { CalculatedScore } from './common/CalculatedScore';
|
|
10
12
|
type ClientIssueDetectionConfig = Pick<ClientIssue, 'severity'>;
|
|
11
13
|
export type ObservedCallModel = {
|
|
12
14
|
serviceId: string;
|
|
@@ -32,8 +34,12 @@ export declare class ObservedCall<AppData extends Record<string, unknown> = Reco
|
|
|
32
34
|
readonly created: number;
|
|
33
35
|
readonly processor: import("./common/Middleware").Processor<ClientSample>;
|
|
34
36
|
private readonly _clients;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
_scoreData?: {
|
|
38
|
+
score: CalculatedScore;
|
|
39
|
+
calculated: number;
|
|
40
|
+
};
|
|
41
|
+
readonly sfuStreamIdToOutboundAudioTrack: Map<string | number, ObservedOutboundAudioTrack>;
|
|
42
|
+
readonly sfuStreamIdToOutboundVideoTrack: Map<string | number, ObservedOutboundVideoTrack>;
|
|
37
43
|
private _closed;
|
|
38
44
|
private _updated;
|
|
39
45
|
private _ended?;
|
|
@@ -45,6 +51,7 @@ export declare class ObservedCall<AppData extends Record<string, unknown> = Reco
|
|
|
45
51
|
get updated(): number;
|
|
46
52
|
get ended(): number | undefined;
|
|
47
53
|
get clients(): ReadonlyMap<string, ObservedClient>;
|
|
54
|
+
get score(): CalculatedScore | undefined;
|
|
48
55
|
get closed(): boolean;
|
|
49
56
|
close(timestamp?: number): void;
|
|
50
57
|
addEventReport(params: PartialBy<Omit<CallEventReport, 'serviceId' | 'roomId' | 'callId'>, 'timestamp'>): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObservedCall.d.ts","sourceRoot":"","sources":["../src/ObservedCall.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,cAAc,EAAwB,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC7F,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ObservedCall.d.ts","sourceRoot":"","sources":["../src/ObservedCall.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,cAAc,EAAwB,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC7F,OAAO,EAAE,QAAQ,E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AAW,MAAM,YAEhB;IAEM,KAAK,CAAC,SAAS,CAAC,EAAE,MAAM;IAUxB,cAAc,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,eAAe,EAAE,WAAW,GAAG,QAAQ,GAAG,QAAQ,CAAE,EAAE,WAAW,CAAC;IAUxG,YAAY,CAAC,aAAa,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,mBAAmB,GAAG;QAC1H,OAAO,EAAE,aAAa,CAAC;QACvB,0BAA0B,CAAC,EAAE,OAAO,CAAC;QACrC,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,YAAY,CAAC,EAAE;YACd,MAAM,EAAE,WAAW,CAAC,UAAU,CAAC,GAAG,0BAA0B,CAAC;SAC7D,CAAC;KACF;CAiED"}
|
package/lib/ObservedCall.js
CHANGED
|
@@ -15,6 +15,7 @@ exports.ObservedCall = void 0;
|
|
|
15
15
|
const events_1 = require("events");
|
|
16
16
|
const ObservedClient_1 = require("./ObservedClient");
|
|
17
17
|
const callEventReports_1 = require("./common/callEventReports");
|
|
18
|
+
const utils_1 = require("./common/utils");
|
|
18
19
|
const Middleware_1 = require("./common/Middleware");
|
|
19
20
|
class ObservedCall extends events_1.EventEmitter {
|
|
20
21
|
constructor(_model, observer, appData) {
|
|
@@ -55,6 +56,33 @@ class ObservedCall extends events_1.EventEmitter {
|
|
|
55
56
|
get clients() {
|
|
56
57
|
return this._clients;
|
|
57
58
|
}
|
|
59
|
+
get score() {
|
|
60
|
+
var _a, _b, _c;
|
|
61
|
+
const now = Date.now();
|
|
62
|
+
if (now - 15000 < ((_b = (_a = this._scoreData) === null || _a === void 0 ? void 0 : _a.calculated) !== null && _b !== void 0 ? _b : 0)) {
|
|
63
|
+
return (_c = this._scoreData) === null || _c === void 0 ? void 0 : _c.score;
|
|
64
|
+
}
|
|
65
|
+
else if (this.clients.size < 1) {
|
|
66
|
+
return {
|
|
67
|
+
remarks: [{
|
|
68
|
+
severity: 'none',
|
|
69
|
+
text: 'No clients',
|
|
70
|
+
}],
|
|
71
|
+
score: 5.0,
|
|
72
|
+
timestamp: now,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
const scores = [...this.clients.values()].map((client) => { var _a, _b; return (_b = (_a = client.score) === null || _a === void 0 ? void 0 : _a.score) !== null && _b !== void 0 ? _b : 5.0; });
|
|
76
|
+
this._scoreData = {
|
|
77
|
+
score: {
|
|
78
|
+
remarks: [],
|
|
79
|
+
score: (0, utils_1.getMedian)(scores),
|
|
80
|
+
timestamp: now,
|
|
81
|
+
},
|
|
82
|
+
calculated: now,
|
|
83
|
+
};
|
|
84
|
+
return this._scoreData.score;
|
|
85
|
+
}
|
|
58
86
|
get closed() {
|
|
59
87
|
return this._closed;
|
|
60
88
|
}
|
package/lib/ObservedClient.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { PartialBy } from './common/utils';
|
|
|
7
7
|
import { ObservedSfu } from './ObservedSfu';
|
|
8
8
|
import { ClientIssue } from './monitors/CallSummary';
|
|
9
9
|
import { CallEventReport } from '@observertc/report-schemas-js';
|
|
10
|
+
import { CalculatedScore } from './common/CalculatedScore';
|
|
10
11
|
export type ObservedClientModel = {
|
|
11
12
|
clientId: string;
|
|
12
13
|
mediaUnitId: string;
|
|
@@ -63,6 +64,7 @@ export type ObservedClientEvents = {
|
|
|
63
64
|
lastJoined: number;
|
|
64
65
|
}
|
|
65
66
|
];
|
|
67
|
+
score: [CalculatedScore];
|
|
66
68
|
};
|
|
67
69
|
export declare interface ObservedClient<AppData extends Record<string, unknown> = Record<string, unknown>> {
|
|
68
70
|
on<U extends keyof ObservedClientEvents>(event: U, listener: (...args: ObservedClientEvents[U]) => void): this;
|
|
@@ -84,6 +86,7 @@ export declare class ObservedClient<AppData extends Record<string, unknown> = Re
|
|
|
84
86
|
private _acceptedSamples;
|
|
85
87
|
private _timeZoneOffsetInHours?;
|
|
86
88
|
private _left?;
|
|
89
|
+
score?: CalculatedScore;
|
|
87
90
|
usingTURN: boolean;
|
|
88
91
|
availableOutgoingBitrate: number;
|
|
89
92
|
availableIncomingBitrate: number;
|
|
@@ -154,6 +157,7 @@ export declare class ObservedClient<AppData extends Record<string, unknown> = Re
|
|
|
154
157
|
addExtensionStatsReport(extensionType: string, payload?: Record<string, unknown>): void;
|
|
155
158
|
addIssue(issue: ClientIssue): void;
|
|
156
159
|
accept(sample: ClientSample): void;
|
|
160
|
+
private _addAndEmitIssue;
|
|
157
161
|
private _createPeerConnection;
|
|
158
162
|
private _addClientLeftReport;
|
|
159
163
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObservedClient.d.ts","sourceRoot":"","sources":["../src/ObservedClient.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAChJ,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAIlE,OAAO,EAAE,SAAS,EAAe,MAAM,gBAAgB,CAAC;AAGxD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"ObservedClient.d.ts","sourceRoot":"","sources":["../src/ObservedClient.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAChJ,OAAO,EAAE,YAAY,EAAE,M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IAED,IAAW,QAAQ,yBAElB;IAED,IAAW,eAAe,WAEzB;IAED,IAAW,OAAO,WAEjB;IAED,IAAW,MAAM,YAEhB;IAED,IAAW,eAAe,IAAI,WAAW,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAExE;IAEM,KAAK;IAYL,cAAc,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,eAAe,EAAE,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,aAAa,CAAC,EAAE,WAAW,CAAC,GAAG;QAAE,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE;IAoBtM,uBAAuB,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAehF,QAAQ,CAAC,KAAK,EAAE,WAAW;IA0B3B,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;IA2qBzC,OAAO,CAAC,gBAAgB;IAqBxB,OAAO,CAAC,qBAAqB;IA0B7B,OAAO,CAAC,oBAAoB;CAe5B"}
|
package/lib/ObservedClient.js
CHANGED
|
@@ -191,11 +191,10 @@ class ObservedClient extends events_1.EventEmitter {
|
|
|
191
191
|
catch (err) {
|
|
192
192
|
logger.warn(`Error adding client issue: ${err === null || err === void 0 ? void 0 : err.message}`);
|
|
193
193
|
}
|
|
194
|
-
this.
|
|
195
|
-
this.emit('issue', issue);
|
|
194
|
+
this._addAndEmitIssue(issue);
|
|
196
195
|
}
|
|
197
196
|
accept(sample) {
|
|
198
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20;
|
|
197
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26;
|
|
199
198
|
if (this._closed)
|
|
200
199
|
throw new Error(`Client ${this.clientId} is closed`);
|
|
201
200
|
if (sample.clientId && sample.clientId !== 'NULL' && sample.clientId !== this.clientId) {
|
|
@@ -288,8 +287,8 @@ class ObservedClient extends events_1.EventEmitter {
|
|
|
288
287
|
extensionType: extensionStats.type,
|
|
289
288
|
});
|
|
290
289
|
}
|
|
291
|
-
for (let
|
|
292
|
-
const { timestamp } =
|
|
290
|
+
for (let _27 of (_p = sample.customCallEvents) !== null && _p !== void 0 ? _p : []) {
|
|
291
|
+
const { timestamp } = _27, callEvent = __rest(_27, ["timestamp"]);
|
|
293
292
|
switch (callEvent.name) {
|
|
294
293
|
case CallEventType_1.CallEventType.CLIENT_JOINED: {
|
|
295
294
|
const lastJoined = this._joinedEventAt;
|
|
@@ -314,8 +313,7 @@ class ObservedClient extends events_1.EventEmitter {
|
|
|
314
313
|
trackId: callEvent.mediaTrackId,
|
|
315
314
|
attachments: callEvent.attachments ? JSON.parse(callEvent.attachments) : undefined,
|
|
316
315
|
};
|
|
317
|
-
this.
|
|
318
|
-
this.emit('issue', issue);
|
|
316
|
+
this._addAndEmitIssue(issue);
|
|
319
317
|
}
|
|
320
318
|
catch (err) {
|
|
321
319
|
logger.warn(`Error parsing client issue: ${err === null || err === void 0 ? void 0 : err.message}`);
|
|
@@ -397,16 +395,23 @@ class ObservedClient extends events_1.EventEmitter {
|
|
|
397
395
|
sfuSinkId: track.sfuSinkId,
|
|
398
396
|
});
|
|
399
397
|
inboundAudioTrack.update(track, sample.timestamp);
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
remoteOutboundTrack
|
|
398
|
+
if (!inboundAudioTrack.remoteOutboundTrack) {
|
|
399
|
+
const remoteOutboundTrack = this.call.sfuStreamIdToOutboundAudioTrack.get((_1 = inboundAudioTrack.sfuStreamId) !== null && _1 !== void 0 ? _1 : '');
|
|
400
|
+
if (remoteOutboundTrack) {
|
|
401
|
+
inboundAudioTrack.remoteOutboundTrack = remoteOutboundTrack;
|
|
402
|
+
inboundAudioTrack.once('close', () => {
|
|
403
|
+
var _a;
|
|
404
|
+
remoteOutboundTrack === null || remoteOutboundTrack === void 0 ? void 0 : remoteOutboundTrack.remoteInboundTracks.delete((_a = inboundAudioTrack.trackId) !== null && _a !== void 0 ? _a : '');
|
|
405
|
+
});
|
|
406
|
+
remoteOutboundTrack.remoteInboundTracks.set((_2 = inboundAudioTrack.trackId) !== null && _2 !== void 0 ? _2 : '', inboundAudioTrack);
|
|
407
|
+
}
|
|
403
408
|
}
|
|
404
409
|
}
|
|
405
410
|
catch (err) {
|
|
406
411
|
logger.error(`Error creating inbound audio track: ${err === null || err === void 0 ? void 0 : err.message}`);
|
|
407
412
|
}
|
|
408
413
|
}
|
|
409
|
-
for (const track of (
|
|
414
|
+
for (const track of (_3 = sample.inboundVideoTracks) !== null && _3 !== void 0 ? _3 : []) {
|
|
410
415
|
if (!track.peerConnectionId || !track.trackId) {
|
|
411
416
|
logger.warn(`InboundVideoTrack without peerConnectionId or trackId: ${JSON.stringify(track)}`);
|
|
412
417
|
continue;
|
|
@@ -419,63 +424,76 @@ class ObservedClient extends events_1.EventEmitter {
|
|
|
419
424
|
continue;
|
|
420
425
|
}
|
|
421
426
|
try {
|
|
422
|
-
const peerConnection = (
|
|
427
|
+
const peerConnection = (_4 = this._peerConnections.get(track.peerConnectionId)) !== null && _4 !== void 0 ? _4 : this._createPeerConnection(track.peerConnectionId);
|
|
423
428
|
if (!peerConnection)
|
|
424
429
|
continue;
|
|
425
|
-
const inboundVideoTrack = (
|
|
430
|
+
const inboundVideoTrack = (_5 = peerConnection.inboundVideoTracks.get(track.trackId)) !== null && _5 !== void 0 ? _5 : peerConnection.createInboundVideoTrack({
|
|
426
431
|
trackId: track.trackId,
|
|
427
432
|
sfuStreamId: track.sfuStreamId,
|
|
428
433
|
sfuSinkId: track.sfuSinkId,
|
|
429
434
|
});
|
|
430
435
|
inboundVideoTrack.update(track, sample.timestamp);
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
remoteOutboundTrack
|
|
436
|
+
if (!inboundVideoTrack.remoteOutboundTrack) {
|
|
437
|
+
const remoteOutboundTrack = this.call.sfuStreamIdToOutboundVideoTrack.get((_6 = inboundVideoTrack.sfuStreamId) !== null && _6 !== void 0 ? _6 : '');
|
|
438
|
+
if (remoteOutboundTrack) {
|
|
439
|
+
inboundVideoTrack.remoteOutboundTrack = remoteOutboundTrack;
|
|
440
|
+
inboundVideoTrack.once('close', () => {
|
|
441
|
+
var _a;
|
|
442
|
+
remoteOutboundTrack === null || remoteOutboundTrack === void 0 ? void 0 : remoteOutboundTrack.remoteInboundTracks.delete((_a = inboundVideoTrack.trackId) !== null && _a !== void 0 ? _a : '');
|
|
443
|
+
});
|
|
444
|
+
remoteOutboundTrack.remoteInboundTracks.set((_7 = inboundVideoTrack.trackId) !== null && _7 !== void 0 ? _7 : '', inboundVideoTrack);
|
|
445
|
+
}
|
|
434
446
|
}
|
|
435
447
|
}
|
|
436
448
|
catch (err) {
|
|
437
449
|
logger.error(`Error creating inbound video track: ${err === null || err === void 0 ? void 0 : err.message}`);
|
|
438
450
|
}
|
|
439
451
|
}
|
|
440
|
-
for (const track of (
|
|
452
|
+
for (const track of (_8 = sample.outboundAudioTracks) !== null && _8 !== void 0 ? _8 : []) {
|
|
441
453
|
if (!track.peerConnectionId || !track.trackId) {
|
|
442
454
|
logger.warn(`OutboundAudioTrack without peerConnectionId or trackId: ${JSON.stringify(track)}`);
|
|
443
455
|
continue;
|
|
444
456
|
}
|
|
445
457
|
try {
|
|
446
|
-
const peerConnection = (
|
|
458
|
+
const peerConnection = (_9 = this._peerConnections.get(track.peerConnectionId)) !== null && _9 !== void 0 ? _9 : this._createPeerConnection(track.peerConnectionId);
|
|
447
459
|
if (!peerConnection)
|
|
448
460
|
continue;
|
|
449
|
-
const outboundAudioTrack = (
|
|
461
|
+
const outboundAudioTrack = (_10 = peerConnection.outboundAudioTracks.get(track.trackId)) !== null && _10 !== void 0 ? _10 : peerConnection.createOutboundAudioTrack({
|
|
450
462
|
trackId: track.trackId,
|
|
451
463
|
sfuStreamId: track.sfuStreamId,
|
|
452
464
|
});
|
|
453
465
|
outboundAudioTrack.update(track, sample.timestamp);
|
|
466
|
+
if (outboundAudioTrack.sfuStreamId && !this.call.sfuStreamIdToOutboundAudioTrack.has(outboundAudioTrack.sfuStreamId)) {
|
|
467
|
+
this.call.sfuStreamIdToOutboundAudioTrack.set(outboundAudioTrack.sfuStreamId, outboundAudioTrack);
|
|
468
|
+
}
|
|
454
469
|
}
|
|
455
470
|
catch (err) {
|
|
456
471
|
logger.error(`Error creating outbound audio track: ${err === null || err === void 0 ? void 0 : err.message}`);
|
|
457
472
|
}
|
|
458
473
|
}
|
|
459
|
-
for (const track of (
|
|
474
|
+
for (const track of (_11 = sample.outboundVideoTracks) !== null && _11 !== void 0 ? _11 : []) {
|
|
460
475
|
if (!track.peerConnectionId || !track.trackId) {
|
|
461
476
|
logger.warn(`OutboundVideoTrack without peerConnectionId or trackId: ${JSON.stringify(track)}`);
|
|
462
477
|
continue;
|
|
463
478
|
}
|
|
464
479
|
try {
|
|
465
|
-
const peerConnection = (
|
|
480
|
+
const peerConnection = (_12 = this._peerConnections.get(track.peerConnectionId)) !== null && _12 !== void 0 ? _12 : this._createPeerConnection(track.peerConnectionId);
|
|
466
481
|
if (!peerConnection)
|
|
467
482
|
continue;
|
|
468
|
-
const outboundVideoTrack = (
|
|
483
|
+
const outboundVideoTrack = (_13 = peerConnection.outboundVideoTracks.get(track.trackId)) !== null && _13 !== void 0 ? _13 : peerConnection.createOutboundVideoTrack({
|
|
469
484
|
trackId: track.trackId,
|
|
470
485
|
sfuStreamId: track.sfuStreamId,
|
|
471
486
|
});
|
|
472
487
|
outboundVideoTrack.update(track, sample.timestamp);
|
|
488
|
+
if (outboundVideoTrack.sfuStreamId && !this.call.sfuStreamIdToOutboundVideoTrack.has(outboundVideoTrack.sfuStreamId)) {
|
|
489
|
+
this.call.sfuStreamIdToOutboundVideoTrack.set(outboundVideoTrack.sfuStreamId, outboundVideoTrack);
|
|
490
|
+
}
|
|
473
491
|
}
|
|
474
492
|
catch (err) {
|
|
475
493
|
logger.error(`Error creating outbound video track: ${err === null || err === void 0 ? void 0 : err.message}`);
|
|
476
494
|
}
|
|
477
495
|
}
|
|
478
|
-
for (const iceLocalCandidate of (
|
|
496
|
+
for (const iceLocalCandidate of (_14 = sample.iceLocalCandidates) !== null && _14 !== void 0 ? _14 : []) {
|
|
479
497
|
if (!iceLocalCandidate.peerConnectionId) {
|
|
480
498
|
logger.warn(`Local ice candidate without peerConnectionId: ${JSON.stringify(iceLocalCandidate)}`);
|
|
481
499
|
continue;
|
|
@@ -487,7 +505,7 @@ class ObservedClient extends events_1.EventEmitter {
|
|
|
487
505
|
}
|
|
488
506
|
peerConnection.ICE.addLocalCandidate(iceLocalCandidate, sample.timestamp);
|
|
489
507
|
}
|
|
490
|
-
for (const iceRemoteCandidate of (
|
|
508
|
+
for (const iceRemoteCandidate of (_15 = sample.iceRemoteCandidates) !== null && _15 !== void 0 ? _15 : []) {
|
|
491
509
|
if (!iceRemoteCandidate.peerConnectionId) {
|
|
492
510
|
logger.warn(`Remote ice candidate without peerConnectionId: ${JSON.stringify(iceRemoteCandidate)}`);
|
|
493
511
|
continue;
|
|
@@ -499,7 +517,7 @@ class ObservedClient extends events_1.EventEmitter {
|
|
|
499
517
|
}
|
|
500
518
|
peerConnection.ICE.addRemoteCandidate(iceRemoteCandidate, sample.timestamp);
|
|
501
519
|
}
|
|
502
|
-
for (const candidatePair of (
|
|
520
|
+
for (const candidatePair of (_16 = sample.iceCandidatePairs) !== null && _16 !== void 0 ? _16 : []) {
|
|
503
521
|
const peerConnection = this._peerConnections.get(candidatePair.peerConnectionId);
|
|
504
522
|
if (!peerConnection) {
|
|
505
523
|
logger.debug(`Peer connection ${candidatePair.peerConnectionId} not found for ice candidate pair ${candidatePair.localCandidateId}, ${candidatePair.remoteCandidateId}`);
|
|
@@ -507,16 +525,16 @@ class ObservedClient extends events_1.EventEmitter {
|
|
|
507
525
|
}
|
|
508
526
|
peerConnection.ICE.update(candidatePair, sample.timestamp);
|
|
509
527
|
}
|
|
510
|
-
for (const dataChannel of (
|
|
528
|
+
for (const dataChannel of (_17 = sample.dataChannels) !== null && _17 !== void 0 ? _17 : []) {
|
|
511
529
|
if (!dataChannel.peerConnectionId || !dataChannel.dataChannelIdentifier) {
|
|
512
530
|
logger.warn(`DataChannel without peerConnectionId or dataChannelIdentifier: ${JSON.stringify(dataChannel)}`);
|
|
513
531
|
continue;
|
|
514
532
|
}
|
|
515
533
|
try {
|
|
516
|
-
const peerConnection = (
|
|
534
|
+
const peerConnection = (_18 = this._peerConnections.get(dataChannel.peerConnectionId)) !== null && _18 !== void 0 ? _18 : this._createPeerConnection(dataChannel.peerConnectionId);
|
|
517
535
|
if (!peerConnection)
|
|
518
536
|
continue;
|
|
519
|
-
const observedDataChannel = (
|
|
537
|
+
const observedDataChannel = (_19 = peerConnection.dataChannels.get(dataChannel.dataChannelIdentifier)) !== null && _19 !== void 0 ? _19 : peerConnection.createDataChannel(dataChannel.dataChannelIdentifier);
|
|
520
538
|
observedDataChannel.update(dataChannel, sample.timestamp);
|
|
521
539
|
}
|
|
522
540
|
catch (err) {
|
|
@@ -579,6 +597,8 @@ class ObservedClient extends events_1.EventEmitter {
|
|
|
579
597
|
this.inboundVideoBitrate = 0;
|
|
580
598
|
let sumRttInMs = 0;
|
|
581
599
|
let anyPeerConnectionUsingTurn = false;
|
|
600
|
+
let minPcScore = Number.MAX_SAFE_INTEGER;
|
|
601
|
+
let maxPcScore = Number.MIN_SAFE_INTEGER;
|
|
582
602
|
for (const peerConnection of this._peerConnections.values()) {
|
|
583
603
|
if (peerConnection.closed)
|
|
584
604
|
continue;
|
|
@@ -592,11 +612,22 @@ class ObservedClient extends events_1.EventEmitter {
|
|
|
592
612
|
this.deltaSentVideoBytes += peerConnection.deltaSentVideoBytes;
|
|
593
613
|
this.deltaDataChannelBytesReceived += peerConnection.deltaDataChannelBytesReceived;
|
|
594
614
|
this.deltaDataChannelBytesSent += peerConnection.deltaDataChannelBytesSent;
|
|
595
|
-
this.availableIncomingBitrate += (
|
|
596
|
-
this.availableOutgoingBitrate += (
|
|
597
|
-
sumRttInMs += (
|
|
615
|
+
this.availableIncomingBitrate += (_20 = peerConnection.availableIncomingBitrate) !== null && _20 !== void 0 ? _20 : 0;
|
|
616
|
+
this.availableOutgoingBitrate += (_21 = peerConnection.availableOutgoingBitrate) !== null && _21 !== void 0 ? _21 : 0;
|
|
617
|
+
sumRttInMs += (_22 = peerConnection.avgRttInMs) !== null && _22 !== void 0 ? _22 : 0;
|
|
598
618
|
anyPeerConnectionUsingTurn || (anyPeerConnectionUsingTurn = peerConnection.usingTURN);
|
|
599
|
-
|
|
619
|
+
minPcScore = Math.min(minPcScore, (_24 = (_23 = peerConnection.score) === null || _23 === void 0 ? void 0 : _23.score) !== null && _24 !== void 0 ? _24 : Number.MAX_SAFE_INTEGER);
|
|
620
|
+
maxPcScore = Math.max(maxPcScore, (_26 = (_25 = peerConnection.score) === null || _25 === void 0 ? void 0 : _25.score) !== null && _26 !== void 0 ? _26 : Number.MIN_SAFE_INTEGER);
|
|
621
|
+
}
|
|
622
|
+
this.score = {
|
|
623
|
+
score: minPcScore,
|
|
624
|
+
remarks: [{
|
|
625
|
+
severity: 'none',
|
|
626
|
+
text: `Min and max score of all peer connections: ${minPcScore}, ${maxPcScore}`,
|
|
627
|
+
}],
|
|
628
|
+
timestamp: sample.timestamp,
|
|
629
|
+
};
|
|
630
|
+
this.emit('score', this.score);
|
|
600
631
|
this.usingTURN = anyPeerConnectionUsingTurn === true;
|
|
601
632
|
if (wasUsingTURN !== this.usingTURN)
|
|
602
633
|
this.emit('usingturn', this.usingTURN);
|
|
@@ -624,6 +655,24 @@ class ObservedClient extends events_1.EventEmitter {
|
|
|
624
655
|
elapsedTimeInMs,
|
|
625
656
|
});
|
|
626
657
|
}
|
|
658
|
+
_addAndEmitIssue(issue) {
|
|
659
|
+
var _a;
|
|
660
|
+
this.issues.push(issue);
|
|
661
|
+
if (issue.peerConnectionId) {
|
|
662
|
+
const peerConnection = this._peerConnections.get(issue.peerConnectionId);
|
|
663
|
+
if (peerConnection) {
|
|
664
|
+
if (issue.trackId) {
|
|
665
|
+
const track = (_a = peerConnection.inboundAudioTracks.get(issue.trackId)) !== null && _a !== void 0 ? _a : peerConnection.inboundVideoTracks.get(issue.trackId);
|
|
666
|
+
if (track)
|
|
667
|
+
track.ωpendingIssuesForScores.push(issue);
|
|
668
|
+
}
|
|
669
|
+
else {
|
|
670
|
+
peerConnection.ωpendingIssuesForScores.push(issue);
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
this.emit('issue', issue);
|
|
675
|
+
}
|
|
627
676
|
_createPeerConnection(peerConnectionId, label) {
|
|
628
677
|
const result = new ObservedPeerConnection_1.ObservedPeerConnection({
|
|
629
678
|
peerConnectionId,
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { EventEmitter } from 'events';
|
|
3
|
+
import { ObservedPeerConnection } from './ObservedPeerConnection';
|
|
4
|
+
import { InboundAudioTrack } from '@observertc/sample-schemas-js';
|
|
5
|
+
import { CalculatedScore } from './common/CalculatedScore';
|
|
6
|
+
import { ClientIssue } from './monitors/CallSummary';
|
|
7
|
+
import { ObservedOutboundAudioTrack } from './ObservedOutboundAudioTrack';
|
|
8
|
+
export type ObservedInboundAudioTrackModel = {
|
|
9
|
+
trackId: string;
|
|
10
|
+
sfuStreamId?: string;
|
|
11
|
+
sfuSinkId?: string;
|
|
12
|
+
};
|
|
13
|
+
export type ObservedInboundAudioTrackEvents = {
|
|
14
|
+
update: [
|
|
15
|
+
{
|
|
16
|
+
elapsedTimeInMs: number;
|
|
17
|
+
}
|
|
18
|
+
];
|
|
19
|
+
score: [CalculatedScore];
|
|
20
|
+
close: [];
|
|
21
|
+
remoteoutboundtrack: [ObservedOutboundAudioTrack | undefined];
|
|
22
|
+
};
|
|
23
|
+
export type ObservedInboundAudioTrackStats = InboundAudioTrack & {
|
|
24
|
+
ssrc: number;
|
|
25
|
+
bitrate: number;
|
|
26
|
+
fractionLost: number;
|
|
27
|
+
rttInMs?: number;
|
|
28
|
+
deltaReceivedBytes?: number;
|
|
29
|
+
deltaLostPackets?: number;
|
|
30
|
+
deltaReceivedPackets?: number;
|
|
31
|
+
deltaReceivedFrames?: number;
|
|
32
|
+
deltaDecodedFrames?: number;
|
|
33
|
+
deltaDroppedFrames?: number;
|
|
34
|
+
deltaReceivedSamples?: number;
|
|
35
|
+
deltaSilentConcealedSamples?: number;
|
|
36
|
+
fractionLoss?: number;
|
|
37
|
+
statsTimestamp: number;
|
|
38
|
+
};
|
|
39
|
+
export declare interface ObservedInboundAudioTrack {
|
|
40
|
+
on<U extends keyof ObservedInboundAudioTrackEvents>(event: U, listener: (...args: ObservedInboundAudioTrackEvents[U]) => void): this;
|
|
41
|
+
off<U extends keyof ObservedInboundAudioTrackEvents>(event: U, listener: (...args: ObservedInboundAudioTrackEvents[U]) => void): this;
|
|
42
|
+
once<U extends keyof ObservedInboundAudioTrackEvents>(event: U, listener: (...args: ObservedInboundAudioTrackEvents[U]) => void): this;
|
|
43
|
+
emit<U extends keyof ObservedInboundAudioTrackEvents>(event: U, ...args: ObservedInboundAudioTrackEvents[U]): boolean;
|
|
44
|
+
update(sample: InboundAudioTrack, timestamp: number): void;
|
|
45
|
+
}
|
|
46
|
+
export declare class ObservedInboundAudioTrack extends EventEmitter {
|
|
47
|
+
private readonly _model;
|
|
48
|
+
readonly peerConnection: ObservedPeerConnection;
|
|
49
|
+
readonly created: number;
|
|
50
|
+
visited: boolean;
|
|
51
|
+
private readonly _stats;
|
|
52
|
+
private _closed;
|
|
53
|
+
private _updated;
|
|
54
|
+
private _remoteOutboundTrack?;
|
|
55
|
+
private _lastMaxStatsTimestamp;
|
|
56
|
+
bitrate: number;
|
|
57
|
+
rttInMs?: number;
|
|
58
|
+
jitter?: number;
|
|
59
|
+
fractionLoss: number;
|
|
60
|
+
marker?: string;
|
|
61
|
+
totalLostPackets: number;
|
|
62
|
+
totalReceivedPackets: number;
|
|
63
|
+
totalBytesReceived: number;
|
|
64
|
+
totalReceivedSamples: number;
|
|
65
|
+
totalSilentConcealedSamples: number;
|
|
66
|
+
deltaLostPackets: number;
|
|
67
|
+
deltaReceivedPackets: number;
|
|
68
|
+
deltaBytesReceived: number;
|
|
69
|
+
deltaReceivedSamples: number;
|
|
70
|
+
deltaSilentConcealedSamples: number;
|
|
71
|
+
score?: CalculatedScore;
|
|
72
|
+
ωpendingIssuesForScores: ClientIssue[];
|
|
73
|
+
constructor(_model: ObservedInboundAudioTrackModel, peerConnection: ObservedPeerConnection);
|
|
74
|
+
get serviceId(): string;
|
|
75
|
+
get roomId(): string;
|
|
76
|
+
get callId(): string;
|
|
77
|
+
get clientId(): string;
|
|
78
|
+
get mediaUnitId(): string;
|
|
79
|
+
get peerConnectionId(): string;
|
|
80
|
+
get trackId(): string;
|
|
81
|
+
get sfuStreamId(): string | undefined;
|
|
82
|
+
get sfuSinkId(): string | undefined;
|
|
83
|
+
get updated(): number;
|
|
84
|
+
get statsTimestamp(): number;
|
|
85
|
+
get stats(): ReadonlyMap<number, ObservedInboundAudioTrackStats>;
|
|
86
|
+
get reports(): import("./ReportsCollector").ReportsCollector;
|
|
87
|
+
set remoteOutboundTrack(track: ObservedOutboundAudioTrack | undefined);
|
|
88
|
+
get remoteOutboundTrack(): ObservedOutboundAudioTrack | undefined;
|
|
89
|
+
get closed(): boolean;
|
|
90
|
+
close(): void;
|
|
91
|
+
updateMetrics(): void;
|
|
92
|
+
private _updateQualityScore;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL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