@telnyx/webrtc 2.27.0-beta.3 → 2.27.0-beta.4
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/bundle.js +1 -1
- package/lib/bundle.mjs +1 -1
- package/lib/src/Modules/Verto/BaseSession.d.ts +15 -1
- package/lib/src/Modules/Verto/util/interfaces.d.ts +1 -0
- package/lib/src/Modules/Verto/webrtc/BaseCall.d.ts +3 -0
- package/lib/src/Modules/Verto/webrtc/CallReportCollector.d.ts +19 -2
- package/lib/src/Modules/Verto/webrtc/interfaces.d.ts +2 -0
- package/lib/src/utils/interfaces.d.ts +1 -0
- package/package.json +1 -1
|
@@ -22,6 +22,7 @@ export default abstract class BaseSession {
|
|
|
22
22
|
invalidMethodErrorCode: number;
|
|
23
23
|
authenticationRequiredErrorCode: number;
|
|
24
24
|
callReportId: string | null;
|
|
25
|
+
callReportVoiceSdkId: string | null;
|
|
25
26
|
dc: string | null;
|
|
26
27
|
region: string | null;
|
|
27
28
|
connection: Connection;
|
|
@@ -33,6 +34,8 @@ export default abstract class BaseSession {
|
|
|
33
34
|
protected _reconnectAttempts: number;
|
|
34
35
|
private _tokenExpiryTimeout;
|
|
35
36
|
private static readonly TOKEN_EXPIRY_WARNING_SECONDS;
|
|
37
|
+
private static readonly CALL_REPORT_UPLOAD_DRAIN_TIMEOUT_MS;
|
|
38
|
+
private _pendingCallReportUploads;
|
|
36
39
|
private _executeQueue;
|
|
37
40
|
private _pong;
|
|
38
41
|
private registerAgent;
|
|
@@ -43,6 +46,8 @@ export default abstract class BaseSession {
|
|
|
43
46
|
get reconnectDelay(): number;
|
|
44
47
|
execute(msg: BaseMessage): Promise<any>;
|
|
45
48
|
executeRaw(text: string): void;
|
|
49
|
+
trackCallReportUpload(upload: Promise<void>): void;
|
|
50
|
+
private _drainCallReportUploads;
|
|
46
51
|
validateOptions(): boolean;
|
|
47
52
|
broadcast(_params: BroadcastParams): void;
|
|
48
53
|
disconnect(): Promise<void>;
|
|
@@ -68,7 +73,16 @@ export default abstract class BaseSession {
|
|
|
68
73
|
}): Promise<void>;
|
|
69
74
|
private _login;
|
|
70
75
|
protected _onSocketOpen(): Promise<void>;
|
|
71
|
-
|
|
76
|
+
private _flushIntermediateCallReports;
|
|
77
|
+
private _getSocketCloseCodeName;
|
|
78
|
+
private _getSocketCloseError;
|
|
79
|
+
private _createSocketCloseFlushReason;
|
|
80
|
+
onNetworkClose(event?: {
|
|
81
|
+
code?: number;
|
|
82
|
+
reason?: string;
|
|
83
|
+
wasClean?: boolean;
|
|
84
|
+
error?: unknown;
|
|
85
|
+
}): void;
|
|
72
86
|
protected _onSocketMessage(_response: any): void;
|
|
73
87
|
protected _removeSubscription(protocol: string, channel?: string): void;
|
|
74
88
|
protected _addSubscription(protocol: string, handler: Function, channel: string): void;
|
|
@@ -36,6 +36,7 @@ export interface IVertoOptions {
|
|
|
36
36
|
maxReconnectAttempts?: number;
|
|
37
37
|
enableCallReports?: boolean;
|
|
38
38
|
callReportInterval?: number;
|
|
39
|
+
callReportFlushInterval?: number;
|
|
39
40
|
debugLogLevel?: 'debug' | 'info' | 'warn' | 'error';
|
|
40
41
|
debugLogMaxEntries?: number;
|
|
41
42
|
skipLastVoiceSdkId?: boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import BrowserSession from '../BrowserSession';
|
|
2
|
+
import { type ICallReportFlushReason } from './CallReportCollector';
|
|
2
3
|
import Call from './Call';
|
|
3
4
|
import Peer from './Peer';
|
|
4
5
|
import { Direction, State } from './constants';
|
|
@@ -122,6 +123,8 @@ export default abstract class BaseCall implements IWebRTCCall {
|
|
|
122
123
|
private _hasUsablePeerConnection;
|
|
123
124
|
private _init;
|
|
124
125
|
protected _finalize(): void;
|
|
126
|
+
private _getCallReportVoiceSdkId;
|
|
127
|
+
flushIntermediateCallReport(flushReason?: ICallReportFlushReason): void;
|
|
125
128
|
private _flushIntermediateReport;
|
|
126
129
|
private _postCallReport;
|
|
127
130
|
private _startStats;
|
|
@@ -55,6 +55,7 @@ export interface ITransportStats {
|
|
|
55
55
|
export interface ICallReportOptions {
|
|
56
56
|
enabled: boolean;
|
|
57
57
|
interval: number;
|
|
58
|
+
intermediateReportInterval?: number;
|
|
58
59
|
}
|
|
59
60
|
export interface ILogCollectorOptions {
|
|
60
61
|
enabled: boolean;
|
|
@@ -112,11 +113,22 @@ export interface ICallSummary {
|
|
|
112
113
|
startTimestamp?: string;
|
|
113
114
|
endTimestamp?: string;
|
|
114
115
|
}
|
|
116
|
+
export interface ICallReportFlushReason {
|
|
117
|
+
type: 'buffer-limit' | 'manual' | 'socket-close' | 'socket-error';
|
|
118
|
+
socketClose?: {
|
|
119
|
+
code?: number;
|
|
120
|
+
codeName?: string;
|
|
121
|
+
reason?: string;
|
|
122
|
+
wasClean?: boolean;
|
|
123
|
+
error?: string;
|
|
124
|
+
};
|
|
125
|
+
}
|
|
115
126
|
export interface ICallReportPayload {
|
|
116
127
|
summary: ICallSummary;
|
|
117
128
|
stats: IStatsInterval[];
|
|
118
129
|
logs?: ILogEntry[];
|
|
119
130
|
segment?: number;
|
|
131
|
+
flushReason?: ICallReportFlushReason;
|
|
120
132
|
}
|
|
121
133
|
export declare class CallReportCollector {
|
|
122
134
|
private options;
|
|
@@ -139,6 +151,7 @@ export declare class CallReportCollector {
|
|
|
139
151
|
private readonly MAX_BUFFER_SIZE;
|
|
140
152
|
private static readonly STATS_FLUSH_THRESHOLD;
|
|
141
153
|
private static readonly LOGS_FLUSH_THRESHOLD;
|
|
154
|
+
private static readonly DEFAULT_INTERMEDIATE_REPORT_INTERVAL_MS;
|
|
142
155
|
onFlushNeeded: (() => void) | null;
|
|
143
156
|
onWarning: ((warning: ITelnyxWarning) => void) | null;
|
|
144
157
|
private static readonly CONSECUTIVE_BREACHES_REQUIRED;
|
|
@@ -158,13 +171,15 @@ export declare class CallReportCollector {
|
|
|
158
171
|
private _hasConfirmedLocalAudio;
|
|
159
172
|
private _confirmedLocalAudioSilenceMs;
|
|
160
173
|
private _segmentIndex;
|
|
174
|
+
private _lastIntermediateFlushTime;
|
|
161
175
|
private _flushing;
|
|
162
176
|
private _stopped;
|
|
163
|
-
private static readonly
|
|
177
|
+
private static readonly RETRY_DELAYS_MS;
|
|
178
|
+
private static readonly KEEPALIVE_BODY_LIMIT_BYTES;
|
|
164
179
|
constructor(options: ICallReportOptions, logCollectorOptions?: ILogCollectorOptions);
|
|
165
180
|
start(peerConnection: RTCPeerConnection): void;
|
|
166
181
|
stop(): Promise<void>;
|
|
167
|
-
flush(summary: ICallSummary): ICallReportPayload | null;
|
|
182
|
+
flush(summary: ICallSummary, flushReason?: ICallReportFlushReason): ICallReportPayload | null;
|
|
168
183
|
postReport(summary: ICallSummary, callReportId: string, host: string, voiceSdkId?: string): Promise<void>;
|
|
169
184
|
sendPayload(payload: ICallReportPayload, callReportId: string, host: string, voiceSdkId?: string): Promise<void>;
|
|
170
185
|
private _sendPayload;
|
|
@@ -175,6 +190,8 @@ export declare class CallReportCollector {
|
|
|
175
190
|
private _collectionIntervalFor;
|
|
176
191
|
private _positiveInterval;
|
|
177
192
|
private _collectStats;
|
|
193
|
+
private _getIntermediateReportInterval;
|
|
194
|
+
private _requestIntermediateFlushIfNeeded;
|
|
178
195
|
private _checkQualityWarnings;
|
|
179
196
|
private _trackLowLocalAudio;
|
|
180
197
|
private _resetLowLocalAudioWarning;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ICallReportFlushReason } from './CallReportCollector';
|
|
1
2
|
import { State } from './constants';
|
|
2
3
|
export interface IMediaSettings {
|
|
3
4
|
useSdpASBandwidthKbps?: boolean;
|
|
@@ -109,6 +110,7 @@ export interface IWebRTCCall {
|
|
|
109
110
|
invite: () => void;
|
|
110
111
|
answer: (params: AnswerParams) => void;
|
|
111
112
|
hangup: (params?: IHangupParams, execute?: boolean) => Promise<void>;
|
|
113
|
+
flushIntermediateCallReport?: (reason?: ICallReportFlushReason) => void;
|
|
112
114
|
hold: () => void;
|
|
113
115
|
unhold: () => void;
|
|
114
116
|
toggleHold: () => void;
|