@telnyx/webrtc 2.26.4 → 2.27.0-beta.1

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.
@@ -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
  };
@@ -38,6 +39,6 @@ export declare const TELNYX_WARNING_CODES: {
38
39
  readonly TOKEN_EXPIRING_SOON: 34001;
39
40
  readonly SESSION_NOT_REATTACHED: 35001;
40
41
  };
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 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;
42
43
  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
44
  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";
@@ -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;
@@ -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;
@@ -93,3 +93,9 @@ export declare enum GatewayStateType {
93
93
  EXPIRED = "EXPIRED",
94
94
  UNREGISTER = "UNREGISTER"
95
95
  }
96
+ export declare enum VertoModifyAction {
97
+ Hold = "hold",
98
+ Unhold = "unhold",
99
+ ToggleHold = "toggleHold",
100
+ UpdateMedia = "updateMedia"
101
+ }
@@ -16,6 +16,7 @@ export interface IHangupParams {
16
16
  }>;
17
17
  };
18
18
  isRecovering?: boolean;
19
+ initiator?: string;
19
20
  }
20
21
  export interface IVertoCallOptions {
21
22
  destinationNumber?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telnyx/webrtc",
3
- "version": "2.26.4",
3
+ "version": "2.27.0-beta.1",
4
4
  "description": "Telnyx WebRTC Client",
5
5
  "keywords": [
6
6
  "telnyx",