@voicenter-team/opensips-js 1.0.10
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +75 -0
- package/build/enum/call.event.listener.type.d.ts +7 -0
- package/build/enum/call.event.listener.type.js +10 -0
- package/build/enum/metric.keys.to.include.d.ts +2 -0
- package/build/enum/metric.keys.to.include.js +4 -0
- package/build/helpers/UA/index.d.ts +6 -0
- package/build/helpers/UA/index.js +9 -0
- package/build/helpers/audio.helper.d.ts +9 -0
- package/build/helpers/audio.helper.js +60 -0
- package/build/helpers/filter.helper.d.ts +2 -0
- package/build/helpers/filter.helper.js +14 -0
- package/build/helpers/time.helper.d.ts +16 -0
- package/build/helpers/time.helper.js +28 -0
- package/build/helpers/volume.helper.d.ts +2 -0
- package/build/helpers/volume.helper.js +76 -0
- package/build/helpers/webrtcmetrics/collector.d.ts +32 -0
- package/build/helpers/webrtcmetrics/collector.js +282 -0
- package/build/helpers/webrtcmetrics/engine.d.ts +20 -0
- package/build/helpers/webrtcmetrics/engine.js +164 -0
- package/build/helpers/webrtcmetrics/exporter.d.ts +116 -0
- package/build/helpers/webrtcmetrics/exporter.js +528 -0
- package/build/helpers/webrtcmetrics/extractor.d.ts +1 -0
- package/build/helpers/webrtcmetrics/extractor.js +976 -0
- package/build/helpers/webrtcmetrics/index.d.ts +63 -0
- package/build/helpers/webrtcmetrics/index.js +93 -0
- package/build/helpers/webrtcmetrics/metrics.d.ts +2 -0
- package/build/helpers/webrtcmetrics/metrics.js +8 -0
- package/build/helpers/webrtcmetrics/probe.d.ts +76 -0
- package/build/helpers/webrtcmetrics/probe.js +153 -0
- package/build/helpers/webrtcmetrics/utils/config.d.ts +12 -0
- package/build/helpers/webrtcmetrics/utils/config.js +28 -0
- package/build/helpers/webrtcmetrics/utils/helper.d.ts +13 -0
- package/build/helpers/webrtcmetrics/utils/helper.js +134 -0
- package/build/helpers/webrtcmetrics/utils/log.d.ts +7 -0
- package/build/helpers/webrtcmetrics/utils/log.js +71 -0
- package/build/helpers/webrtcmetrics/utils/models.d.ts +309 -0
- package/build/helpers/webrtcmetrics/utils/models.js +298 -0
- package/build/helpers/webrtcmetrics/utils/score.d.ts +4 -0
- package/build/helpers/webrtcmetrics/utils/score.js +235 -0
- package/build/helpers/webrtcmetrics/utils/shortUUId.d.ts +1 -0
- package/build/helpers/webrtcmetrics/utils/shortUUId.js +7 -0
- package/build/index.d.ts +170 -0
- package/build/index.js +849 -0
- package/package.json +61 -0
- package/src/types/declarations.d.ts +6 -0
- package/src/types/generic.d.ts +1 -0
- package/src/types/listeners.d.ts +42 -0
- package/src/types/rtc.d.ts +133 -0
- package/src/types/webrtcmetrics.d.ts +64 -0
@@ -0,0 +1,309 @@
|
|
1
|
+
export function getLibName(): string;
|
2
|
+
export function getVersion(): string;
|
3
|
+
export namespace DIRECTION {
|
4
|
+
const INBOUND: string;
|
5
|
+
const OUTBOUND: string;
|
6
|
+
}
|
7
|
+
export namespace COLLECTOR_STATE {
|
8
|
+
const IDLE: string;
|
9
|
+
const RUNNING: string;
|
10
|
+
const MUTED: string;
|
11
|
+
}
|
12
|
+
export namespace ENGINE_STATE {
|
13
|
+
const IDLE_1: string;
|
14
|
+
export { IDLE_1 as IDLE };
|
15
|
+
export const COLLECTING: string;
|
16
|
+
export const ENDED: string;
|
17
|
+
}
|
18
|
+
export namespace ICE_CONNECTION_STATE {
|
19
|
+
const NEW: string;
|
20
|
+
const CHECKING: string;
|
21
|
+
const CONNECTED: string;
|
22
|
+
const COMPLETED: string;
|
23
|
+
const DISCONNECTED: string;
|
24
|
+
const FAILED: string;
|
25
|
+
const CLOSED: string;
|
26
|
+
}
|
27
|
+
export namespace ICE_GATHERING_STATE {
|
28
|
+
const NEW_1: string;
|
29
|
+
export { NEW_1 as NEW };
|
30
|
+
export const GATHERING: string;
|
31
|
+
export const COMPLETE: string;
|
32
|
+
}
|
33
|
+
export function getDefaultGlobalMetric(): {
|
34
|
+
delta_time_to_measure_probes_ms: number;
|
35
|
+
delta_time_consumed_to_measure_ms: number;
|
36
|
+
delta_KBytes_in: number;
|
37
|
+
delta_KBytes_out: number;
|
38
|
+
delta_kbs_in: number;
|
39
|
+
delta_kbs_out: number;
|
40
|
+
total_time_decoded_in: number;
|
41
|
+
total_time_encoded_out: number;
|
42
|
+
probes: never[];
|
43
|
+
};
|
44
|
+
export namespace defaultAudioMetricIn {
|
45
|
+
export const level_in: number;
|
46
|
+
export const codec_id_in: string;
|
47
|
+
export namespace codec_in {
|
48
|
+
const mime_type: null;
|
49
|
+
const clock_rate: null;
|
50
|
+
const sdp_fmtp_line: null;
|
51
|
+
}
|
52
|
+
export const delta_jitter_ms_in: number;
|
53
|
+
export const percent_packets_lost_in: number;
|
54
|
+
export const delta_packets_in: number;
|
55
|
+
export const delta_packets_lost_in: number;
|
56
|
+
export const total_packets_in: number;
|
57
|
+
export const total_packets_lost_in: number;
|
58
|
+
export const total_KBytes_in: number;
|
59
|
+
export const delta_KBytes_in: number;
|
60
|
+
export const delta_kbs_in: number;
|
61
|
+
export const mos_in: number;
|
62
|
+
export const mos_emodel_in: number;
|
63
|
+
export const ssrc: string;
|
64
|
+
import direction = DIRECTION.INBOUND;
|
65
|
+
export { direction };
|
66
|
+
}
|
67
|
+
export namespace defaultAudioMetricOut {
|
68
|
+
export const level_out: number;
|
69
|
+
export const codec_id_out: string;
|
70
|
+
export namespace codec_out {
|
71
|
+
const mime_type_1: null;
|
72
|
+
export { mime_type_1 as mime_type };
|
73
|
+
const clock_rate_1: null;
|
74
|
+
export { clock_rate_1 as clock_rate };
|
75
|
+
const sdp_fmtp_line_1: null;
|
76
|
+
export { sdp_fmtp_line_1 as sdp_fmtp_line };
|
77
|
+
}
|
78
|
+
export const delta_jitter_ms_out: number;
|
79
|
+
export const delta_rtt_ms_out: null;
|
80
|
+
export const total_rtt_ms_out: number;
|
81
|
+
export const total_rtt_measure_out: number;
|
82
|
+
export const percent_packets_lost_out: number;
|
83
|
+
export const delta_packets_out: number;
|
84
|
+
export const delta_packets_lost_out: number;
|
85
|
+
export const total_packets_out: number;
|
86
|
+
export const total_packets_lost_out: number;
|
87
|
+
export const total_KBytes_out: number;
|
88
|
+
export const delta_KBytes_out: number;
|
89
|
+
export const delta_kbs_out: number;
|
90
|
+
export const timestamp_out: null;
|
91
|
+
export const mos_out: number;
|
92
|
+
export const mos_emodel_out: number;
|
93
|
+
const ssrc_1: string;
|
94
|
+
export { ssrc_1 as ssrc };
|
95
|
+
import direction_1 = DIRECTION.OUTBOUND;
|
96
|
+
export { direction_1 as direction };
|
97
|
+
}
|
98
|
+
export namespace defaultVideoMetricIn {
|
99
|
+
const codec_id_in_1: string;
|
100
|
+
export { codec_id_in_1 as codec_id_in };
|
101
|
+
export namespace size_in {
|
102
|
+
const width: null;
|
103
|
+
const height: null;
|
104
|
+
const framerate: null;
|
105
|
+
}
|
106
|
+
export namespace codec_in_1 {
|
107
|
+
const mime_type_2: null;
|
108
|
+
export { mime_type_2 as mime_type };
|
109
|
+
const clock_rate_2: null;
|
110
|
+
export { clock_rate_2 as clock_rate };
|
111
|
+
}
|
112
|
+
export { codec_in_1 as codec_in };
|
113
|
+
const delta_jitter_ms_in_1: number;
|
114
|
+
export { delta_jitter_ms_in_1 as delta_jitter_ms_in };
|
115
|
+
const percent_packets_lost_in_1: number;
|
116
|
+
export { percent_packets_lost_in_1 as percent_packets_lost_in };
|
117
|
+
const delta_packets_in_1: number;
|
118
|
+
export { delta_packets_in_1 as delta_packets_in };
|
119
|
+
const delta_packets_lost_in_1: number;
|
120
|
+
export { delta_packets_lost_in_1 as delta_packets_lost_in };
|
121
|
+
const total_packets_in_1: number;
|
122
|
+
export { total_packets_in_1 as total_packets_in };
|
123
|
+
const total_packets_lost_in_1: number;
|
124
|
+
export { total_packets_lost_in_1 as total_packets_lost_in };
|
125
|
+
const total_KBytes_in_1: number;
|
126
|
+
export { total_KBytes_in_1 as total_KBytes_in };
|
127
|
+
const delta_KBytes_in_1: number;
|
128
|
+
export { delta_KBytes_in_1 as delta_KBytes_in };
|
129
|
+
const delta_kbs_in_1: number;
|
130
|
+
export { delta_kbs_in_1 as delta_kbs_in };
|
131
|
+
export const decoder_in: null;
|
132
|
+
export const delta_ms_decode_frame_in: number;
|
133
|
+
export const total_frames_decoded_in: number;
|
134
|
+
export const total_time_decoded_in: number;
|
135
|
+
export const delta_nack_sent_in: number;
|
136
|
+
export const delta_pli_sent_in: number;
|
137
|
+
export const total_nack_sent_in: number;
|
138
|
+
export const total_pli_sent_in: number;
|
139
|
+
const ssrc_2: string;
|
140
|
+
export { ssrc_2 as ssrc };
|
141
|
+
import direction_2 = DIRECTION.INBOUND;
|
142
|
+
export { direction_2 as direction };
|
143
|
+
}
|
144
|
+
export namespace defaultVideoMetricOut {
|
145
|
+
const codec_id_out_1: string;
|
146
|
+
export { codec_id_out_1 as codec_id_out };
|
147
|
+
export namespace size_out {
|
148
|
+
const width_1: null;
|
149
|
+
export { width_1 as width };
|
150
|
+
const height_1: null;
|
151
|
+
export { height_1 as height };
|
152
|
+
const framerate_1: null;
|
153
|
+
export { framerate_1 as framerate };
|
154
|
+
}
|
155
|
+
export namespace codec_out_1 {
|
156
|
+
const mime_type_3: null;
|
157
|
+
export { mime_type_3 as mime_type };
|
158
|
+
const clock_rate_3: null;
|
159
|
+
export { clock_rate_3 as clock_rate };
|
160
|
+
}
|
161
|
+
export { codec_out_1 as codec_out };
|
162
|
+
const delta_jitter_ms_out_1: number;
|
163
|
+
export { delta_jitter_ms_out_1 as delta_jitter_ms_out };
|
164
|
+
const delta_rtt_ms_out_1: null;
|
165
|
+
export { delta_rtt_ms_out_1 as delta_rtt_ms_out };
|
166
|
+
const total_rtt_ms_out_1: number;
|
167
|
+
export { total_rtt_ms_out_1 as total_rtt_ms_out };
|
168
|
+
const total_rtt_measure_out_1: number;
|
169
|
+
export { total_rtt_measure_out_1 as total_rtt_measure_out };
|
170
|
+
const percent_packets_lost_out_1: number;
|
171
|
+
export { percent_packets_lost_out_1 as percent_packets_lost_out };
|
172
|
+
const delta_packets_out_1: number;
|
173
|
+
export { delta_packets_out_1 as delta_packets_out };
|
174
|
+
const delta_packets_lost_out_1: number;
|
175
|
+
export { delta_packets_lost_out_1 as delta_packets_lost_out };
|
176
|
+
const total_packets_out_1: number;
|
177
|
+
export { total_packets_out_1 as total_packets_out };
|
178
|
+
const total_packets_lost_out_1: number;
|
179
|
+
export { total_packets_lost_out_1 as total_packets_lost_out };
|
180
|
+
const total_KBytes_out_1: number;
|
181
|
+
export { total_KBytes_out_1 as total_KBytes_out };
|
182
|
+
const delta_KBytes_out_1: number;
|
183
|
+
export { delta_KBytes_out_1 as delta_KBytes_out };
|
184
|
+
const delta_kbs_out_1: number;
|
185
|
+
export { delta_kbs_out_1 as delta_kbs_out };
|
186
|
+
export const encoder_out: null;
|
187
|
+
export const delta_ms_encode_frame_out: number;
|
188
|
+
export const total_time_encoded_out: number;
|
189
|
+
export const total_frames_encoded_out: number;
|
190
|
+
export const delta_nack_received_out: number;
|
191
|
+
export const delta_pli_received_out: number;
|
192
|
+
export const total_nack_received_out: number;
|
193
|
+
export const total_pli_received_out: number;
|
194
|
+
export namespace limitation_out {
|
195
|
+
const reason: null;
|
196
|
+
const durations: null;
|
197
|
+
const resolutionChanges: number;
|
198
|
+
}
|
199
|
+
const timestamp_out_1: null;
|
200
|
+
export { timestamp_out_1 as timestamp_out };
|
201
|
+
const ssrc_3: string;
|
202
|
+
export { ssrc_3 as ssrc };
|
203
|
+
import direction_3 = DIRECTION.OUTBOUND;
|
204
|
+
export { direction_3 as direction };
|
205
|
+
}
|
206
|
+
export function getDefaultMetric(previousStats: any): any;
|
207
|
+
export namespace defaultConfig {
|
208
|
+
const refreshEvery: number;
|
209
|
+
const startAfter: number;
|
210
|
+
const stopAfter: number;
|
211
|
+
const verbose: boolean;
|
212
|
+
const pname: string;
|
213
|
+
const cid: string;
|
214
|
+
const uid: string;
|
215
|
+
const record: boolean;
|
216
|
+
const ticket: boolean;
|
217
|
+
}
|
218
|
+
export namespace TYPE {
|
219
|
+
const CANDIDATE_PAIR: string;
|
220
|
+
const CODEC: string;
|
221
|
+
const INBOUND_RTP: string;
|
222
|
+
const LOCAL_CANDIDATE: string;
|
223
|
+
const MEDIA_SOURCE: string;
|
224
|
+
const OUTBOUND_RTP: string;
|
225
|
+
const REMOTE_CANDIDATE: string;
|
226
|
+
const REMOTE_INBOUND_RTP: string;
|
227
|
+
const TRACK: string;
|
228
|
+
}
|
229
|
+
export namespace PROPERTY {
|
230
|
+
const AUDIO_LEVEL: string;
|
231
|
+
const AVAILABLE_OUTGOING_BITRATE: string;
|
232
|
+
const AVAILABLE_INCOMING_BITRATE: string;
|
233
|
+
const BYTES_RECEIVED: string;
|
234
|
+
const BYTES_SENT: string;
|
235
|
+
const CANDIDATE_TYPE: string;
|
236
|
+
const CHANNELS: string;
|
237
|
+
const CLOCK_RATE: string;
|
238
|
+
const CODEC_ID: string;
|
239
|
+
const CURRENT_ROUND_TRIP_TIME: string;
|
240
|
+
const ROUND_TRIP_TIME: string;
|
241
|
+
const FRACTION_LOST: string;
|
242
|
+
const FRAME_HEIGHT: string;
|
243
|
+
const FRAME_WIDTH: string;
|
244
|
+
const QUALITY_LIMITATION_REASON: string;
|
245
|
+
const QUALITY_LIMITATION_DURATIONS: string;
|
246
|
+
const QUALITY_LIMITATION_RESOLUTION_CHANGES: string;
|
247
|
+
const ID: string;
|
248
|
+
const JITTER: string;
|
249
|
+
const KIND: string;
|
250
|
+
const MEDIA_TYPE: string;
|
251
|
+
const MIME_TYPE: string;
|
252
|
+
const LOCAL_CANDIDATE_ID: string;
|
253
|
+
const NETWORK_TYPE: string;
|
254
|
+
const RELAY_PROTOCOL: string;
|
255
|
+
const NOMINATED: string;
|
256
|
+
const PACKETS_LOST: string;
|
257
|
+
const PACKETS_RECEIVED: string;
|
258
|
+
const PACKETS_SENT: string;
|
259
|
+
const PROTOCOL: string;
|
260
|
+
const PORT: string;
|
261
|
+
const REMOTE_CANDIDATE_ID: string;
|
262
|
+
const REMOTE_SOURCE: string;
|
263
|
+
const RESPONSES_RECEIVED: string;
|
264
|
+
const SDP_FMTP_LINE: string;
|
265
|
+
const SSRC: string;
|
266
|
+
const SELECTED: string;
|
267
|
+
const STATE: string;
|
268
|
+
const TIMESTAMP: string;
|
269
|
+
const TOTAL_ROUND_TRIP_TIME: string;
|
270
|
+
const TOTAL_ROUND_TRIP_TIME_MEASUREMENTS: string;
|
271
|
+
const TYPE: string;
|
272
|
+
const DECODER_IMPLEMENTATION: string;
|
273
|
+
const ENCODER_IMPLEMENTATION: string;
|
274
|
+
const FRAMES_DECODED: string;
|
275
|
+
const FRAMES_ENCODED: string;
|
276
|
+
const FRAMES_PER_SECOND: string;
|
277
|
+
const TOTAL_DECODE_TIME: string;
|
278
|
+
const TOTAL_ENCODE_TIME: string;
|
279
|
+
const PLI: string;
|
280
|
+
const NACK: string;
|
281
|
+
}
|
282
|
+
export namespace VALUE {
|
283
|
+
const SUCCEEDED: string;
|
284
|
+
const AUDIO: string;
|
285
|
+
const VIDEO: string;
|
286
|
+
}
|
287
|
+
export namespace INFRASTRUCTURE_VALUE {
|
288
|
+
const ETHERNET: number;
|
289
|
+
const CELLULAR_5G: number;
|
290
|
+
const WIFI: number;
|
291
|
+
const CELLULAR_4G: number;
|
292
|
+
const CELLULAR: number;
|
293
|
+
}
|
294
|
+
export namespace INFRASTRUCTURE_LABEL {
|
295
|
+
const ETHERNET_1: string;
|
296
|
+
export { ETHERNET_1 as ETHERNET };
|
297
|
+
const CELLULAR_4G_1: string;
|
298
|
+
export { CELLULAR_4G_1 as CELLULAR_4G };
|
299
|
+
const WIFI_1: string;
|
300
|
+
export { WIFI_1 as WIFI };
|
301
|
+
}
|
302
|
+
export namespace STAT_TYPE {
|
303
|
+
const AUDIO_1: string;
|
304
|
+
export { AUDIO_1 as AUDIO };
|
305
|
+
const VIDEO_1: string;
|
306
|
+
export { VIDEO_1 as VIDEO };
|
307
|
+
export const NETWORK: string;
|
308
|
+
export const DATA: string;
|
309
|
+
}
|
@@ -0,0 +1,298 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.STAT_TYPE = exports.INFRASTRUCTURE_LABEL = exports.INFRASTRUCTURE_VALUE = exports.VALUE = exports.PROPERTY = exports.TYPE = exports.defaultConfig = exports.getDefaultMetric = exports.defaultVideoMetricOut = exports.defaultVideoMetricIn = exports.defaultAudioMetricOut = exports.defaultAudioMetricIn = exports.getDefaultGlobalMetric = exports.ICE_GATHERING_STATE = exports.ICE_CONNECTION_STATE = exports.ENGINE_STATE = exports.COLLECTOR_STATE = exports.DIRECTION = exports.getVersion = exports.getLibName = void 0;
|
7
|
+
//import shortUUID from "./shortUUId";
|
8
|
+
const generate_unique_id_1 = __importDefault(require("generate-unique-id"));
|
9
|
+
const getLibName = () => ("WebRTCMetrics");
|
10
|
+
exports.getLibName = getLibName;
|
11
|
+
const getVersion = () => ("5.0.3");
|
12
|
+
exports.getVersion = getVersion;
|
13
|
+
exports.DIRECTION = {
|
14
|
+
INBOUND: "inbound",
|
15
|
+
OUTBOUND: "outbound",
|
16
|
+
};
|
17
|
+
exports.COLLECTOR_STATE = {
|
18
|
+
IDLE: "idle",
|
19
|
+
RUNNING: "running",
|
20
|
+
MUTED: "muted",
|
21
|
+
};
|
22
|
+
exports.ENGINE_STATE = {
|
23
|
+
IDLE: "idle",
|
24
|
+
COLLECTING: "collecting",
|
25
|
+
ENDED: "ended",
|
26
|
+
};
|
27
|
+
exports.ICE_CONNECTION_STATE = {
|
28
|
+
NEW: "new",
|
29
|
+
CHECKING: "checking",
|
30
|
+
CONNECTED: "connected",
|
31
|
+
COMPLETED: "completed",
|
32
|
+
DISCONNECTED: "disconnected",
|
33
|
+
FAILED: "failed",
|
34
|
+
CLOSED: "closed",
|
35
|
+
};
|
36
|
+
exports.ICE_GATHERING_STATE = {
|
37
|
+
NEW: "new",
|
38
|
+
GATHERING: "gathering",
|
39
|
+
COMPLETE: "complete",
|
40
|
+
};
|
41
|
+
const getDefaultGlobalMetric = () => {
|
42
|
+
const defaultMetrics = {
|
43
|
+
delta_time_to_measure_probes_ms: 0,
|
44
|
+
delta_time_consumed_to_measure_ms: 0,
|
45
|
+
delta_KBytes_in: 0,
|
46
|
+
delta_KBytes_out: 0,
|
47
|
+
delta_kbs_in: 0,
|
48
|
+
delta_kbs_out: 0,
|
49
|
+
total_time_decoded_in: 0,
|
50
|
+
total_time_encoded_out: 0,
|
51
|
+
probes: [],
|
52
|
+
};
|
53
|
+
const metrics = Object.assign({}, defaultMetrics);
|
54
|
+
return metrics;
|
55
|
+
};
|
56
|
+
exports.getDefaultGlobalMetric = getDefaultGlobalMetric;
|
57
|
+
exports.defaultAudioMetricIn = {
|
58
|
+
level_in: 0,
|
59
|
+
codec_id_in: "",
|
60
|
+
codec_in: { mime_type: null, clock_rate: null, sdp_fmtp_line: null },
|
61
|
+
delta_jitter_ms_in: 0,
|
62
|
+
percent_packets_lost_in: 0,
|
63
|
+
delta_packets_in: 0,
|
64
|
+
delta_packets_lost_in: 0,
|
65
|
+
total_packets_in: 0,
|
66
|
+
total_packets_lost_in: 0,
|
67
|
+
total_KBytes_in: 0,
|
68
|
+
delta_KBytes_in: 0,
|
69
|
+
delta_kbs_in: 0,
|
70
|
+
mos_in: 0,
|
71
|
+
mos_emodel_in: 0,
|
72
|
+
ssrc: "",
|
73
|
+
direction: exports.DIRECTION.INBOUND,
|
74
|
+
};
|
75
|
+
exports.defaultAudioMetricOut = {
|
76
|
+
level_out: 0,
|
77
|
+
codec_id_out: "",
|
78
|
+
codec_out: { mime_type: null, clock_rate: null, sdp_fmtp_line: null },
|
79
|
+
delta_jitter_ms_out: 0,
|
80
|
+
delta_rtt_ms_out: null,
|
81
|
+
total_rtt_ms_out: 0,
|
82
|
+
total_rtt_measure_out: 0,
|
83
|
+
percent_packets_lost_out: 0,
|
84
|
+
delta_packets_out: 0,
|
85
|
+
delta_packets_lost_out: 0,
|
86
|
+
total_packets_out: 0,
|
87
|
+
total_packets_lost_out: 0,
|
88
|
+
total_KBytes_out: 0,
|
89
|
+
delta_KBytes_out: 0,
|
90
|
+
delta_kbs_out: 0,
|
91
|
+
timestamp_out: null,
|
92
|
+
mos_out: 0,
|
93
|
+
mos_emodel_out: 0,
|
94
|
+
ssrc: "",
|
95
|
+
direction: exports.DIRECTION.OUTBOUND,
|
96
|
+
};
|
97
|
+
exports.defaultVideoMetricIn = {
|
98
|
+
codec_id_in: "",
|
99
|
+
size_in: { width: null, height: null, framerate: null },
|
100
|
+
codec_in: { mime_type: null, clock_rate: null },
|
101
|
+
delta_jitter_ms_in: 0,
|
102
|
+
percent_packets_lost_in: 0,
|
103
|
+
delta_packets_in: 0,
|
104
|
+
delta_packets_lost_in: 0,
|
105
|
+
total_packets_in: 0,
|
106
|
+
total_packets_lost_in: 0,
|
107
|
+
total_KBytes_in: 0,
|
108
|
+
delta_KBytes_in: 0,
|
109
|
+
delta_kbs_in: 0,
|
110
|
+
decoder_in: null,
|
111
|
+
delta_ms_decode_frame_in: 0,
|
112
|
+
total_frames_decoded_in: 0,
|
113
|
+
total_time_decoded_in: 0,
|
114
|
+
delta_nack_sent_in: 0,
|
115
|
+
delta_pli_sent_in: 0,
|
116
|
+
total_nack_sent_in: 0,
|
117
|
+
total_pli_sent_in: 0,
|
118
|
+
ssrc: "",
|
119
|
+
direction: exports.DIRECTION.INBOUND,
|
120
|
+
};
|
121
|
+
exports.defaultVideoMetricOut = {
|
122
|
+
codec_id_out: "",
|
123
|
+
size_out: { width: null, height: null, framerate: null },
|
124
|
+
codec_out: { mime_type: null, clock_rate: null },
|
125
|
+
delta_jitter_ms_out: 0,
|
126
|
+
delta_rtt_ms_out: null,
|
127
|
+
total_rtt_ms_out: 0,
|
128
|
+
total_rtt_measure_out: 0,
|
129
|
+
percent_packets_lost_out: 0,
|
130
|
+
delta_packets_out: 0,
|
131
|
+
delta_packets_lost_out: 0,
|
132
|
+
total_packets_out: 0,
|
133
|
+
total_packets_lost_out: 0,
|
134
|
+
total_KBytes_out: 0,
|
135
|
+
delta_KBytes_out: 0,
|
136
|
+
delta_kbs_out: 0,
|
137
|
+
encoder_out: null,
|
138
|
+
delta_ms_encode_frame_out: 0,
|
139
|
+
total_time_encoded_out: 0,
|
140
|
+
total_frames_encoded_out: 0,
|
141
|
+
delta_nack_received_out: 0,
|
142
|
+
delta_pli_received_out: 0,
|
143
|
+
total_nack_received_out: 0,
|
144
|
+
total_pli_received_out: 0,
|
145
|
+
limitation_out: { reason: null, durations: null, resolutionChanges: 0 },
|
146
|
+
timestamp_out: null,
|
147
|
+
ssrc: "",
|
148
|
+
direction: exports.DIRECTION.OUTBOUND,
|
149
|
+
};
|
150
|
+
const getDefaultMetric = (previousStats) => {
|
151
|
+
const defaultMetrics = {
|
152
|
+
pname: "",
|
153
|
+
call_id: "",
|
154
|
+
user_id: "",
|
155
|
+
timestamp: null,
|
156
|
+
count: 0,
|
157
|
+
audio: {},
|
158
|
+
video: {},
|
159
|
+
network: {
|
160
|
+
infrastructure: 3,
|
161
|
+
local_candidate_id: "",
|
162
|
+
local_candidate_type: "",
|
163
|
+
local_candidate_protocol: "",
|
164
|
+
local_candidate_relay_protocol: "",
|
165
|
+
remote_candidate_id: "",
|
166
|
+
remote_candidate_type: "",
|
167
|
+
remote_candidate_protocol: "",
|
168
|
+
},
|
169
|
+
data: {
|
170
|
+
total_KBytes_in: 0,
|
171
|
+
total_KBytes_out: 0,
|
172
|
+
delta_KBytes_in: 0,
|
173
|
+
delta_KBytes_out: 0,
|
174
|
+
delta_kbs_in: 0,
|
175
|
+
delta_kbs_out: 0,
|
176
|
+
delta_kbs_bandwidth_in: 0,
|
177
|
+
delta_kbs_bandwidth_out: 0,
|
178
|
+
delta_rtt_connectivity_ms: null,
|
179
|
+
total_rtt_connectivity_ms: 0,
|
180
|
+
total_rtt_connectivity_measure: 0,
|
181
|
+
},
|
182
|
+
experimental: {
|
183
|
+
time_to_measure_ms: 0,
|
184
|
+
},
|
185
|
+
};
|
186
|
+
if (previousStats) {
|
187
|
+
const metrics = Object.assign(Object.assign({}, previousStats), { audio: {}, video: {}, data: Object.assign({}, previousStats.data), network: Object.assign({}, previousStats.network), experimental: Object.assign({}, previousStats.experimental) });
|
188
|
+
Object.keys(previousStats.audio).forEach((ssrc) => {
|
189
|
+
metrics.audio[ssrc] = Object.assign({}, previousStats.audio[ssrc]);
|
190
|
+
});
|
191
|
+
Object.keys(previousStats.video).forEach((ssrc) => {
|
192
|
+
metrics.video[ssrc] = Object.assign({}, previousStats.video[ssrc]);
|
193
|
+
});
|
194
|
+
return metrics;
|
195
|
+
}
|
196
|
+
return Object.assign(Object.assign({}, defaultMetrics), { audio: {}, video: {}, data: Object.assign({}, defaultMetrics.data), network: Object.assign({}, defaultMetrics.network), experimental: Object.assign({}, defaultMetrics.experimental) });
|
197
|
+
};
|
198
|
+
exports.getDefaultMetric = getDefaultMetric;
|
199
|
+
exports.defaultConfig = {
|
200
|
+
refreshEvery: 2000,
|
201
|
+
startAfter: 0,
|
202
|
+
stopAfter: -1,
|
203
|
+
// keepMaxReport: 50, // Keep the last 50 tickets (new one erases the oldest)
|
204
|
+
verbose: false,
|
205
|
+
pname: `p-${(0, generate_unique_id_1.default)()}`,
|
206
|
+
cid: `c-${(0, generate_unique_id_1.default)()}`,
|
207
|
+
uid: `u-${(0, generate_unique_id_1.default)()}`,
|
208
|
+
record: false,
|
209
|
+
ticket: true, // Default - ticket generated and so all reports are kept
|
210
|
+
// recordFields: ["*"], // Default all fields stored
|
211
|
+
};
|
212
|
+
exports.TYPE = {
|
213
|
+
CANDIDATE_PAIR: "candidate-pair",
|
214
|
+
CODEC: "codec",
|
215
|
+
INBOUND_RTP: "inbound-rtp",
|
216
|
+
LOCAL_CANDIDATE: "local-candidate",
|
217
|
+
MEDIA_SOURCE: "media-source",
|
218
|
+
OUTBOUND_RTP: "outbound-rtp",
|
219
|
+
REMOTE_CANDIDATE: "remote-candidate",
|
220
|
+
REMOTE_INBOUND_RTP: "remote-inbound-rtp",
|
221
|
+
TRACK: "track",
|
222
|
+
};
|
223
|
+
exports.PROPERTY = {
|
224
|
+
AUDIO_LEVEL: "audioLevel",
|
225
|
+
AVAILABLE_OUTGOING_BITRATE: "availableOutgoingBitrate",
|
226
|
+
AVAILABLE_INCOMING_BITRATE: "availableIncomingBitrate",
|
227
|
+
BYTES_RECEIVED: "bytesReceived",
|
228
|
+
BYTES_SENT: "bytesSent",
|
229
|
+
CANDIDATE_TYPE: "candidateType",
|
230
|
+
CHANNELS: "channels",
|
231
|
+
CLOCK_RATE: "clockRate",
|
232
|
+
CODEC_ID: "codecId",
|
233
|
+
CURRENT_ROUND_TRIP_TIME: "currentRoundTripTime",
|
234
|
+
ROUND_TRIP_TIME: "roundTripTime",
|
235
|
+
FRACTION_LOST: "fractionLost",
|
236
|
+
FRAME_HEIGHT: "frameHeight",
|
237
|
+
FRAME_WIDTH: "frameWidth",
|
238
|
+
QUALITY_LIMITATION_REASON: "qualityLimitationReason",
|
239
|
+
QUALITY_LIMITATION_DURATIONS: "qualityLimitationDurations",
|
240
|
+
QUALITY_LIMITATION_RESOLUTION_CHANGES: "qualityLimitationResolutionChanges",
|
241
|
+
ID: "id",
|
242
|
+
JITTER: "jitter",
|
243
|
+
KIND: "kind",
|
244
|
+
MEDIA_TYPE: "mediaType",
|
245
|
+
MIME_TYPE: "mimeType",
|
246
|
+
LOCAL_CANDIDATE_ID: "localCandidateId",
|
247
|
+
NETWORK_TYPE: "networkType",
|
248
|
+
RELAY_PROTOCOL: "relayProtocol",
|
249
|
+
NOMINATED: "nominated",
|
250
|
+
PACKETS_LOST: "packetsLost",
|
251
|
+
PACKETS_RECEIVED: "packetsReceived",
|
252
|
+
PACKETS_SENT: "packetsSent",
|
253
|
+
PROTOCOL: "protocol",
|
254
|
+
PORT: "port",
|
255
|
+
REMOTE_CANDIDATE_ID: "remoteCandidateId",
|
256
|
+
REMOTE_SOURCE: "remoteSource",
|
257
|
+
RESPONSES_RECEIVED: "responsesReceived",
|
258
|
+
SDP_FMTP_LINE: "sdpFmtpLine",
|
259
|
+
SSRC: "ssrc",
|
260
|
+
SELECTED: "selected",
|
261
|
+
STATE: "state",
|
262
|
+
TIMESTAMP: "timestamp",
|
263
|
+
TOTAL_ROUND_TRIP_TIME: "totalRoundTripTime",
|
264
|
+
TOTAL_ROUND_TRIP_TIME_MEASUREMENTS: "roundTripTimeMeasurements",
|
265
|
+
TYPE: "type",
|
266
|
+
DECODER_IMPLEMENTATION: "decoderImplementation",
|
267
|
+
ENCODER_IMPLEMENTATION: "encoderImplementation",
|
268
|
+
FRAMES_DECODED: "framesDecoded",
|
269
|
+
FRAMES_ENCODED: "framesEncoded",
|
270
|
+
FRAMES_PER_SECOND: "framesPerSecond",
|
271
|
+
TOTAL_DECODE_TIME: "totalDecodeTime",
|
272
|
+
TOTAL_ENCODE_TIME: "totalEncodeTime",
|
273
|
+
PLI: "pliCount",
|
274
|
+
NACK: "nackCount",
|
275
|
+
};
|
276
|
+
exports.VALUE = {
|
277
|
+
SUCCEEDED: "succeeded",
|
278
|
+
AUDIO: "audio",
|
279
|
+
VIDEO: "video",
|
280
|
+
};
|
281
|
+
exports.INFRASTRUCTURE_VALUE = {
|
282
|
+
ETHERNET: 0,
|
283
|
+
CELLULAR_5G: 2,
|
284
|
+
WIFI: 3,
|
285
|
+
CELLULAR_4G: 5,
|
286
|
+
CELLULAR: 10,
|
287
|
+
};
|
288
|
+
exports.INFRASTRUCTURE_LABEL = {
|
289
|
+
ETHERNET: "ethernet",
|
290
|
+
CELLULAR_4G: "cellular",
|
291
|
+
WIFI: "wifi",
|
292
|
+
};
|
293
|
+
exports.STAT_TYPE = {
|
294
|
+
AUDIO: "audio",
|
295
|
+
VIDEO: "video",
|
296
|
+
NETWORK: "network",
|
297
|
+
DATA: "data",
|
298
|
+
};
|
@@ -0,0 +1,4 @@
|
|
1
|
+
export function computeEModelMOS(report: any, kind: string | undefined, previousReport: any, beforeLastReport: any, ssrc: any): number;
|
2
|
+
export function computeEModelMOSForOutgoing(report: any, kind: string | undefined, previousReport: any, beforeLastReport: any, ssrc: any): number;
|
3
|
+
export function computeMOS(report: any, kind: string | undefined, previousReport: any, beforeLastReport: any, ssrc: any): number;
|
4
|
+
export function computeMOSForOutgoing(report: any, kind: string | undefined, previousReport: any, beforeLastReport: any, ssrc: any): number;
|