@observertc/observer-js 0.9.21-beta → 0.9.23-beta
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/.eslintrc.json +143 -0
- package/lib/Evaluator.d.ts.map +1 -1
- package/lib/Evaluator.js +54 -47
- package/lib/Observer.d.ts +1404 -38
- package/lib/Observer.d.ts.map +1 -1
- package/lib/Observer.js +479 -176
- package/lib/common/Semaphore.d.ts.map +1 -1
- package/lib/common/callMetaReports.d.ts.map +1 -1
- package/lib/common/callMetaReports.js +1 -0
- package/lib/common/logger.d.ts.map +1 -1
- package/lib/common/logger.js +15 -15
- package/lib/common/utils.d.ts +1 -0
- package/lib/common/utils.d.ts.map +1 -1
- package/lib/common/utils.js +12 -1
- package/lib/entries/CallEntry.d.ts +611 -0
- package/lib/entries/CallEntry.d.ts.map +1 -0
- package/lib/entries/CallEntry.js +75 -0
- package/lib/entries/ClientEntry.d.ts +474 -0
- package/lib/entries/ClientEntry.d.ts.map +1 -0
- package/lib/entries/ClientEntry.js +101 -0
- package/lib/entries/InboundTrackEntry.d.ts +670 -0
- package/lib/entries/InboundTrackEntry.d.ts.map +1 -0
- package/lib/entries/InboundTrackEntry.js +76 -0
- package/lib/entries/OutboundTrackEntry.d.ts +670 -0
- package/lib/entries/OutboundTrackEntry.d.ts.map +1 -0
- package/lib/entries/OutboundTrackEntry.js +73 -0
- package/lib/entries/PeerConnectionEntry.d.ts +469 -0
- package/lib/entries/PeerConnectionEntry.d.ts.map +1 -0
- package/lib/entries/PeerConnectionEntry.js +144 -0
- package/lib/entries/SfuEntry.d.ts +150 -0
- package/lib/entries/SfuEntry.d.ts.map +1 -0
- package/lib/entries/SfuEntry.js +77 -0
- package/lib/entries/SfuInboundRtpPadEntry.d.ts +14 -0
- package/lib/entries/SfuInboundRtpPadEntry.d.ts.map +1 -0
- package/lib/entries/SfuInboundRtpPadEntry.js +49 -0
- package/lib/entries/SfuOutboundRtpPadEntry.d.ts +14 -0
- package/lib/entries/SfuOutboundRtpPadEntry.d.ts.map +1 -0
- package/lib/entries/SfuOutboundRtpPadEntry.js +47 -0
- package/lib/entries/SfuSctpChannelEntry.d.ts +12 -0
- package/lib/entries/SfuSctpChannelEntry.d.ts.map +1 -0
- package/lib/entries/SfuSctpChannelEntry.js +43 -0
- package/lib/entries/SfuTransportEntry.d.ts +82 -0
- package/lib/entries/SfuTransportEntry.d.ts.map +1 -0
- package/lib/entries/SfuTransportEntry.js +122 -0
- package/lib/index.d.ts +10 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/middlewares/CallOperationsContext.d.ts.map +1 -1
- package/lib/middlewares/CallOperationsContext.js +2 -6
- package/lib/middlewares/CallProcessor.d.ts.map +1 -1
- package/lib/middlewares/CallProcessor.js +15 -6
- package/lib/middlewares/CommitTransactionMiddleware.d.ts.map +1 -1
- package/lib/middlewares/CommitTransactionMiddleware.js +22 -26
- package/lib/middlewares/DeleteOutdatedCallEntries.d.ts.map +1 -1
- package/lib/middlewares/DeleteOutdatedCallEntries.js +29 -20
- package/lib/middlewares/DeleteOutdatedSfuEntries.d.ts.map +1 -1
- package/lib/middlewares/DeleteOutdatedSfuEntries.js +27 -18
- package/lib/middlewares/Middleware.d.ts.map +1 -1
- package/lib/middlewares/Middleware.js +13 -4
- package/lib/middlewares/Processor.d.ts.map +1 -1
- package/lib/middlewares/Processor.js +18 -9
- package/lib/middlewares/TransactionContext.d.ts.map +1 -1
- package/lib/middlewares/TransactionContext.js +84 -73
- package/lib/middlewares/VisitObservedCallsMiddleware.d.ts.map +1 -1
- package/lib/middlewares/VisitObservedCallsMiddleware.js +16 -7
- package/lib/middlewares/VisitObservedSfusMiddleware.d.ts.map +1 -1
- package/lib/middlewares/VisitObservedSfusMiddleware.js +15 -6
- package/lib/middlewares/visitors/visitClient.d.ts.map +1 -1
- package/lib/middlewares/visitors/visitClient.js +6 -18
- package/lib/middlewares/visitors/visitInboundAudioTrack.d.ts.map +1 -1
- package/lib/middlewares/visitors/visitInboundAudioTrack.js +17 -20
- package/lib/middlewares/visitors/visitInboundVideoTrack.d.ts.map +1 -1
- package/lib/middlewares/visitors/visitInboundVideoTrack.js +16 -21
- package/lib/middlewares/visitors/visitOutboundAudioTrack.d.ts.map +1 -1
- package/lib/middlewares/visitors/visitOutboundAudioTrack.js +16 -16
- package/lib/middlewares/visitors/visitOutboundVideoTarck.d.ts.map +1 -1
- package/lib/middlewares/visitors/visitOutboundVideoTarck.js +16 -17
- package/lib/middlewares/visitors/visitPeerConnection.d.ts.map +1 -1
- package/lib/middlewares/visitors/visitPeerConnection.js +24 -40
- package/lib/middlewares/visitors/visitSfu.d.ts.map +1 -1
- package/lib/middlewares/visitors/visitSfu.js +6 -7
- package/lib/middlewares/visitors/visitSfuInboundRtpPad.d.ts.map +1 -1
- package/lib/middlewares/visitors/visitSfuInboundRtpPad.js +3 -7
- package/lib/middlewares/visitors/visitSfuOutboundRtpPad.d.ts.map +1 -1
- package/lib/middlewares/visitors/visitSfuOutboundRtpPad.js +3 -8
- package/lib/middlewares/visitors/visitSfuSctpChannel.d.ts.map +1 -1
- package/lib/middlewares/visitors/visitSfuSctpChannel.js +3 -6
- package/lib/middlewares/visitors/visitSfuTransport.d.ts.map +1 -1
- package/lib/middlewares/visitors/visitSfuTransport.js +3 -6
- package/lib/processes/closePeerConnectionProcess.d.ts.map +1 -1
- package/lib/processes/closePeerConnectionProcess.js +14 -5
- package/lib/processes/detachClientProcess.d.ts.map +1 -1
- package/lib/processes/detachClientProcess.js +20 -17
- package/lib/processes/findRemoteMatches.d.ts +2 -2
- package/lib/processes/findRemoteMatches.d.ts.map +1 -1
- package/lib/processes/findRemoteMatches.js +70 -56
- package/lib/processes/inboundTrackRemoved.d.ts.map +1 -1
- package/lib/processes/inboundTrackRemoved.js +12 -3
- package/lib/processes/joinClientProcess.d.ts.map +1 -1
- package/lib/processes/joinClientProcess.js +15 -6
- package/lib/processes/outboundTrackRemoved.d.ts.map +1 -1
- package/lib/processes/outboundTrackRemoved.js +12 -3
- package/lib/samples/ObservedCall.d.ts.map +1 -1
- package/lib/samples/ObservedCall.js +1 -5
- package/lib/samples/ObservedCalls.d.ts.map +1 -1
- package/lib/samples/ObservedClient.d.ts.map +1 -1
- package/lib/samples/ObservedClient.js +1 -9
- package/lib/samples/ObservedInboundAudioTrack.d.ts.map +1 -1
- package/lib/samples/ObservedInboundAudioTrack.js +1 -5
- package/lib/samples/ObservedInboundVideoTrack.d.ts.map +1 -1
- package/lib/samples/ObservedInboundVideoTrack.js +1 -5
- package/lib/samples/ObservedOutboundAudioTrack.d.ts.map +1 -1
- package/lib/samples/ObservedOutboundAudioTrack.js +1 -5
- package/lib/samples/ObservedOutboundVideoTrack.d.ts.map +1 -1
- package/lib/samples/ObservedOutboundVideoTrack.js +1 -5
- package/lib/samples/ObservedPeerConnection.d.ts.map +1 -1
- package/lib/samples/ObservedPeerConnection.js +1 -12
- package/lib/samples/ObservedSfu.d.ts.map +1 -1
- package/lib/samples/ObservedSfu.js +1 -8
- package/lib/samples/ObservedSfuInboundRtpPad.d.ts.map +1 -1
- package/lib/samples/ObservedSfuInboundRtpPad.js +1 -5
- package/lib/samples/ObservedSfuOutboundRtpPad.d.ts.map +1 -1
- package/lib/samples/ObservedSfuOutboundRtpPad.js +1 -5
- package/lib/samples/ObservedSfuSctpChannel.d.ts.map +1 -1
- package/lib/samples/ObservedSfuSctpChannel.js +1 -5
- package/lib/samples/ObservedSfuTransport.d.ts.map +1 -1
- package/lib/samples/ObservedSfuTransport.js +1 -8
- package/lib/samples/ObservedSfus.d.ts.map +1 -1
- package/lib/sinks/ObserverSink.d.ts.map +1 -1
- package/lib/sinks/ObserverSink.js +42 -31
- package/lib/sinks/callEventReports.js +1 -0
- package/lib/sources/ObservedCallSource.d.ts +6 -3
- package/lib/sources/ObservedCallSource.d.ts.map +1 -1
- package/lib/sources/ObservedClientSource.d.ts +3 -2
- package/lib/sources/ObservedClientSource.d.ts.map +1 -1
- package/lib/sources/ObservedSfuSource.d.ts +3 -2
- package/lib/sources/ObservedSfuSource.d.ts.map +1 -1
- package/lib/sources/Sources.d.ts +8 -4
- package/lib/sources/Sources.d.ts.map +1 -1
- package/lib/sources/Sources.js +83 -46
- package/lib/storages/ObserverStorage.d.ts.map +1 -1
- package/lib/storages/SimpleStorage.d.ts.map +1 -1
- package/lib/storages/SimpleStorage.js +40 -23
- package/package.json +1 -1
- package/src/Evaluator.ts +17 -9
- package/src/Observer.ts +230 -170
- package/src/common/Semaphore.ts +2 -0
- package/src/common/callMetaReports.ts +30 -28
- package/src/common/logger.ts +140 -132
- package/src/common/types.ts +1 -1
- package/src/common/utils.ts +12 -1
- package/src/entries/CallEntry.ts +62 -0
- package/src/entries/ClientEntry.ts +90 -0
- package/src/entries/InboundTrackEntry.ts +74 -0
- package/src/entries/OutboundTrackEntry.ts +72 -0
- package/src/entries/PeerConnectionEntry.ts +133 -0
- package/src/entries/SfuEntry.ts +62 -0
- package/src/entries/SfuInboundRtpPadEntry.ts +46 -0
- package/src/entries/SfuOutboundRtpPadEntry.ts +44 -0
- package/src/entries/SfuSctpChannelEntry.ts +39 -0
- package/src/entries/SfuTransportEntry.ts +109 -0
- package/src/index.ts +11 -0
- package/src/middlewares/CallOperationsContext.ts +9 -5
- package/src/middlewares/CallProcessor.ts +4 -2
- package/src/middlewares/CommitTransactionMiddleware.ts +8 -5
- package/src/middlewares/DeleteOutdatedCallEntries.ts +24 -16
- package/src/middlewares/DeleteOutdatedSfuEntries.ts +24 -15
- package/src/middlewares/Middleware.ts +1 -0
- package/src/middlewares/Processor.ts +10 -5
- package/src/middlewares/TransactionContext.ts +1 -2
- package/src/middlewares/VisitObservedCallsMiddleware.ts +5 -2
- package/src/middlewares/VisitObservedSfusMiddleware.ts +8 -7
- package/src/middlewares/visitors/visitClient.ts +15 -1
- package/src/middlewares/visitors/visitInboundAudioTrack.ts +4 -1
- package/src/middlewares/visitors/visitInboundVideoTrack.ts +5 -1
- package/src/middlewares/visitors/visitOutboundAudioTrack.ts +5 -1
- package/src/middlewares/visitors/visitOutboundVideoTarck.ts +5 -1
- package/src/middlewares/visitors/visitPeerConnection.ts +15 -2
- package/src/middlewares/visitors/visitSfu.ts +7 -1
- package/src/middlewares/visitors/visitSfuInboundRtpPad.ts +4 -2
- package/src/middlewares/visitors/visitSfuOutboundRtpPad.ts +3 -1
- package/src/middlewares/visitors/visitSfuSctpChannel.ts +23 -21
- package/src/middlewares/visitors/visitSfuTransport.ts +3 -1
- package/src/processes/closePeerConnectionProcess.ts +3 -0
- package/src/processes/detachClientProcess.ts +13 -4
- package/src/processes/findRemoteMatches.ts +32 -21
- package/src/processes/inboundTrackRemoved.ts +2 -0
- package/src/processes/joinClientProcess.ts +8 -2
- package/src/processes/outboundTrackRemoved.ts +2 -0
- package/src/samples/ObservedCall.ts +6 -0
- package/src/samples/ObservedCalls.ts +13 -7
- package/src/samples/ObservedClient.ts +24 -8
- package/src/samples/ObservedInboundAudioTrack.ts +3 -2
- package/src/samples/ObservedInboundVideoTrack.ts +3 -2
- package/src/samples/ObservedOutboundAudioTrack.ts +3 -2
- package/src/samples/ObservedOutboundVideoTrack.ts +3 -2
- package/src/samples/ObservedPeerConnection.ts +27 -11
- package/src/samples/ObservedSfu.ts +17 -10
- package/src/samples/ObservedSfuInboundRtpPad.ts +5 -4
- package/src/samples/ObservedSfuOutboundRtpPad.ts +5 -4
- package/src/samples/ObservedSfuSctpChannel.ts +13 -13
- package/src/samples/ObservedSfuTransport.ts +19 -7
- package/src/samples/ObservedSfus.ts +10 -5
- package/src/sinks/ObserverSink.ts +51 -44
- package/src/sinks/callEventReports.ts +1 -1
- package/src/sources/ObservedCallSource.ts +9 -6
- package/src/sources/ObservedClientSource.ts +3 -2
- package/src/sources/ObservedSfuSource.ts +4 -8
- package/src/sources/Sources.ts +107 -22
- package/src/storages/ObserverStorage.ts +1 -0
- package/src/storages/SimpleStorage.ts +44 -21
- package/tsconfig.json +7 -5
- package/.eslintrc.js +0 -27
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
/* eslint-disable camelcase */
|
|
1
2
|
import { ObservedPeerConnection } from '../../samples/ObservedPeerConnection';
|
|
2
3
|
import * as Models from '../../models/Models';
|
|
3
4
|
import { ReportsCollector } from '../../common/ReportsCollector';
|
|
4
5
|
import { logger } from '../VisitObservedCallsMiddleware';
|
|
5
6
|
import { IceCandidatePairReport, PeerConnectionTransportReport } from '@observertc/report-schemas-js';
|
|
6
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
Samples_ClientSample_IceCandidatePair,
|
|
9
|
+
Samples_ClientSample_IceLocalCandidate,
|
|
10
|
+
Samples_ClientSample_IceRemoteCandidate,
|
|
11
|
+
Samples_ClientSample_PeerConnectionTransport
|
|
12
|
+
} from '../../models/samples_pb';
|
|
7
13
|
|
|
8
14
|
export function visitPeerConnection(
|
|
9
15
|
observedPeerConnection: ObservedPeerConnection,
|
|
@@ -19,6 +25,7 @@ export function visitPeerConnection(
|
|
|
19
25
|
const { serviceId, roomId, callId } = observedPeerConnection.client.call;
|
|
20
26
|
|
|
21
27
|
let storedPeerConnection = storedPeerConnections.get(peerConnectionId);
|
|
28
|
+
|
|
22
29
|
if (!storedPeerConnection) {
|
|
23
30
|
storedPeerConnection = new Models.PeerConnection({
|
|
24
31
|
serviceId,
|
|
@@ -37,7 +44,7 @@ export function visitPeerConnection(
|
|
|
37
44
|
if (!storedClient.peerConnectionIds.find((pcId) => pcId === peerConnectionId)) {
|
|
38
45
|
storedClient.peerConnectionIds.push(peerConnectionId);
|
|
39
46
|
} else {
|
|
40
|
-
logger.warn(
|
|
47
|
+
logger.warn('');
|
|
41
48
|
}
|
|
42
49
|
}
|
|
43
50
|
|
|
@@ -53,6 +60,7 @@ export function visitPeerConnection(
|
|
|
53
60
|
timestamp,
|
|
54
61
|
sampleSeq: -1, // deprecated
|
|
55
62
|
};
|
|
63
|
+
|
|
56
64
|
reports.addPeerConnectionTransportReports(report);
|
|
57
65
|
}
|
|
58
66
|
|
|
@@ -68,6 +76,7 @@ export function visitPeerConnection(
|
|
|
68
76
|
timestamp,
|
|
69
77
|
sampleSeq: -1, // deprecated
|
|
70
78
|
};
|
|
79
|
+
|
|
71
80
|
reports.addIceCandidatePairReport(report);
|
|
72
81
|
}
|
|
73
82
|
|
|
@@ -78,6 +87,7 @@ export function visitPeerConnection(
|
|
|
78
87
|
priority,
|
|
79
88
|
...sample
|
|
80
89
|
} = iceLocalCandidate;
|
|
90
|
+
|
|
81
91
|
storedPeerConnection.icelocalCandidates.push(new Samples_ClientSample_IceLocalCandidate({
|
|
82
92
|
...sample,
|
|
83
93
|
priority: BigInt(priority ?? -1)
|
|
@@ -90,6 +100,7 @@ export function visitPeerConnection(
|
|
|
90
100
|
priority,
|
|
91
101
|
...sample
|
|
92
102
|
} = iceRemoteCandidate;
|
|
103
|
+
|
|
93
104
|
storedPeerConnection.iceRemoteCandidates.push(new Samples_ClientSample_IceRemoteCandidate({
|
|
94
105
|
...sample,
|
|
95
106
|
priority: BigInt(priority ?? -1)
|
|
@@ -106,6 +117,7 @@ export function visitPeerConnection(
|
|
|
106
117
|
lastPacketSentTimestamp,
|
|
107
118
|
...sample
|
|
108
119
|
} = iceCandidatePair;
|
|
120
|
+
|
|
109
121
|
storedPeerConnection.iceCandidatePairs.push(new Samples_ClientSample_IceCandidatePair({
|
|
110
122
|
...sample,
|
|
111
123
|
bytesDiscardedOnSend: BigInt(bytesDiscardedOnSend ?? -1),
|
|
@@ -123,6 +135,7 @@ export function visitPeerConnection(
|
|
|
123
135
|
bytesSent,
|
|
124
136
|
...sample
|
|
125
137
|
} = pcTransport;
|
|
138
|
+
|
|
126
139
|
storedPeerConnection.transports.push(new Samples_ClientSample_PeerConnectionTransport({
|
|
127
140
|
...sample,
|
|
128
141
|
bytesReceived: BigInt(bytesReceived ?? -1),
|
|
@@ -10,8 +10,10 @@ export function visitSfu(
|
|
|
10
10
|
) {
|
|
11
11
|
const { mediaUnitId, serviceId, sfuId, timeZoneId, marker } = observedSfu;
|
|
12
12
|
let storedSfu = storedSfus.get(sfuId);
|
|
13
|
+
|
|
13
14
|
if (!storedSfu) {
|
|
14
15
|
const timestamp = Date.now();
|
|
16
|
+
|
|
15
17
|
storedSfu = new Models.Sfu({
|
|
16
18
|
serviceId,
|
|
17
19
|
sfuId,
|
|
@@ -26,7 +28,7 @@ export function visitSfu(
|
|
|
26
28
|
reports.addSfuEventReport({
|
|
27
29
|
serviceId,
|
|
28
30
|
mediaUnitId,
|
|
29
|
-
name:
|
|
31
|
+
name: 'SFU_JOINED',
|
|
30
32
|
sfuId,
|
|
31
33
|
timestamp,
|
|
32
34
|
marker,
|
|
@@ -60,5 +62,9 @@ export function visitSfu(
|
|
|
60
62
|
});
|
|
61
63
|
}
|
|
62
64
|
}
|
|
65
|
+
|
|
66
|
+
if (fetchSamples) {
|
|
67
|
+
// empty
|
|
68
|
+
}
|
|
63
69
|
}
|
|
64
70
|
}
|
|
@@ -14,10 +14,10 @@ export function visitSfuInboundRtpPad(
|
|
|
14
14
|
|
|
15
15
|
const { transportId: sfuTransportId } = observedSfuInboundRtpPad.sfuTransport;
|
|
16
16
|
|
|
17
|
-
const { serviceId, sfuId, mediaUnitId,
|
|
18
|
-
|
|
17
|
+
const { serviceId, sfuId, mediaUnitId, marker, minTimestamp: timestamp } = observedSfuInboundRtpPad.sfuTransport.sfu;
|
|
19
18
|
|
|
20
19
|
let storedSfuInboundRtpPad = storedSfuInboundRtpPads.get(rtpPadId);
|
|
20
|
+
|
|
21
21
|
if (!storedSfuInboundRtpPad) {
|
|
22
22
|
storedSfuInboundRtpPad = new Models.SfuInboundRtpPad({
|
|
23
23
|
serviceId,
|
|
@@ -42,9 +42,11 @@ export function visitSfuInboundRtpPad(
|
|
|
42
42
|
sfuStreamId: sfuInboundRtpPad.streamId,
|
|
43
43
|
timestamp,
|
|
44
44
|
};
|
|
45
|
+
|
|
45
46
|
reports.addSfuTransportReport(report);
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
if (fetchSamples) {
|
|
50
|
+
// empty
|
|
49
51
|
}
|
|
50
52
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as Models from '../../models/Models';
|
|
2
2
|
import { ReportsCollector } from '../../common/ReportsCollector';
|
|
3
3
|
import { SfuOutboundRtpPadReport } from '@observertc/report-schemas-js';
|
|
4
|
-
import { ObservedSfuTransport } from '../../samples/ObservedSfuTransport';
|
|
5
4
|
import { ObservedSfuOutboundRtpPad } from '../../samples/ObservedSfuOutboundRtpPad';
|
|
6
5
|
|
|
7
6
|
export function visitSfuOutboundRtpPad(
|
|
@@ -18,6 +17,7 @@ export function visitSfuOutboundRtpPad(
|
|
|
18
17
|
const { serviceId, sfuId, mediaUnitId, marker, minTimestamp: timestamp } = observedSfuOutboundRtpPad.sfuTransport.sfu;
|
|
19
18
|
|
|
20
19
|
let storedSfuOutboundRtpPad = storedSfuOutboundRtpPads.get(rtpPadId);
|
|
20
|
+
|
|
21
21
|
if (!storedSfuOutboundRtpPad) {
|
|
22
22
|
storedSfuOutboundRtpPad = new Models.SfuOutboundRtpPad({
|
|
23
23
|
serviceId,
|
|
@@ -43,9 +43,11 @@ export function visitSfuOutboundRtpPad(
|
|
|
43
43
|
sfuSinkId: sfuOutboundRtpPad.sinkId,
|
|
44
44
|
timestamp,
|
|
45
45
|
};
|
|
46
|
+
|
|
46
47
|
reports.addSfuTransportReport(report);
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
if (fetchSamples) {
|
|
51
|
+
// empty
|
|
50
52
|
}
|
|
51
53
|
}
|
|
@@ -9,7 +9,7 @@ export function visitSfuSctpChannel(
|
|
|
9
9
|
storedSfuSctpChannels: Map<string, Models.SfuSctpChannel>,
|
|
10
10
|
reports: ReportsCollector,
|
|
11
11
|
fetchSamples: boolean
|
|
12
|
-
|
|
12
|
+
) {
|
|
13
13
|
const { channelId } = observedSfuSctpChannel;
|
|
14
14
|
|
|
15
15
|
const { transportId: sfuTransportId } = observedSfuSctpChannel.sfuTransport;
|
|
@@ -17,32 +17,34 @@ export function visitSfuSctpChannel(
|
|
|
17
17
|
const { serviceId, sfuId, mediaUnitId, marker, minTimestamp: timestamp } = observedSfuSctpChannel.sfuTransport.sfu;
|
|
18
18
|
|
|
19
19
|
let storedSfuSctpChannel = storedSfuSctpChannels.get(channelId);
|
|
20
|
+
|
|
20
21
|
if (!storedSfuSctpChannel) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
storedSfuSctpChannel = new Models.SfuSctpChannel({
|
|
23
|
+
serviceId,
|
|
24
|
+
sfuId,
|
|
25
|
+
mediaUnitId,
|
|
26
|
+
sfuTransportId,
|
|
27
|
+
opened: BigInt(Date.now()),
|
|
28
|
+
marker,
|
|
29
|
+
});
|
|
30
|
+
storedSfuSctpChannels.set(channelId, storedSfuSctpChannel);
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
storedSfuTransport.sctpChannelIds.push(channelId);
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
for (const sfuSctpChannel of observedSfuSctpChannel.samples()) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
const report: SfuSctpStreamReport = {
|
|
37
|
+
serviceId,
|
|
38
|
+
sfuId,
|
|
39
|
+
mediaUnitId,
|
|
40
|
+
...sfuSctpChannel,
|
|
41
|
+
timestamp,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
reports.addSfuTransportReport(report);
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
if (fetchSamples) {
|
|
48
|
+
// empty
|
|
46
49
|
}
|
|
47
|
-
|
|
48
|
-
|
|
50
|
+
}
|
|
@@ -14,8 +14,8 @@ export function visitSfuTransport(
|
|
|
14
14
|
|
|
15
15
|
const { serviceId, sfuId, mediaUnitId, marker, minTimestamp: timestamp } = observedSfuTransport.sfu;
|
|
16
16
|
|
|
17
|
-
|
|
18
17
|
let storedSfuTransport = storedSfuTransports.get(transportId);
|
|
18
|
+
|
|
19
19
|
if (!storedSfuTransport) {
|
|
20
20
|
storedSfuTransport = new Models.SfuTransport({
|
|
21
21
|
serviceId,
|
|
@@ -40,9 +40,11 @@ export function visitSfuTransport(
|
|
|
40
40
|
...sfuTransport,
|
|
41
41
|
timestamp,
|
|
42
42
|
};
|
|
43
|
+
|
|
43
44
|
reports.addSfuTransportReport(report);
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
if (fetchSamples) {
|
|
48
|
+
// empty
|
|
47
49
|
}
|
|
48
50
|
}
|
|
@@ -20,6 +20,7 @@ export function createClosePeerConnectionProcess(
|
|
|
20
20
|
const { peerConnectionStorage } = storageProvider;
|
|
21
21
|
const peerConnectionIds = closedPeerConnections.map((c) => c.peerConnectionId);
|
|
22
22
|
const peerConnections = await peerConnectionStorage.getAll(peerConnectionIds);
|
|
23
|
+
|
|
23
24
|
await peerConnectionStorage.removeAll(peerConnectionIds);
|
|
24
25
|
|
|
25
26
|
if (recursive) {
|
|
@@ -37,6 +38,7 @@ export function createClosePeerConnectionProcess(
|
|
|
37
38
|
trackId,
|
|
38
39
|
};
|
|
39
40
|
});
|
|
41
|
+
|
|
40
42
|
await Promise.all([
|
|
41
43
|
removeInboundTracks({
|
|
42
44
|
removedTracks: inboundTrackIds,
|
|
@@ -47,5 +49,6 @@ export function createClosePeerConnectionProcess(
|
|
|
47
49
|
]);
|
|
48
50
|
}
|
|
49
51
|
};
|
|
52
|
+
|
|
50
53
|
return process;
|
|
51
54
|
}
|
|
@@ -7,7 +7,6 @@ import { createClosePeerConnectionProcess, ClosePeerConnectionProcessInput } fro
|
|
|
7
7
|
import { createLogger } from '../common/logger';
|
|
8
8
|
import { ObservedClientSourceConfig } from '../sources/ObservedClientSource';
|
|
9
9
|
import { Writable } from '../common/utils';
|
|
10
|
-
import { Semaphore } from '../common/Semaphore';
|
|
11
10
|
|
|
12
11
|
const logger = createLogger('ClientLeftProcess');
|
|
13
12
|
|
|
@@ -38,10 +37,11 @@ export function createDetachClientProcess(
|
|
|
38
37
|
|
|
39
38
|
for (const client of clients.values()) {
|
|
40
39
|
const { callId, clientId } = client;
|
|
40
|
+
|
|
41
41
|
if (!callId || !clientId) {
|
|
42
42
|
continue;
|
|
43
43
|
}
|
|
44
|
-
callToClientIds.set(callId, [...(callToClientIds.get(callId) ?? []), clientId]);
|
|
44
|
+
callToClientIds.set(callId, [ ...(callToClientIds.get(callId) ?? []), clientId ]);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
const peerConnectionCloseProcessInput: ClosePeerConnectionProcessInput = {
|
|
@@ -49,16 +49,19 @@ export function createDetachClientProcess(
|
|
|
49
49
|
recursive,
|
|
50
50
|
};
|
|
51
51
|
const callDetaches = new Map<string, number>();
|
|
52
|
+
|
|
52
53
|
await clientStorage.removeAll(clientIds).then((deletedClientIds) => {
|
|
53
54
|
for (const { clientId, detached } of detachedClients) {
|
|
54
55
|
if (!deletedClientIds.has(clientId)) {
|
|
55
56
|
continue;
|
|
56
57
|
}
|
|
57
58
|
const deletedClient = clients.get(clientId);
|
|
59
|
+
|
|
58
60
|
if (!deletedClient) {
|
|
59
61
|
continue;
|
|
60
62
|
}
|
|
61
63
|
const { roomId, serviceId, mediaUnitId, marker, callId, userId } = deletedClient;
|
|
64
|
+
|
|
62
65
|
if (!roomId || !serviceId || !mediaUnitId || !callId) {
|
|
63
66
|
continue;
|
|
64
67
|
}
|
|
@@ -83,18 +86,21 @@ export function createDetachClientProcess(
|
|
|
83
86
|
});
|
|
84
87
|
if (recursive && 0 < peerConnectionCloseProcessInput.closedPeerConnections.length) {
|
|
85
88
|
await peerConnectionClosedProcess(peerConnectionCloseProcessInput).catch((err) => {
|
|
86
|
-
logger.error(
|
|
89
|
+
logger.error('Error occurred while closing peer connections', err);
|
|
87
90
|
});
|
|
88
91
|
}
|
|
89
92
|
|
|
90
93
|
const calls = await callStorage.getAll(callToClientIds.keys());
|
|
91
94
|
const updatedCalls = new Map<string, Models.Call>();
|
|
92
95
|
const removedCallIds: string[] = [];
|
|
96
|
+
|
|
93
97
|
for (const call of calls.values()) {
|
|
94
98
|
const { callId, serviceId, roomId } = call;
|
|
99
|
+
|
|
95
100
|
if (!callId || !roomId || !serviceId) continue;
|
|
96
101
|
|
|
97
102
|
const removedClientIds = callToClientIds.get(callId) ?? [];
|
|
103
|
+
|
|
98
104
|
call.clientIds = call.clientIds.filter((clientId) => !removedClientIds.includes(clientId));
|
|
99
105
|
if (call.clientIds.length < 1) {
|
|
100
106
|
removedCallIds.push(callId);
|
|
@@ -107,12 +113,14 @@ export function createDetachClientProcess(
|
|
|
107
113
|
}
|
|
108
114
|
if (0 < removedCallIds.length) {
|
|
109
115
|
await callStorage.removeAll(removedCallIds).then((deletedCalls) => {
|
|
110
|
-
for (const [callId, deletedCall] of deletedCalls) {
|
|
116
|
+
for (const [ callId, deletedCall ] of deletedCalls) {
|
|
111
117
|
const { serviceId, roomId } = deletedCall;
|
|
118
|
+
|
|
112
119
|
if (!serviceId || !roomId || !callId) continue;
|
|
113
120
|
|
|
114
121
|
const ended = callDetaches.get(callId) ?? Date.now();
|
|
115
122
|
const callEvent = createCallEndedEventReport(serviceId, roomId, callId, ended);
|
|
123
|
+
|
|
116
124
|
reports.addCallEventReport(callEvent);
|
|
117
125
|
|
|
118
126
|
evaluatorContext?.endedCalls.push({
|
|
@@ -123,5 +131,6 @@ export function createDetachClientProcess(
|
|
|
123
131
|
});
|
|
124
132
|
}
|
|
125
133
|
};
|
|
134
|
+
|
|
126
135
|
return process;
|
|
127
136
|
}
|
|
@@ -1,45 +1,51 @@
|
|
|
1
|
-
import { createLogger } from
|
|
2
|
-
import { Client, InboundTrack, OutboundTrack, PeerConnection } from
|
|
3
|
-
import { StorageProvider } from
|
|
1
|
+
import { createLogger } from '../common/logger';
|
|
2
|
+
import { Client, InboundTrack, OutboundTrack, PeerConnection } from '../models/Models';
|
|
3
|
+
import { StorageProvider } from '../storages/StorageProvider';
|
|
4
4
|
|
|
5
5
|
export const logger = createLogger('findRemoteMatches');
|
|
6
6
|
|
|
7
7
|
function groupToMap<T>(input: ReadonlyMap<string, T>, getGroupKey: (value: T) => string | undefined) {
|
|
8
8
|
const result = new Map<string, T[]>();
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11
|
+
for (const [ key, value ] of input.entries()) {
|
|
10
12
|
const groupKey = getGroupKey(value);
|
|
13
|
+
|
|
11
14
|
if (!groupKey) continue;
|
|
12
15
|
|
|
13
|
-
|
|
16
|
+
let group = result.get(groupKey);
|
|
17
|
+
|
|
14
18
|
if (group === undefined) {
|
|
15
19
|
group = [];
|
|
16
20
|
result.set(groupKey, group);
|
|
17
21
|
}
|
|
18
|
-
|
|
22
|
+
group.push(value);
|
|
19
23
|
}
|
|
24
|
+
|
|
20
25
|
return result;
|
|
21
26
|
}
|
|
22
27
|
|
|
23
|
-
|
|
24
28
|
export async function findRemoteMatches(
|
|
25
29
|
storages: StorageProvider,
|
|
26
30
|
clients: ReadonlyMap<string, Client>,
|
|
27
31
|
inboundTracks: ReadonlyMap<string, InboundTrack>,
|
|
28
32
|
) {
|
|
29
|
-
const NOT_EXISTS =
|
|
33
|
+
const NOT_EXISTS = 'NotExists';
|
|
30
34
|
const remoteTrackIds = new Map<string, string>();
|
|
31
35
|
const remotePeerConnectionIds = new Map<string, string>();
|
|
32
36
|
const remoteClientIds = new Map<string, string>();
|
|
33
37
|
|
|
34
38
|
async function setupMatches(callId: string, callClients: Client[], callIboundTracks: InboundTrack[]) {
|
|
35
|
-
const peerConnectionIds = Array.from(callClients.values()).flatMap(client => client.peerConnectionIds);
|
|
36
|
-
const peerConnections = await storages.peerConnectionStorage.getAll(peerConnectionIds).catch(err => {
|
|
37
|
-
logger.warn(`Error while fetching for remote matching peer connections for call ${callId} `, err)
|
|
39
|
+
const peerConnectionIds = Array.from(callClients.values()).flatMap((client) => client.peerConnectionIds);
|
|
40
|
+
const peerConnections = await storages.peerConnectionStorage.getAll(peerConnectionIds).catch((err) => {
|
|
41
|
+
logger.warn(`Error while fetching for remote matching peer connections for call ${callId} `, err);
|
|
42
|
+
|
|
38
43
|
return new Map<string, PeerConnection>() as ReadonlyMap<string, PeerConnection>;
|
|
39
44
|
});
|
|
40
|
-
const outboundTrackIds = Array.from(peerConnections.values()).flatMap(pc => pc.outboundTrackIds);
|
|
41
|
-
const outboundTracks = await storages.outboundTrackStorage.getAll(outboundTrackIds).catch(err => {
|
|
42
|
-
logger.warn(`Error while fetching for remote matching outbound tracks for call ${callId} `, err)
|
|
45
|
+
const outboundTrackIds = Array.from(peerConnections.values()).flatMap((pc) => pc.outboundTrackIds);
|
|
46
|
+
const outboundTracks = await storages.outboundTrackStorage.getAll(outboundTrackIds).catch((err) => {
|
|
47
|
+
logger.warn(`Error while fetching for remote matching outbound tracks for call ${callId} `, err);
|
|
48
|
+
|
|
43
49
|
return new Map<string, OutboundTrack>() as ReadonlyMap<string, OutboundTrack>;
|
|
44
50
|
});
|
|
45
51
|
|
|
@@ -47,6 +53,7 @@ export async function findRemoteMatches(
|
|
|
47
53
|
|
|
48
54
|
const ssrcToOutb = new Map<bigint, OutboundTrack>();
|
|
49
55
|
const sfuStreamToTrackIds = new Map<string, OutboundTrack>();
|
|
56
|
+
|
|
50
57
|
for (const outbTrack of outboundTracks.values()) {
|
|
51
58
|
if (outbTrack.sfuStreamId) {
|
|
52
59
|
sfuStreamToTrackIds.set(outbTrack.sfuStreamId, outbTrack);
|
|
@@ -57,10 +64,11 @@ export async function findRemoteMatches(
|
|
|
57
64
|
}
|
|
58
65
|
for (const inbTrack of callIboundTracks) {
|
|
59
66
|
let outbTrack: OutboundTrack | undefined;
|
|
67
|
+
|
|
60
68
|
if (inbTrack.sfuStreamId) {
|
|
61
69
|
outbTrack = sfuStreamToTrackIds.get(inbTrack.sfuStreamId);
|
|
62
70
|
} else {
|
|
63
|
-
outbTrack = inbTrack.ssrc.map(ssrc => ssrcToOutb.get(ssrc)).find(outb => outb !== undefined);
|
|
71
|
+
outbTrack = inbTrack.ssrc.map((ssrc) => ssrcToOutb.get(ssrc)).find((outb) => outb !== undefined);
|
|
64
72
|
}
|
|
65
73
|
if (outbTrack) {
|
|
66
74
|
remoteTrackIds.set(inbTrack.trackId ?? NOT_EXISTS, outbTrack.trackId ?? NOT_EXISTS);
|
|
@@ -69,25 +77,28 @@ export async function findRemoteMatches(
|
|
|
69
77
|
}
|
|
70
78
|
}
|
|
71
79
|
}
|
|
72
|
-
const callsClients = groupToMap<Client>(clients, client => client.callId);
|
|
73
|
-
const callsInbTracks = groupToMap<InboundTrack>(inboundTracks, inbTrack => inbTrack.callId)
|
|
80
|
+
const callsClients = groupToMap<Client>(clients, (client) => client.callId);
|
|
81
|
+
const callsInbTracks = groupToMap<InboundTrack>(inboundTracks, (inbTrack) => inbTrack.callId);
|
|
74
82
|
|
|
75
83
|
const promises: Promise<void>[] = [];
|
|
76
|
-
|
|
84
|
+
|
|
85
|
+
for (const [ callId, callClients ] of callsClients) {
|
|
77
86
|
const callIboundTracks = callsInbTracks.get(callId) ?? [];
|
|
78
87
|
const promise = setupMatches(
|
|
79
88
|
callId,
|
|
80
89
|
callClients,
|
|
81
90
|
callIboundTracks
|
|
82
91
|
);
|
|
92
|
+
|
|
83
93
|
promises.push(promise);
|
|
84
94
|
}
|
|
85
|
-
await Promise.all(promises).catch(err => {
|
|
86
|
-
logger.warn(
|
|
95
|
+
await Promise.all(promises).catch((err) => {
|
|
96
|
+
logger.warn('Error occurred while fetching remote pair matches', err);
|
|
87
97
|
});
|
|
98
|
+
|
|
88
99
|
return {
|
|
89
100
|
remoteTrackIds,
|
|
90
101
|
remotePeerConnectionIds,
|
|
91
102
|
remoteClientIds
|
|
92
|
-
}
|
|
103
|
+
};
|
|
93
104
|
}
|
|
@@ -14,7 +14,9 @@ export function createInboundTrackRemoveProcess(
|
|
|
14
14
|
const { removedTracks } = input;
|
|
15
15
|
const { inboundTrackStorage } = storageProvider;
|
|
16
16
|
const inboundTrackIds = removedTracks.map((c) => c.trackId);
|
|
17
|
+
|
|
17
18
|
await inboundTrackStorage.removeAll(inboundTrackIds);
|
|
18
19
|
};
|
|
20
|
+
|
|
19
21
|
return process;
|
|
20
22
|
}
|
|
@@ -21,6 +21,7 @@ export function createJoinClientProcess(
|
|
|
21
21
|
): (input: JoinClientProcessInput) => Promise<void> {
|
|
22
22
|
const process = async (context: JoinClientProcessInput) => {
|
|
23
23
|
const { clients: joinedClients, evaluatorContext } = context;
|
|
24
|
+
|
|
24
25
|
if (joinedClients.length < 1) {
|
|
25
26
|
return;
|
|
26
27
|
}
|
|
@@ -30,10 +31,12 @@ export function createJoinClientProcess(
|
|
|
30
31
|
const existingCalls = await callStorage.getAll(callIds);
|
|
31
32
|
const newCalls = new Map<string, Models.Call>();
|
|
32
33
|
const newClients = new Map<string, Models.Client>();
|
|
34
|
+
|
|
33
35
|
for (const joinedClient of joinedClients) {
|
|
34
36
|
const { serviceId, mediaUnitId, roomId, callId, clientId, joined: timestamp, timeZoneId, marker } = joinedClient;
|
|
35
37
|
|
|
36
38
|
let call = existingCalls.get(callId);
|
|
39
|
+
|
|
37
40
|
if (!call) {
|
|
38
41
|
call = new Models.Call({
|
|
39
42
|
serviceId,
|
|
@@ -71,7 +74,7 @@ export function createJoinClientProcess(
|
|
|
71
74
|
const alreadyInsertedCalls =
|
|
72
75
|
0 < newCalls.size ? await callStorage.insertAll(newCalls) : new Map<string, Models.Call>();
|
|
73
76
|
|
|
74
|
-
for (const [callId, newCall] of newCalls) {
|
|
77
|
+
for (const [ callId, newCall ] of newCalls) {
|
|
75
78
|
if (alreadyInsertedCalls.has(callId)) {
|
|
76
79
|
continue;
|
|
77
80
|
}
|
|
@@ -82,6 +85,7 @@ export function createJoinClientProcess(
|
|
|
82
85
|
}
|
|
83
86
|
|
|
84
87
|
const callEvent = createCallStartedEventReport(serviceId, roomId, callId, Number(started));
|
|
88
|
+
|
|
85
89
|
reports.addCallEventReport(callEvent);
|
|
86
90
|
evaluatorContext?.startedCallIds.push(callId);
|
|
87
91
|
}
|
|
@@ -93,7 +97,7 @@ export function createJoinClientProcess(
|
|
|
93
97
|
if (0 < newClients.size) {
|
|
94
98
|
await clientStorage.setAll(newClients);
|
|
95
99
|
}
|
|
96
|
-
for (const [clientId, client] of newClients) {
|
|
100
|
+
for (const [ clientId, client ] of newClients) {
|
|
97
101
|
const {
|
|
98
102
|
serviceId,
|
|
99
103
|
mediaUnitId,
|
|
@@ -120,9 +124,11 @@ export function createJoinClientProcess(
|
|
|
120
124
|
userId,
|
|
121
125
|
marker
|
|
122
126
|
);
|
|
127
|
+
|
|
123
128
|
reports.addCallEventReport(callEvent);
|
|
124
129
|
evaluatorContext?.joinedClientIds.push(clientId);
|
|
125
130
|
}
|
|
126
131
|
};
|
|
132
|
+
|
|
127
133
|
return process;
|
|
128
134
|
}
|
|
@@ -14,7 +14,9 @@ export function createOutboundTrackRemoveProcess(
|
|
|
14
14
|
const { removedTracks } = input;
|
|
15
15
|
const { outboundTrackStorage } = storageProvider;
|
|
16
16
|
const outboundTrackIds = removedTracks.map((c) => c.trackId);
|
|
17
|
+
|
|
17
18
|
await outboundTrackStorage.removeAll(outboundTrackIds);
|
|
18
19
|
};
|
|
20
|
+
|
|
19
21
|
return process;
|
|
20
22
|
}
|
|
@@ -17,11 +17,14 @@ export class ObservedCallBuilder {
|
|
|
17
17
|
configSupplier: () => ConstructorParameters<typeof ObservedClientBuilder>[0]
|
|
18
18
|
) {
|
|
19
19
|
let result = this._observedClientBuilders.get(clientId);
|
|
20
|
+
|
|
20
21
|
if (!result) {
|
|
21
22
|
const config = configSupplier();
|
|
23
|
+
|
|
22
24
|
result = new ObservedClientBuilder(config);
|
|
23
25
|
this._observedClientBuilders.set(clientId, result);
|
|
24
26
|
}
|
|
27
|
+
|
|
25
28
|
return result;
|
|
26
29
|
}
|
|
27
30
|
|
|
@@ -33,10 +36,13 @@ export class ObservedCallBuilder {
|
|
|
33
36
|
observedClients: () => observedClients.values(),
|
|
34
37
|
getObservedClient: (clientId) => observedClients.get(clientId),
|
|
35
38
|
};
|
|
39
|
+
|
|
36
40
|
for (const observedClientBuilder of this._observedClientBuilders.values()) {
|
|
37
41
|
const observedClient = observedClientBuilder.build(observedCall);
|
|
42
|
+
|
|
38
43
|
observedClients.set(observedClient.clientId, observedClient);
|
|
39
44
|
}
|
|
45
|
+
|
|
40
46
|
return observedCall;
|
|
41
47
|
}
|
|
42
48
|
}
|
|
@@ -25,25 +25,28 @@ export class ObservedCallsBuilder {
|
|
|
25
25
|
configSupplier: () => ConstructorParameters<typeof ObservedCallBuilder>[0]
|
|
26
26
|
) {
|
|
27
27
|
let result = this._builders.get(callId);
|
|
28
|
+
|
|
28
29
|
if (!result) {
|
|
29
30
|
const config = configSupplier();
|
|
31
|
+
|
|
30
32
|
result = new ObservedCallBuilder(config);
|
|
31
33
|
this._builders.set(callId, result);
|
|
32
34
|
}
|
|
35
|
+
|
|
33
36
|
return result;
|
|
34
37
|
}
|
|
35
38
|
|
|
36
39
|
public build(): ObservedCalls {
|
|
37
40
|
const observedCalls = new Map<string, ObservedCall>();
|
|
38
41
|
|
|
39
|
-
const callIdsGenerator = function*
|
|
42
|
+
const callIdsGenerator = function *() {
|
|
40
43
|
for (const observedCall of observedCalls.values()) {
|
|
41
44
|
yield observedCall.callId;
|
|
42
45
|
}
|
|
43
46
|
};
|
|
44
47
|
const callIds = () => iteratorConverter<string>(callIdsGenerator());
|
|
45
48
|
|
|
46
|
-
const clientIdsGenerator = function*
|
|
49
|
+
const clientIdsGenerator = function *() {
|
|
47
50
|
for (const observedCall of observedCalls.values()) {
|
|
48
51
|
for (const observedClient of observedCall.observedClients()) {
|
|
49
52
|
yield observedClient.clientId;
|
|
@@ -52,7 +55,7 @@ export class ObservedCallsBuilder {
|
|
|
52
55
|
};
|
|
53
56
|
const clientIds = () => iteratorConverter<string>(clientIdsGenerator());
|
|
54
57
|
|
|
55
|
-
const peerConnectionIdsGenerator = function*
|
|
58
|
+
const peerConnectionIdsGenerator = function *() {
|
|
56
59
|
for (const observedCall of observedCalls.values()) {
|
|
57
60
|
for (const observedClient of observedCall.observedClients()) {
|
|
58
61
|
for (const observedPeerConnection of observedClient.observedPeerConnections()) {
|
|
@@ -63,7 +66,7 @@ export class ObservedCallsBuilder {
|
|
|
63
66
|
};
|
|
64
67
|
const peerConnectionIds = () => iteratorConverter<string>(peerConnectionIdsGenerator());
|
|
65
68
|
|
|
66
|
-
const inboundAudioTrackIdsGenerator = function*
|
|
69
|
+
const inboundAudioTrackIdsGenerator = function *() {
|
|
67
70
|
for (const observedCall of observedCalls.values()) {
|
|
68
71
|
for (const observedClient of observedCall.observedClients()) {
|
|
69
72
|
for (const observedPeerConnection of observedClient.observedPeerConnections()) {
|
|
@@ -76,7 +79,7 @@ export class ObservedCallsBuilder {
|
|
|
76
79
|
};
|
|
77
80
|
const inboundAudioTrackIds = () => iteratorConverter<string>(inboundAudioTrackIdsGenerator());
|
|
78
81
|
|
|
79
|
-
const inboundVideoTrackIdsGenerator = function*
|
|
82
|
+
const inboundVideoTrackIdsGenerator = function *() {
|
|
80
83
|
for (const observedCall of observedCalls.values()) {
|
|
81
84
|
for (const observedClient of observedCall.observedClients()) {
|
|
82
85
|
for (const observedPeerConnection of observedClient.observedPeerConnections()) {
|
|
@@ -89,7 +92,7 @@ export class ObservedCallsBuilder {
|
|
|
89
92
|
};
|
|
90
93
|
const inboundVideoTrackIds = () => iteratorConverter<string>(inboundVideoTrackIdsGenerator());
|
|
91
94
|
|
|
92
|
-
const outboundAudioTrackIdsGenerator = function*
|
|
95
|
+
const outboundAudioTrackIdsGenerator = function *() {
|
|
93
96
|
for (const observedCall of observedCalls.values()) {
|
|
94
97
|
for (const observedClient of observedCall.observedClients()) {
|
|
95
98
|
for (const observedPeerConnection of observedClient.observedPeerConnections()) {
|
|
@@ -102,7 +105,7 @@ export class ObservedCallsBuilder {
|
|
|
102
105
|
};
|
|
103
106
|
const outboundAudioTrackIds = () => iteratorConverter<string>(outboundAudioTrackIdsGenerator());
|
|
104
107
|
|
|
105
|
-
const outboundVideoTrackIdsGenerator = function*
|
|
108
|
+
const outboundVideoTrackIdsGenerator = function *() {
|
|
106
109
|
for (const observedCall of observedCalls.values()) {
|
|
107
110
|
for (const observedClient of observedCall.observedClients()) {
|
|
108
111
|
for (const observedPeerConnection of observedClient.observedPeerConnections()) {
|
|
@@ -126,11 +129,14 @@ export class ObservedCallsBuilder {
|
|
|
126
129
|
observedCalls: () => observedCalls.values(),
|
|
127
130
|
getObservedCall: (callId) => observedCalls.get(callId),
|
|
128
131
|
};
|
|
132
|
+
|
|
129
133
|
for (const builder of this._builders.values()) {
|
|
130
134
|
const observedCall = builder.build();
|
|
135
|
+
|
|
131
136
|
observedCalls.set(observedCall.callId, observedCall);
|
|
132
137
|
}
|
|
133
138
|
this._builders.clear();
|
|
139
|
+
|
|
134
140
|
return result;
|
|
135
141
|
}
|
|
136
142
|
|