@telnyx/webrtc 2.26.4 → 2.27.0-beta.2
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/util/constants/errorCodes.d.ts +4 -2
- package/lib/src/Modules/Verto/util/constants/errors.d.ts +7 -0
- package/lib/src/Modules/Verto/util/constants/warnings.d.ts +7 -0
- package/lib/src/Modules/Verto/webrtc/BaseCall.d.ts +7 -2
- package/lib/src/Modules/Verto/webrtc/CallReportCollector.d.ts +38 -0
- package/lib/src/Modules/Verto/webrtc/Peer.d.ts +7 -0
- package/lib/src/Modules/Verto/webrtc/constants.d.ts +6 -0
- package/lib/src/Modules/Verto/webrtc/interfaces.d.ts +1 -0
- package/package.json +1 -1
|
@@ -19,6 +19,7 @@ export declare const TELNYX_ERROR_CODES: {
|
|
|
19
19
|
readonly LOGIN_FAILED: 46001;
|
|
20
20
|
readonly INVALID_CREDENTIALS: 46002;
|
|
21
21
|
readonly AUTHENTICATION_REQUIRED: 46003;
|
|
22
|
+
readonly ICE_RESTART_FAILED: 47001;
|
|
22
23
|
readonly NETWORK_OFFLINE: 48001;
|
|
23
24
|
readonly UNEXPECTED_ERROR: 49001;
|
|
24
25
|
};
|
|
@@ -35,9 +36,10 @@ export declare const TELNYX_WARNING_CODES: {
|
|
|
35
36
|
readonly PEER_CONNECTION_FAILED: 33004;
|
|
36
37
|
readonly ONLY_HOST_ICE_CANDIDATES: 33005;
|
|
37
38
|
readonly ANSWER_WHILE_PEER_ACTIVE: 33006;
|
|
39
|
+
readonly DUPLICATE_INBOUND_ANSWER: 33007;
|
|
38
40
|
readonly TOKEN_EXPIRING_SOON: 34001;
|
|
39
41
|
readonly SESSION_NOT_REATTACHED: 35001;
|
|
40
42
|
};
|
|
41
|
-
export declare const SDP_CREATE_OFFER_FAILED: 40001, SDP_CREATE_ANSWER_FAILED: 40002, SDP_SET_LOCAL_DESCRIPTION_FAILED: 40003, SDP_SET_REMOTE_DESCRIPTION_FAILED: 40004, SDP_SEND_FAILED: 40005, MEDIA_MICROPHONE_PERMISSION_DENIED: 42001, MEDIA_DEVICE_NOT_FOUND: 42002, MEDIA_GET_USER_MEDIA_FAILED: 42003, HOLD_FAILED: 44001, INVALID_CALL_PARAMETERS: 44002, BYE_SEND_FAILED: 44003, SUBSCRIBE_FAILED: 44004, PEER_CLOSED_DURING_INIT: 44005, WEBSOCKET_CONNECTION_FAILED: 45001, WEBSOCKET_ERROR: 45002, RECONNECTION_EXHAUSTED: 45003, GATEWAY_FAILED: 45004, LOGIN_FAILED: 46001, INVALID_CREDENTIALS: 46002, AUTHENTICATION_REQUIRED: 46003, NETWORK_OFFLINE: 48001, UNEXPECTED_ERROR: 49001;
|
|
42
|
-
export declare const HIGH_RTT: 31001, HIGH_JITTER: 31002, HIGH_PACKET_LOSS: 31003, LOW_MOS: 31004, LOW_BYTES_RECEIVED: 32001, LOW_BYTES_SENT: 32002, ICE_CONNECTIVITY_LOST: 33001, ICE_GATHERING_TIMEOUT: 33002, ICE_GATHERING_EMPTY: 33003, PEER_CONNECTION_FAILED: 33004, ONLY_HOST_ICE_CANDIDATES: 33005, ANSWER_WHILE_PEER_ACTIVE: 33006, TOKEN_EXPIRING_SOON: 34001, SESSION_NOT_REATTACHED: 35001;
|
|
43
|
+
export declare const SDP_CREATE_OFFER_FAILED: 40001, SDP_CREATE_ANSWER_FAILED: 40002, SDP_SET_LOCAL_DESCRIPTION_FAILED: 40003, SDP_SET_REMOTE_DESCRIPTION_FAILED: 40004, SDP_SEND_FAILED: 40005, MEDIA_MICROPHONE_PERMISSION_DENIED: 42001, MEDIA_DEVICE_NOT_FOUND: 42002, MEDIA_GET_USER_MEDIA_FAILED: 42003, HOLD_FAILED: 44001, INVALID_CALL_PARAMETERS: 44002, BYE_SEND_FAILED: 44003, SUBSCRIBE_FAILED: 44004, PEER_CLOSED_DURING_INIT: 44005, WEBSOCKET_CONNECTION_FAILED: 45001, WEBSOCKET_ERROR: 45002, RECONNECTION_EXHAUSTED: 45003, GATEWAY_FAILED: 45004, LOGIN_FAILED: 46001, INVALID_CREDENTIALS: 46002, AUTHENTICATION_REQUIRED: 46003, ICE_RESTART_FAILED: 47001, NETWORK_OFFLINE: 48001, UNEXPECTED_ERROR: 49001;
|
|
44
|
+
export declare const HIGH_RTT: 31001, HIGH_JITTER: 31002, HIGH_PACKET_LOSS: 31003, LOW_MOS: 31004, LOW_BYTES_RECEIVED: 32001, LOW_BYTES_SENT: 32002, ICE_CONNECTIVITY_LOST: 33001, ICE_GATHERING_TIMEOUT: 33002, ICE_GATHERING_EMPTY: 33003, PEER_CONNECTION_FAILED: 33004, ONLY_HOST_ICE_CANDIDATES: 33005, ANSWER_WHILE_PEER_ACTIVE: 33006, DUPLICATE_INBOUND_ANSWER: 33007, TOKEN_EXPIRING_SOON: 34001, SESSION_NOT_REATTACHED: 35001;
|
|
43
45
|
export declare const HAS_NON_HOST_ICE_CANDIDATE_REGEX: RegExp;
|
|
@@ -139,6 +139,13 @@ export declare const SDK_ERRORS: {
|
|
|
139
139
|
readonly causes: readonly ["Message sent before login completed", "Authentication token expired during the session", "Server-side session was invalidated", "WebSocket reconnected but re-authentication did not complete"];
|
|
140
140
|
readonly solutions: readonly ["Ensure the client is fully logged in before sending messages", "Re-authenticate using client.login() with fresh credentials", "Listen for telnyx.ready before making calls or sending requests"];
|
|
141
141
|
};
|
|
142
|
+
readonly 47001: {
|
|
143
|
+
readonly name: "ICE_RESTART_FAILED";
|
|
144
|
+
readonly message: "ICE restart failed";
|
|
145
|
+
readonly description: "The ICE restart Modify request could not be sent or the server returned an error. The media path could not be recovered via ICE restart.";
|
|
146
|
+
readonly causes: readonly ["WebSocket connection lost during ICE restart", "Server rejected the Modify request", "Timeout waiting for server response"];
|
|
147
|
+
readonly solutions: readonly ["The call may recover via WebSocket reconnect + Attach", "If the call does not recover, hang up and retry"];
|
|
148
|
+
};
|
|
142
149
|
readonly 48001: {
|
|
143
150
|
readonly name: "NETWORK_OFFLINE";
|
|
144
151
|
readonly message: "Device is offline";
|
|
@@ -96,6 +96,13 @@ export declare const SDK_WARNINGS: {
|
|
|
96
96
|
readonly causes: readonly ["Application called answer() twice on the same call object", "Multiple click handlers or event listeners triggering answer()"];
|
|
97
97
|
readonly solutions: readonly ["Ensure answer() is called only once per call", "Disable the answer button after the first click", "Check that answer() is not invoked from multiple event handlers"];
|
|
98
98
|
};
|
|
99
|
+
readonly 33007: {
|
|
100
|
+
readonly name: "DUPLICATE_INBOUND_ANSWER";
|
|
101
|
+
readonly message: "Call answer ignored because another inbound call is already being answered";
|
|
102
|
+
readonly description: "answer() was called on an inbound call while another inbound call is already answering or active in this JavaScript runtime. Answering both legs can trigger SIP 486 USER_BUSY / LOSE_RACE when duplicate WebSocket registrations receive the same incoming call.";
|
|
103
|
+
readonly causes: readonly ["Multiple TelnyxRTC instances in the same page", "Application code recreating a client without disconnecting the previous instance", "Duplicate inbound call notifications produced by duplicate WebSocket registrations"];
|
|
104
|
+
readonly solutions: readonly ["Keep a single active TelnyxRTC instance for inbound call handling", "Call disconnect() before replacing an SDK client instance", "Only call answer() for one inbound call notification at a time"];
|
|
105
|
+
};
|
|
99
106
|
readonly 34001: {
|
|
100
107
|
readonly name: "TOKEN_EXPIRING_SOON";
|
|
101
108
|
readonly message: "Authentication token expiring soon";
|
|
@@ -31,7 +31,6 @@ export default abstract class BaseCall implements IWebRTCCall {
|
|
|
31
31
|
private _lastSerno;
|
|
32
32
|
private _targetNodeId;
|
|
33
33
|
private _iceTimeout;
|
|
34
|
-
private _iceDone;
|
|
35
34
|
private _ringtone;
|
|
36
35
|
private _ringback;
|
|
37
36
|
private _statsBindings;
|
|
@@ -43,6 +42,7 @@ export default abstract class BaseCall implements IWebRTCCall {
|
|
|
43
42
|
private _firstCandidateSent;
|
|
44
43
|
private _firstNonHostCandidateSent;
|
|
45
44
|
private _isRecovering;
|
|
45
|
+
private _captureHangupCallerStack;
|
|
46
46
|
constructor(session: BrowserSession, opts?: IVertoCallOptions);
|
|
47
47
|
get nodeId(): string;
|
|
48
48
|
set nodeId(what: string);
|
|
@@ -93,6 +93,8 @@ export default abstract class BaseCall implements IWebRTCCall {
|
|
|
93
93
|
private _confControl;
|
|
94
94
|
private _handleChangeHoldStateSuccess;
|
|
95
95
|
private _handleChangeHoldStateError;
|
|
96
|
+
private _sendIceRestartModify;
|
|
97
|
+
private _onIceRestartFailed;
|
|
96
98
|
private _onRemoteSdp;
|
|
97
99
|
private _requestAnotherLocalDescription;
|
|
98
100
|
private _onIceSdp;
|
|
@@ -107,7 +109,6 @@ export default abstract class BaseCall implements IWebRTCCall {
|
|
|
107
109
|
private _resetTrickleIceCandidateState;
|
|
108
110
|
private _flushPendingTrickleIceCandidates;
|
|
109
111
|
private _registerPeerEvents;
|
|
110
|
-
private _registerTrickleIcePeerEvents;
|
|
111
112
|
private _checkConferenceSerno;
|
|
112
113
|
private _onMediaError;
|
|
113
114
|
private _onPeerConnectionFailureError;
|
|
@@ -115,6 +116,10 @@ export default abstract class BaseCall implements IWebRTCCall {
|
|
|
115
116
|
private _dispatchConferenceUpdate;
|
|
116
117
|
private _dispatchNotification;
|
|
117
118
|
private _execute;
|
|
119
|
+
private _registerInboundAnswerAttempt;
|
|
120
|
+
private _getSessionInboundAnswerCalls;
|
|
121
|
+
private _isBlockingInboundAnswer;
|
|
122
|
+
private _hasUsablePeerConnection;
|
|
118
123
|
private _init;
|
|
119
124
|
protected _finalize(): void;
|
|
120
125
|
private _flushIntermediateReport;
|
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
import { ILogEntry } from '../../../Modules/Verto/util/LogCollector';
|
|
2
2
|
import { type ITelnyxWarning } from '../../../Modules/Verto/util/errors';
|
|
3
|
+
export interface ILocalAudioTrackSnapshot {
|
|
4
|
+
id?: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
enabled?: boolean;
|
|
7
|
+
muted?: boolean;
|
|
8
|
+
readyState?: MediaStreamTrackState;
|
|
9
|
+
contentHint?: string;
|
|
10
|
+
settings?: {
|
|
11
|
+
deviceId?: string;
|
|
12
|
+
groupId?: string;
|
|
13
|
+
channelCount?: number;
|
|
14
|
+
sampleRate?: number;
|
|
15
|
+
sampleSize?: number;
|
|
16
|
+
latency?: number;
|
|
17
|
+
echoCancellation?: boolean;
|
|
18
|
+
noiseSuppression?: boolean;
|
|
19
|
+
autoGainControl?: boolean;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export interface ILocalAudioSourceStats {
|
|
23
|
+
id?: string;
|
|
24
|
+
trackIdentifier?: string;
|
|
25
|
+
audioLevel?: number;
|
|
26
|
+
totalAudioEnergy?: number;
|
|
27
|
+
totalSamplesDuration?: number;
|
|
28
|
+
echoReturnLoss?: number;
|
|
29
|
+
echoReturnLossEnhancement?: number;
|
|
30
|
+
}
|
|
3
31
|
interface ICECandidateInfo {
|
|
4
32
|
address?: string;
|
|
5
33
|
port?: number;
|
|
@@ -42,6 +70,8 @@ export interface IStatsInterval {
|
|
|
42
70
|
bytesSent?: number;
|
|
43
71
|
audioLevelAvg?: number;
|
|
44
72
|
bitrateAvg?: number;
|
|
73
|
+
localTrack?: ILocalAudioTrackSnapshot;
|
|
74
|
+
mediaSource?: ILocalAudioSourceStats;
|
|
45
75
|
};
|
|
46
76
|
inbound?: {
|
|
47
77
|
packetsReceived?: number;
|
|
@@ -120,6 +150,7 @@ export declare class CallReportCollector {
|
|
|
120
150
|
private static readonly WARNING_THROTTLE_MS;
|
|
121
151
|
private _prevPacketsReceived;
|
|
122
152
|
private _prevPacketsLost;
|
|
153
|
+
private _lastLocalAudioTrackSnapshotJson;
|
|
123
154
|
private _segmentIndex;
|
|
124
155
|
private _flushing;
|
|
125
156
|
private static readonly RETRY_DELAY_MS;
|
|
@@ -138,6 +169,13 @@ export declare class CallReportCollector {
|
|
|
138
169
|
private _trackBreach;
|
|
139
170
|
private _createStatsEntry;
|
|
140
171
|
private _resolveCandidate;
|
|
172
|
+
private _getOutboundMediaSource;
|
|
173
|
+
private _getLocalAudioTrackSnapshot;
|
|
174
|
+
private _getOutboundAudioSourceStats;
|
|
175
|
+
private _logLocalAudioTrackSnapshot;
|
|
176
|
+
private _withoutUndefined;
|
|
177
|
+
private _stableStringify;
|
|
178
|
+
private _sortObjectKeys;
|
|
141
179
|
private _getOutboundAudioLevel;
|
|
142
180
|
private _getInboundAudioLevel;
|
|
143
181
|
private _computeAudioLevelFromEnergy;
|
|
@@ -8,6 +8,8 @@ export default class Peer {
|
|
|
8
8
|
instance: RTCPeerConnection;
|
|
9
9
|
onSdpReadyTwice: ((data: RTCSessionDescription) => void) | null;
|
|
10
10
|
statsReporter: WebRTCStatsReporter | null;
|
|
11
|
+
isIceRestarting: boolean;
|
|
12
|
+
iceDone: boolean;
|
|
11
13
|
private _constraints;
|
|
12
14
|
private _session;
|
|
13
15
|
private _negotiating;
|
|
@@ -21,7 +23,12 @@ export default class Peer {
|
|
|
21
23
|
private static readonly ICE_GATHERING_SAFETY_TIMEOUT_MS;
|
|
22
24
|
private _firstMediaTrackMarked;
|
|
23
25
|
private _timingsCollected;
|
|
26
|
+
private _iceRestartTimeoutId;
|
|
27
|
+
private static readonly ICE_RESTART_TIMEOUT_MS;
|
|
28
|
+
private _hadOfflineEvent;
|
|
29
|
+
private _offlineHandler;
|
|
24
30
|
constructor(type: PeerType, options: IVertoCallOptions, session: BrowserSession, trickleIceSdpFn: (sdp: RTCSessionDescriptionInit) => void, registerPeerEvents: (instance: RTCPeerConnection) => void);
|
|
31
|
+
finishIceRestart(): void;
|
|
25
32
|
get isOffer(): boolean;
|
|
26
33
|
get isAnswer(): boolean;
|
|
27
34
|
get isDebugEnabled(): boolean;
|