@telnyx/webrtc 2.27.0-beta.2 → 2.27.0-beta.3

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.
@@ -30,6 +30,7 @@ export default abstract class BaseSession {
30
30
  protected _reconnectTimeout: any;
31
31
  protected _autoReconnect: boolean;
32
32
  protected _idle: boolean;
33
+ protected _reconnectAttempts: number;
33
34
  private _tokenExpiryTimeout;
34
35
  private static readonly TOKEN_EXPIRY_WARNING_SECONDS;
35
36
  private _executeQueue;
@@ -54,6 +55,7 @@ export default abstract class BaseSession {
54
55
  off(eventName: SwEvent.Notification | 'telnyx.notification', callback?: (event: INotification) => void): this;
55
56
  off(eventName: string, callback?: Function): this;
56
57
  connect(): Promise<void>;
58
+ resetReconnectAttempts(): void;
57
59
  protected _handleLoginError(error: any): void;
58
60
  clearReconnectToken(): void;
59
61
  private _checkTokenExpiry;
@@ -28,6 +28,7 @@ export declare const TELNYX_WARNING_CODES: {
28
28
  readonly HIGH_JITTER: 31002;
29
29
  readonly HIGH_PACKET_LOSS: 31003;
30
30
  readonly LOW_MOS: 31004;
31
+ readonly LOW_LOCAL_AUDIO: 31005;
31
32
  readonly LOW_BYTES_RECEIVED: 32001;
32
33
  readonly LOW_BYTES_SENT: 32002;
33
34
  readonly ICE_CONNECTIVITY_LOST: 33001;
@@ -41,5 +42,5 @@ export declare const TELNYX_WARNING_CODES: {
41
42
  readonly SESSION_NOT_REATTACHED: 35001;
42
43
  };
43
44
  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;
45
+ export declare const HIGH_RTT: 31001, HIGH_JITTER: 31002, HIGH_PACKET_LOSS: 31003, LOW_MOS: 31004, LOW_LOCAL_AUDIO: 31005, 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;
45
46
  export declare const HAS_NON_HOST_ICE_CANDIDATE_REGEX: RegExp;
@@ -40,6 +40,13 @@ export declare const SDK_WARNINGS: {
40
40
  readonly causes: readonly ["Combination of high latency, jitter, and/or packet loss", "Poor network conditions"];
41
41
  readonly solutions: readonly ["Check network connectivity", "Use a wired connection", "Close bandwidth-heavy applications"];
42
42
  };
43
+ readonly 31005: {
44
+ readonly name: "LOW_LOCAL_AUDIO";
45
+ readonly message: "Low local microphone audio detected";
46
+ readonly description: "Local outbound audio level stayed below the acceptable threshold before the microphone produced real audio, or stayed silent for a long continuous window after audio was confirmed. This may indicate that the microphone is not capturing enough audio even while RTP is being sent.";
47
+ readonly causes: readonly ["Microphone input level is too low", "Wrong microphone selected", "Microphone is obstructed or too far from the speaker", "Operating system input gain is muted or very low"];
48
+ readonly solutions: readonly ["Check the selected microphone", "Increase microphone input gain", "Move closer to the microphone", "Verify the microphone is not muted at the operating system or hardware level"];
49
+ };
43
50
  readonly 32001: {
44
51
  readonly name: "LOW_BYTES_RECEIVED";
45
52
  readonly message: "No audio data received";
@@ -33,6 +33,7 @@ export interface IVertoOptions {
33
33
  rtcIp?: string;
34
34
  rtcPort?: number;
35
35
  mutedMicOnStart?: boolean;
36
+ maxReconnectAttempts?: number;
36
37
  enableCallReports?: boolean;
37
38
  callReportInterval?: number;
38
39
  debugLogLevel?: 'debug' | 'info' | 'warn' | 'error';
@@ -9,7 +9,7 @@ declare const streamIsValid: (stream: MediaStream) => boolean;
9
9
  declare const audioIsMediaTrackConstraints: (audio: boolean | MediaTrackConstraints) => boolean;
10
10
  declare const videoIsMediaTrackConstraints: (video: boolean | MediaTrackConstraints) => boolean;
11
11
  declare const attachMediaStream: (tag: any, stream: MediaStream) => void;
12
- declare const detachMediaStream: (tag: any) => void;
12
+ declare const detachMediaStream: (tag: any, stream?: MediaStream) => void;
13
13
  declare const muteMediaElement: (tag: any) => void;
14
14
  declare const unmuteMediaElement: (tag: any) => void;
15
15
  declare const toggleMuteMediaElement: (tag: any) => void;
@@ -5,7 +5,7 @@ declare const _enumerateDevices: () => any;
5
5
  declare const streamIsValid: (stream: MediaStream) => boolean;
6
6
  declare const getSupportedConstraints: () => {};
7
7
  declare const attachMediaStream: (htmlElementId: string, stream: MediaStream) => any;
8
- declare const detachMediaStream: (htmlElementId: string) => any;
8
+ declare const detachMediaStream: (htmlElementId: string, _stream?: MediaStream) => any;
9
9
  declare const muteMediaElement: (htmlElementId: string) => any;
10
10
  declare const unmuteMediaElement: (htmlElementId: string) => any;
11
11
  declare const toggleMuteMediaElement: (htmlElementId: string) => any;
@@ -7,6 +7,7 @@ export interface ICallEstablishmentTimings {
7
7
  delta: number;
8
8
  }>;
9
9
  }
10
- export declare function collectCallEstablishmentTimings(mode: 'trickle' | 'non-trickle', direction: 'outbound' | 'inbound'): ICallEstablishmentTimings;
10
+ export declare function callMarkName(callId: string, suffix: string): string;
11
+ export declare function collectCallEstablishmentTimings(callId: string, mode: 'trickle' | 'non-trickle', direction: 'outbound' | 'inbound'): ICallEstablishmentTimings;
11
12
  export declare function logCallEstablishmentTimings(timings: ICallEstablishmentTimings): void;
12
- export declare function clearCallMarks(): void;
13
+ export declare function clearCallMarks(callId: string): void;
@@ -134,6 +134,8 @@ export declare class CallReportCollector {
134
134
  private intervalBitrates;
135
135
  private previousStats;
136
136
  private previousCandidatePairId;
137
+ private static readonly INITIAL_COLLECTION_INTERVAL_MS;
138
+ private static readonly INITIAL_COLLECTION_DURATION_MS;
137
139
  private readonly MAX_BUFFER_SIZE;
138
140
  private static readonly STATS_FLUSH_THRESHOLD;
139
141
  private static readonly LOGS_FLUSH_THRESHOLD;
@@ -144,6 +146,8 @@ export declare class CallReportCollector {
144
146
  private static readonly THRESHOLD_JITTER_MS;
145
147
  private static readonly THRESHOLD_PACKET_LOSS_PCT;
146
148
  private static readonly THRESHOLD_MOS;
149
+ private static readonly THRESHOLD_LOCAL_AUDIO_LEVEL;
150
+ private static readonly CONFIRMED_LOCAL_AUDIO_SILENCE_MS;
147
151
  private _breachCounters;
148
152
  private _activeWarnings;
149
153
  private _lastWarningEmitted;
@@ -151,8 +155,11 @@ export declare class CallReportCollector {
151
155
  private _prevPacketsReceived;
152
156
  private _prevPacketsLost;
153
157
  private _lastLocalAudioTrackSnapshotJson;
158
+ private _hasConfirmedLocalAudio;
159
+ private _confirmedLocalAudioSilenceMs;
154
160
  private _segmentIndex;
155
161
  private _flushing;
162
+ private _stopped;
156
163
  private static readonly RETRY_DELAY_MS;
157
164
  constructor(options: ICallReportOptions, logCollectorOptions?: ILogCollectorOptions);
158
165
  start(peerConnection: RTCPeerConnection): void;
@@ -164,9 +171,17 @@ export declare class CallReportCollector {
164
171
  getStatsBuffer(): IStatsInterval[];
165
172
  getLogs(): ILogEntry[];
166
173
  cleanup(): void;
174
+ private _scheduleNextCollection;
175
+ private _collectionIntervalFor;
176
+ private _positiveInterval;
167
177
  private _collectStats;
168
178
  private _checkQualityWarnings;
179
+ private _trackLowLocalAudio;
180
+ private _resetLowLocalAudioWarning;
181
+ private _getStatsIntervalDurationMs;
169
182
  private _trackBreach;
183
+ private _emitWarningOncePerEpisode;
184
+ private _emitWarning;
170
185
  private _createStatsEntry;
171
186
  private _resolveCandidate;
172
187
  private _getOutboundMediaSource;
@@ -35,6 +35,7 @@ export interface IClientOptions {
35
35
  env?: Environment;
36
36
  iceServers?: RTCIceServer[];
37
37
  mutedMicOnStart?: boolean;
38
+ maxReconnectAttempts?: number;
38
39
  enableCallReports?: boolean;
39
40
  callReportInterval?: number;
40
41
  mediaPermissionsRecovery?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telnyx/webrtc",
3
- "version": "2.27.0-beta.2",
3
+ "version": "2.27.0-beta.3",
4
4
  "description": "Telnyx WebRTC Client",
5
5
  "keywords": [
6
6
  "telnyx",