@telnyx/webrtc 2.27.1 → 2.27.2-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.
- package/README.md +27 -0
- package/lib/bundle.js +1 -1
- package/lib/bundle.mjs +1 -1
- package/lib/src/Modules/Verto/BaseSession.d.ts +5 -0
- package/lib/src/Modules/Verto/BrowserSession.d.ts +4 -1
- package/lib/src/Modules/Verto/messages/WebRTCStats.d.ts +1 -1
- package/lib/src/Modules/Verto/services/SignalingHealthMonitor.d.ts +1 -0
- package/lib/src/Modules/Verto/util/constants/errorCodes.d.ts +8 -5
- package/lib/src/Modules/Verto/util/constants/errors.d.ts +227 -2
- package/lib/src/Modules/Verto/util/constants/warnings.d.ts +35 -21
- package/lib/src/Modules/Verto/util/errors.d.ts +3 -1
- package/lib/src/Modules/Verto/util/interfaces/SignalingHealth.d.ts +0 -1
- package/lib/src/Modules/Verto/util/interfaces.d.ts +1 -0
- package/lib/src/Modules/Verto/util/reconnect.d.ts +14 -0
- package/lib/src/Modules/Verto/webrtc/BaseCall.d.ts +9 -0
- package/lib/src/Modules/Verto/webrtc/CallReportCollector.d.ts +126 -1
- package/lib/src/Modules/Verto/webrtc/MediaDeviceCollector.d.ts +11 -0
- package/lib/src/Modules/Verto/webrtc/Peer.d.ts +1 -0
- package/lib/src/Modules/Verto/webrtc/VertoHandler.d.ts +1 -0
- package/lib/src/Modules/Verto/webrtc/constants.d.ts +1 -0
- package/lib/src/Modules/Verto/webrtc/helpers.d.ts +18 -3
- package/lib/src/Modules/Verto/webrtc/interfaces.d.ts +1 -0
- package/lib/src/utils/interfaces.d.ts +1 -0
- package/package.json +1 -1
|
@@ -33,6 +33,8 @@ export default abstract class BaseSession {
|
|
|
33
33
|
protected _autoReconnect: boolean;
|
|
34
34
|
protected _idle: boolean;
|
|
35
35
|
protected _reconnectAttempts: number;
|
|
36
|
+
private _reconnectCountedGeneration;
|
|
37
|
+
protected _intentionalClose: boolean;
|
|
36
38
|
private _tokenExpiryTimeout;
|
|
37
39
|
private static readonly TOKEN_EXPIRY_WARNING_SECONDS;
|
|
38
40
|
private static readonly CALL_REPORT_UPLOAD_DRAIN_TIMEOUT_MS;
|
|
@@ -84,6 +86,7 @@ export default abstract class BaseSession {
|
|
|
84
86
|
reason?: string;
|
|
85
87
|
wasClean?: boolean;
|
|
86
88
|
error?: unknown;
|
|
89
|
+
socketGeneration?: number;
|
|
87
90
|
}): void;
|
|
88
91
|
protected _onSocketMessage(_response: any): void;
|
|
89
92
|
protected _removeSubscription(protocol: string, channel?: string): void;
|
|
@@ -98,12 +101,14 @@ export default abstract class BaseSession {
|
|
|
98
101
|
setPingReceived(): void;
|
|
99
102
|
private _onSocketActivity;
|
|
100
103
|
hasActiveCall(): boolean;
|
|
104
|
+
_terminateActiveCallsLocally(): void;
|
|
101
105
|
startSignalingHealthMonitor(): void;
|
|
102
106
|
stopSignalingHealthMonitor(): void;
|
|
103
107
|
triggerIceRestart(callId: string): TriggerIceRestartResult;
|
|
104
108
|
onSignalingRequestTimeout(requestId: string, timeoutMs: number, method?: string): void;
|
|
105
109
|
reportPeerFailure(callId: string, evidence: PeerFailureEvidence): void;
|
|
106
110
|
reportNoRtp(callId: string, direction: 'inbound' | 'outbound'): void;
|
|
111
|
+
reportIceRestartFailed(callId: string): void;
|
|
107
112
|
static on(eventName: string, callback: any): void;
|
|
108
113
|
static off(eventName: string): void;
|
|
109
114
|
static uuid(): string;
|
|
@@ -6,6 +6,10 @@ export default abstract class BrowserSession extends BaseSession {
|
|
|
6
6
|
calls: {
|
|
7
7
|
[callId: string]: IWebRTCCall;
|
|
8
8
|
};
|
|
9
|
+
private static readonly ACTIVE_CALL_STATE_NAMES;
|
|
10
|
+
getActiveCalls(): IWebRTCCall[];
|
|
11
|
+
private _extractSafeCallIdentifiers;
|
|
12
|
+
emitMultipleActiveCallsWarning(newCallId: string): void;
|
|
9
13
|
micId: string;
|
|
10
14
|
micLabel: string;
|
|
11
15
|
camId: string;
|
|
@@ -25,7 +29,6 @@ export default abstract class BrowserSession extends BaseSession {
|
|
|
25
29
|
private _offlineHandler;
|
|
26
30
|
private _wasOffline;
|
|
27
31
|
constructor(options: IVertoOptions);
|
|
28
|
-
get reconnectDelay(): number;
|
|
29
32
|
getIsRegistered(): Promise<boolean>;
|
|
30
33
|
connect(): Promise<void>;
|
|
31
34
|
checkPermissions(audio?: boolean, video?: boolean): Promise<boolean>;
|
|
@@ -6,5 +6,5 @@ export declare class DebugReportStopMessage extends BaseMessage {
|
|
|
6
6
|
constructor(id: string, callID: string);
|
|
7
7
|
}
|
|
8
8
|
export declare class DebugReportDataMessage extends BaseMessage {
|
|
9
|
-
constructor(id: string, data:
|
|
9
|
+
constructor(id: string, callID: string, data: unknown);
|
|
10
10
|
}
|
|
@@ -19,6 +19,7 @@ export default class SignalingHealthMonitor {
|
|
|
19
19
|
onRequestTimeout(requestId: string, timeoutMs: number, method?: string): void;
|
|
20
20
|
onPeerFailure(callId: string, evidence: PeerFailureEvidence): void;
|
|
21
21
|
onNoRtp(callId: string, direction: 'inbound' | 'outbound'): void;
|
|
22
|
+
onIceRestartFailed(callId: string): void;
|
|
22
23
|
private _check;
|
|
23
24
|
private _sendProbe;
|
|
24
25
|
private _recoverMediaOrSignaling;
|
|
@@ -21,6 +21,7 @@ export declare const TELNYX_ERROR_CODES: {
|
|
|
21
21
|
readonly AUTHENTICATION_REQUIRED: 46003;
|
|
22
22
|
readonly ICE_RESTART_FAILED: 47001;
|
|
23
23
|
readonly NETWORK_OFFLINE: 48001;
|
|
24
|
+
readonly SESSION_NOT_REATTACHED: 48501;
|
|
24
25
|
readonly UNEXPECTED_ERROR: 49001;
|
|
25
26
|
};
|
|
26
27
|
export declare const TELNYX_WARNING_CODES: {
|
|
@@ -29,6 +30,7 @@ export declare const TELNYX_WARNING_CODES: {
|
|
|
29
30
|
readonly HIGH_PACKET_LOSS: 31003;
|
|
30
31
|
readonly LOW_MOS: 31004;
|
|
31
32
|
readonly LOW_LOCAL_AUDIO: 31005;
|
|
33
|
+
readonly LOW_INBOUND_AUDIO: 31006;
|
|
32
34
|
readonly LOW_BYTES_RECEIVED: 32001;
|
|
33
35
|
readonly LOW_BYTES_SENT: 32002;
|
|
34
36
|
readonly ICE_CONNECTIVITY_LOST: 33001;
|
|
@@ -38,14 +40,15 @@ export declare const TELNYX_WARNING_CODES: {
|
|
|
38
40
|
readonly ONLY_HOST_ICE_CANDIDATES: 33005;
|
|
39
41
|
readonly ANSWER_WHILE_PEER_ACTIVE: 33006;
|
|
40
42
|
readonly ICE_CANDIDATE_PAIR_CHANGED: 33008;
|
|
43
|
+
readonly AUDIO_INPUT_DEVICE_CHANGE_SKIPPED: 33009;
|
|
44
|
+
readonly MULTIPLE_ACTIVE_CALLS_DETECTED: 33010;
|
|
41
45
|
readonly DUPLICATE_INBOUND_ANSWER: 33007;
|
|
42
46
|
readonly TOKEN_EXPIRING_SOON: 34001;
|
|
43
|
-
readonly
|
|
44
|
-
readonly SIGNALING_HEALTH_PROBE_TIMEOUT: 36001;
|
|
45
|
-
readonly SIGNALING_REQUEST_TIMEOUT: 36002;
|
|
47
|
+
readonly UNKNOWN_REATTACHED_SESSION: 35002;
|
|
46
48
|
readonly SIGNALING_RECOVERY_REQUIRED: 36003;
|
|
47
49
|
readonly MEDIA_RECOVERY_REQUIRED: 36004;
|
|
50
|
+
readonly RECONNECTION_FAILED_WITH_NO_AUTO_RECONNECT: 36005;
|
|
48
51
|
};
|
|
49
|
-
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;
|
|
50
|
-
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, ICE_CANDIDATE_PAIR_CHANGED: 33008,
|
|
52
|
+
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, SESSION_NOT_REATTACHED: 48501, UNEXPECTED_ERROR: 49001;
|
|
53
|
+
export declare const HIGH_RTT: 31001, HIGH_JITTER: 31002, HIGH_PACKET_LOSS: 31003, LOW_MOS: 31004, LOW_LOCAL_AUDIO: 31005, LOW_INBOUND_AUDIO: 31006, 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, ICE_CANDIDATE_PAIR_CHANGED: 33008, AUDIO_INPUT_DEVICE_CHANGE_SKIPPED: 33009, MULTIPLE_ACTIVE_CALLS_DETECTED: 33010, DUPLICATE_INBOUND_ANSWER: 33007, TOKEN_EXPIRING_SOON: 34001, UNKNOWN_REATTACHED_SESSION: 35002, SIGNALING_RECOVERY_REQUIRED: 36003, MEDIA_RECOVERY_REQUIRED: 36004, RECONNECTION_FAILED_WITH_NO_AUTO_RECONNECT: 36005;
|
|
51
54
|
export declare const HAS_NON_HOST_ICE_CANDIDATE_REGEX: RegExp;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const _SDK_ERRORS: {
|
|
2
2
|
readonly 40001: {
|
|
3
3
|
readonly name: "SDP_CREATE_OFFER_FAILED";
|
|
4
4
|
readonly message: "Failed to create call offer";
|
|
5
5
|
readonly description: "The browser was unable to generate a local SDP offer. This typically indicates a WebRTC API error or invalid media constraints.";
|
|
6
6
|
readonly causes: readonly ["Browser WebRTC API error", "Missing or invalid media constraints"];
|
|
7
7
|
readonly solutions: readonly ["Check getUserMedia permissions", "Verify ICE server configuration"];
|
|
8
|
+
readonly fatal: true;
|
|
8
9
|
};
|
|
9
10
|
readonly 40002: {
|
|
10
11
|
readonly name: "SDP_CREATE_ANSWER_FAILED";
|
|
@@ -12,6 +13,7 @@ export declare const SDK_ERRORS: {
|
|
|
12
13
|
readonly description: "The browser was unable to generate a local SDP answer. The remote offer may be invalid or the browser state inconsistent.";
|
|
13
14
|
readonly causes: readonly ["Browser WebRTC API error", "Invalid remote SDP offer"];
|
|
14
15
|
readonly solutions: readonly ["Retry the call", "Check browser WebRTC compatibility"];
|
|
16
|
+
readonly fatal: true;
|
|
15
17
|
};
|
|
16
18
|
readonly 40003: {
|
|
17
19
|
readonly name: "SDP_SET_LOCAL_DESCRIPTION_FAILED";
|
|
@@ -19,6 +21,7 @@ export declare const SDK_ERRORS: {
|
|
|
19
21
|
readonly description: "setLocalDescription() was rejected by the browser. The generated SDP may be malformed or the browser state may be inconsistent.";
|
|
20
22
|
readonly causes: readonly ["Malformed SDP", "Browser state inconsistency"];
|
|
21
23
|
readonly solutions: readonly ["Retry the call"];
|
|
24
|
+
readonly fatal: true;
|
|
22
25
|
};
|
|
23
26
|
readonly 40004: {
|
|
24
27
|
readonly name: "SDP_SET_REMOTE_DESCRIPTION_FAILED";
|
|
@@ -26,6 +29,7 @@ export declare const SDK_ERRORS: {
|
|
|
26
29
|
readonly description: "setRemoteDescription() was rejected by the browser. The remote SDP may be malformed or contain unsupported codecs.";
|
|
27
30
|
readonly causes: readonly ["Malformed remote SDP", "Browser codec mismatch"];
|
|
28
31
|
readonly solutions: readonly ["Retry the call", "Check codec configuration"];
|
|
32
|
+
readonly fatal: true;
|
|
29
33
|
};
|
|
30
34
|
readonly 40005: {
|
|
31
35
|
readonly name: "SDP_SEND_FAILED";
|
|
@@ -33,6 +37,7 @@ export declare const SDK_ERRORS: {
|
|
|
33
37
|
readonly description: "The Invite or Answer message could not be delivered via the signaling WebSocket. The connection may have been lost.";
|
|
34
38
|
readonly causes: readonly ["WebSocket connection lost", "Server error"];
|
|
35
39
|
readonly solutions: readonly ["Check network connectivity", "Retry the call"];
|
|
40
|
+
readonly fatal: true;
|
|
36
41
|
};
|
|
37
42
|
readonly 42001: {
|
|
38
43
|
readonly name: "MEDIA_MICROPHONE_PERMISSION_DENIED";
|
|
@@ -40,6 +45,7 @@ export declare const SDK_ERRORS: {
|
|
|
40
45
|
readonly description: "The user or operating system denied microphone permission. The browser permission prompt was dismissed or OS-level access is disabled.";
|
|
41
46
|
readonly causes: readonly ["User denied browser permission prompt", "OS-level microphone access disabled"];
|
|
42
47
|
readonly solutions: readonly ["Ask user to grant microphone permission in browser settings"];
|
|
48
|
+
readonly fatal: true;
|
|
43
49
|
};
|
|
44
50
|
readonly 42002: {
|
|
45
51
|
readonly name: "MEDIA_DEVICE_NOT_FOUND";
|
|
@@ -47,6 +53,7 @@ export declare const SDK_ERRORS: {
|
|
|
47
53
|
readonly description: "The requested audio input device is not available. No microphone is connected, the device was disconnected, or an invalid deviceId was specified.";
|
|
48
54
|
readonly causes: readonly ["No microphone connected", "Device was disconnected", "Invalid deviceId"];
|
|
49
55
|
readonly solutions: readonly ["Check that a microphone is connected", "Select a valid audio input device"];
|
|
56
|
+
readonly fatal: true;
|
|
50
57
|
};
|
|
51
58
|
readonly 42003: {
|
|
52
59
|
readonly name: "MEDIA_GET_USER_MEDIA_FAILED";
|
|
@@ -54,6 +61,39 @@ export declare const SDK_ERRORS: {
|
|
|
54
61
|
readonly description: "getUserMedia() was rejected for an unexpected reason. The device may be in use by another application or the browser encountered an internal error.";
|
|
55
62
|
readonly causes: readonly ["Browser error", "Device in use by another application"];
|
|
56
63
|
readonly solutions: readonly ["Close other applications using the microphone", "Retry"];
|
|
64
|
+
readonly fatal: true;
|
|
65
|
+
};
|
|
66
|
+
readonly 44001: {
|
|
67
|
+
readonly name: "HOLD_FAILED";
|
|
68
|
+
readonly message: "Failed to hold the call";
|
|
69
|
+
readonly description: "The server rejected or did not respond to the hold request. The WebSocket connection may have been lost during the operation.";
|
|
70
|
+
readonly causes: readonly ["Server error", "WebSocket connection lost during hold"];
|
|
71
|
+
readonly solutions: readonly ["Retry the hold operation", "Check network connectivity"];
|
|
72
|
+
readonly fatal: false;
|
|
73
|
+
};
|
|
74
|
+
readonly 44002: {
|
|
75
|
+
readonly name: "INVALID_CALL_PARAMETERS";
|
|
76
|
+
readonly message: "Invalid call parameters";
|
|
77
|
+
readonly description: "The call could not be initiated because required parameters are missing or invalid. For example, no destination number was provided to newCall().";
|
|
78
|
+
readonly causes: readonly ["Missing destinationNumber in call options", "Invalid or empty call parameters"];
|
|
79
|
+
readonly solutions: readonly ["Provide a valid destinationNumber when calling newCall()", "Check the call options object for required fields"];
|
|
80
|
+
readonly fatal: true;
|
|
81
|
+
};
|
|
82
|
+
readonly 44003: {
|
|
83
|
+
readonly name: "BYE_SEND_FAILED";
|
|
84
|
+
readonly message: "Failed to hang up cleanly";
|
|
85
|
+
readonly description: "The hangup signal could not be delivered to the server. The call was terminated locally but the server may not be aware.";
|
|
86
|
+
readonly causes: readonly ["WebSocket connection lost before BYE sent"];
|
|
87
|
+
readonly solutions: readonly ["No action needed — call is terminated locally", "Check network connectivity"];
|
|
88
|
+
readonly fatal: false;
|
|
89
|
+
};
|
|
90
|
+
readonly 44004: {
|
|
91
|
+
readonly name: "SUBSCRIBE_FAILED";
|
|
92
|
+
readonly message: "Failed to subscribe to call events";
|
|
93
|
+
readonly description: "The Verto subscribe request for the call channel failed. This may prevent receiving call state updates from the server.";
|
|
94
|
+
readonly causes: readonly ["WebSocket connection lost during subscribe", "Server rejected the subscription request"];
|
|
95
|
+
readonly solutions: readonly ["Check network connectivity", "Retry the call"];
|
|
96
|
+
readonly fatal: false;
|
|
57
97
|
};
|
|
58
98
|
readonly 44005: {
|
|
59
99
|
readonly name: "PEER_CLOSED_DURING_INIT";
|
|
@@ -61,6 +101,161 @@ export declare const SDK_ERRORS: {
|
|
|
61
101
|
readonly description: "The PeerConnection was closed (e.g. by hangup()) while peer.init() was still running. This is a race condition: an async operation such as setRemoteDescription, getUserMedia, or the media recovery flow yielded control, and close() ran during that gap. The init() cannot continue because the underlying RTCPeerConnection has been destroyed.";
|
|
62
102
|
readonly causes: readonly ["call.hangup() or call.close() was called while the call was still setting up", "A WebSocket Bye message arrived during getUserMedia prompt or SDP negotiation", "User clicked hangup/decline before media permissions were granted"];
|
|
63
103
|
readonly solutions: readonly ["This is expected if the user intentionally hung up during setup — no action needed", "If this happens frequently without user action, check for automatic hangup triggers that may fire too early"];
|
|
104
|
+
readonly fatal: true;
|
|
105
|
+
};
|
|
106
|
+
readonly 45001: {
|
|
107
|
+
readonly name: "WEBSOCKET_CONNECTION_FAILED";
|
|
108
|
+
readonly message: "Unable to connect to server";
|
|
109
|
+
readonly description: "The WebSocket connection to the signaling server could not be established. The server may be unreachable, the URL may be incorrect, or a firewall may be blocking the connection.";
|
|
110
|
+
readonly causes: readonly ["Server unreachable", "Incorrect WebSocket URL", "Firewall blocking WebSocket connections", "Network interruption"];
|
|
111
|
+
readonly solutions: readonly ["Check network connectivity", "Verify the signaling server URL", "Ensure WebSocket connections are not blocked by a firewall"];
|
|
112
|
+
readonly fatal: true;
|
|
113
|
+
};
|
|
114
|
+
readonly 45002: {
|
|
115
|
+
readonly name: "WEBSOCKET_ERROR";
|
|
116
|
+
readonly message: "Connection to server lost";
|
|
117
|
+
readonly description: "An error occurred on the WebSocket connection after it was established. The connection may have been dropped due to network issues or server-side closure.";
|
|
118
|
+
readonly causes: readonly ["Network interruption", "Server closed the connection", "Idle timeout"];
|
|
119
|
+
readonly solutions: readonly ["Check network connectivity", "SDK will attempt automatic reconnection if configured"];
|
|
120
|
+
readonly fatal: false;
|
|
121
|
+
};
|
|
122
|
+
readonly 45003: {
|
|
123
|
+
readonly name: "RECONNECTION_EXHAUSTED";
|
|
124
|
+
readonly message: "Unable to reconnect to server";
|
|
125
|
+
readonly description: "All automatic reconnection attempts have been exhausted. The SDK tried to re-establish the WebSocket connection multiple times but failed on every attempt.";
|
|
126
|
+
readonly causes: readonly ["Prolonged network outage", "Server unreachable", "Firewall or proxy blocking reconnection"];
|
|
127
|
+
readonly solutions: readonly ["Check network connectivity", "Call client.disconnect() and client.connect() to manually retry", "Notify the user that the connection was lost"];
|
|
128
|
+
readonly fatal: true;
|
|
129
|
+
};
|
|
130
|
+
readonly 45004: {
|
|
131
|
+
readonly name: "GATEWAY_FAILED";
|
|
132
|
+
readonly message: "Gateway connection failed";
|
|
133
|
+
readonly description: "The upstream gateway reported a FAILED, FAIL_WAIT, or TIMEOUT state. The signaling server could not establish or maintain a connection to the gateway. When autoReconnect is disabled, this is immediately fatal. When enabled, the SDK will retry until RECONNECTION_EXHAUSTED.";
|
|
134
|
+
readonly causes: readonly ["Gateway down or unreachable", "Server-side infrastructure issue", "Network partition between signaling server and gateway"];
|
|
135
|
+
readonly solutions: readonly ["Wait for automatic reconnection (if autoReconnect is enabled)", "Call client.disconnect() and client.connect() to manually retry", "Check Telnyx service status"];
|
|
136
|
+
readonly fatal: false;
|
|
137
|
+
};
|
|
138
|
+
readonly 46001: {
|
|
139
|
+
readonly name: "LOGIN_FAILED";
|
|
140
|
+
readonly message: "Authentication failed";
|
|
141
|
+
readonly description: "The login request was rejected by the server. The credentials may be invalid, expired, or the account may be suspended.";
|
|
142
|
+
readonly causes: readonly ["Invalid credentials (username/password or token)", "Expired authentication token", "Account suspended or disabled"];
|
|
143
|
+
readonly solutions: readonly ["Verify credentials", "Generate a new authentication token", "Check account status"];
|
|
144
|
+
readonly fatal: true;
|
|
145
|
+
};
|
|
146
|
+
readonly 46002: {
|
|
147
|
+
readonly name: "INVALID_CREDENTIALS";
|
|
148
|
+
readonly message: "Invalid credential parameters";
|
|
149
|
+
readonly description: "The SDK rejected the login options before sending any request to the server. This is an internal client-side validation guard — the credentials object is missing required fields or has an invalid structure. No network request was made.";
|
|
150
|
+
readonly causes: readonly ["Missing login and password fields", "Missing or malformed authentication token", "Invalid combination of credential fields in the options object"];
|
|
151
|
+
readonly solutions: readonly ["Provide valid login/password or a valid authentication token", "Check the TelnyxRTC constructor options against the documentation", "Ensure the credential object matches one of the supported auth modes (credentials, token, or anonymous)"];
|
|
152
|
+
readonly fatal: true;
|
|
153
|
+
};
|
|
154
|
+
readonly 46003: {
|
|
155
|
+
readonly name: "AUTHENTICATION_REQUIRED";
|
|
156
|
+
readonly message: "Authentication required";
|
|
157
|
+
readonly description: "The server rejected a request because the session is not authenticated. This can happen when the client sends a message (e.g. Invite, Subscribe, or Ping) before login completes, after a token expires mid-session, or after the server drops the authenticated state for any reason.";
|
|
158
|
+
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"];
|
|
159
|
+
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"];
|
|
160
|
+
readonly fatal: false;
|
|
161
|
+
};
|
|
162
|
+
readonly 47001: {
|
|
163
|
+
readonly name: "ICE_RESTART_FAILED";
|
|
164
|
+
readonly message: "ICE restart failed";
|
|
165
|
+
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.";
|
|
166
|
+
readonly causes: readonly ["WebSocket connection lost during ICE restart", "Server rejected the Modify request", "Timeout waiting for server response"];
|
|
167
|
+
readonly solutions: readonly ["The call may recover via WebSocket reconnect + Attach", "If the call does not recover, hang up and retry"];
|
|
168
|
+
readonly fatal: false;
|
|
169
|
+
};
|
|
170
|
+
readonly 48001: {
|
|
171
|
+
readonly name: "NETWORK_OFFLINE";
|
|
172
|
+
readonly message: "Device is offline";
|
|
173
|
+
readonly description: "The browser reported that the device has lost network connectivity (navigator.onLine === false). All WebSocket and media connections will fail until the network is restored.";
|
|
174
|
+
readonly causes: readonly ["Wi-Fi or ethernet disconnected", "Airplane mode enabled", "Network interface went down"];
|
|
175
|
+
readonly solutions: readonly ["Check network connectivity", "Reconnect to Wi-Fi or ethernet", "Disable airplane mode"];
|
|
176
|
+
readonly fatal: false;
|
|
177
|
+
};
|
|
178
|
+
readonly 48501: {
|
|
179
|
+
readonly name: "SESSION_NOT_REATTACHED";
|
|
180
|
+
readonly message: "Active call lost after reconnect";
|
|
181
|
+
readonly description: "The WebSocket reconnected successfully but the server did not reattach the active call session. The server no longer knows about the call, so any subsequent call-control operation (hangup, hold, etc.) will fail with CALL_DOES_NOT_EXIST. The call is unrecoverable and must be terminated locally.";
|
|
182
|
+
readonly causes: readonly ["Server-side session expired during the disconnection window", "Reconnect token was invalidated", "Backend restarted or lost in-memory call state"];
|
|
183
|
+
readonly solutions: readonly ["Terminate the local call and notify the user", "Start a new call", "Investigate why the session was not preserved on the server"];
|
|
184
|
+
readonly fatal: true;
|
|
185
|
+
};
|
|
186
|
+
readonly 49001: {
|
|
187
|
+
readonly name: "UNEXPECTED_ERROR";
|
|
188
|
+
readonly message: "An unexpected error occurred";
|
|
189
|
+
readonly description: "An error was thrown that does not match any known SDK error category. This is a catch-all for unclassified failures.";
|
|
190
|
+
readonly causes: readonly ["Unknown or unhandled error condition"];
|
|
191
|
+
readonly solutions: readonly ["Check the originalError property for the underlying cause", "Report the issue if it persists"];
|
|
192
|
+
readonly fatal: true;
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
export declare const SDK_ERRORS: {
|
|
196
|
+
readonly 40001: {
|
|
197
|
+
readonly name: "SDP_CREATE_OFFER_FAILED";
|
|
198
|
+
readonly message: "Failed to create call offer";
|
|
199
|
+
readonly description: "The browser was unable to generate a local SDP offer. This typically indicates a WebRTC API error or invalid media constraints.";
|
|
200
|
+
readonly causes: readonly ["Browser WebRTC API error", "Missing or invalid media constraints"];
|
|
201
|
+
readonly solutions: readonly ["Check getUserMedia permissions", "Verify ICE server configuration"];
|
|
202
|
+
readonly fatal: true;
|
|
203
|
+
};
|
|
204
|
+
readonly 40002: {
|
|
205
|
+
readonly name: "SDP_CREATE_ANSWER_FAILED";
|
|
206
|
+
readonly message: "Failed to answer the call";
|
|
207
|
+
readonly description: "The browser was unable to generate a local SDP answer. The remote offer may be invalid or the browser state inconsistent.";
|
|
208
|
+
readonly causes: readonly ["Browser WebRTC API error", "Invalid remote SDP offer"];
|
|
209
|
+
readonly solutions: readonly ["Retry the call", "Check browser WebRTC compatibility"];
|
|
210
|
+
readonly fatal: true;
|
|
211
|
+
};
|
|
212
|
+
readonly 40003: {
|
|
213
|
+
readonly name: "SDP_SET_LOCAL_DESCRIPTION_FAILED";
|
|
214
|
+
readonly message: "Failed to apply local call settings";
|
|
215
|
+
readonly description: "setLocalDescription() was rejected by the browser. The generated SDP may be malformed or the browser state may be inconsistent.";
|
|
216
|
+
readonly causes: readonly ["Malformed SDP", "Browser state inconsistency"];
|
|
217
|
+
readonly solutions: readonly ["Retry the call"];
|
|
218
|
+
readonly fatal: true;
|
|
219
|
+
};
|
|
220
|
+
readonly 40004: {
|
|
221
|
+
readonly name: "SDP_SET_REMOTE_DESCRIPTION_FAILED";
|
|
222
|
+
readonly message: "Failed to apply remote call settings";
|
|
223
|
+
readonly description: "setRemoteDescription() was rejected by the browser. The remote SDP may be malformed or contain unsupported codecs.";
|
|
224
|
+
readonly causes: readonly ["Malformed remote SDP", "Browser codec mismatch"];
|
|
225
|
+
readonly solutions: readonly ["Retry the call", "Check codec configuration"];
|
|
226
|
+
readonly fatal: true;
|
|
227
|
+
};
|
|
228
|
+
readonly 40005: {
|
|
229
|
+
readonly name: "SDP_SEND_FAILED";
|
|
230
|
+
readonly message: "Failed to send call data to server";
|
|
231
|
+
readonly description: "The Invite or Answer message could not be delivered via the signaling WebSocket. The connection may have been lost.";
|
|
232
|
+
readonly causes: readonly ["WebSocket connection lost", "Server error"];
|
|
233
|
+
readonly solutions: readonly ["Check network connectivity", "Retry the call"];
|
|
234
|
+
readonly fatal: true;
|
|
235
|
+
};
|
|
236
|
+
readonly 42001: {
|
|
237
|
+
readonly name: "MEDIA_MICROPHONE_PERMISSION_DENIED";
|
|
238
|
+
readonly message: "Microphone access denied";
|
|
239
|
+
readonly description: "The user or operating system denied microphone permission. The browser permission prompt was dismissed or OS-level access is disabled.";
|
|
240
|
+
readonly causes: readonly ["User denied browser permission prompt", "OS-level microphone access disabled"];
|
|
241
|
+
readonly solutions: readonly ["Ask user to grant microphone permission in browser settings"];
|
|
242
|
+
readonly fatal: true;
|
|
243
|
+
};
|
|
244
|
+
readonly 42002: {
|
|
245
|
+
readonly name: "MEDIA_DEVICE_NOT_FOUND";
|
|
246
|
+
readonly message: "No microphone found";
|
|
247
|
+
readonly description: "The requested audio input device is not available. No microphone is connected, the device was disconnected, or an invalid deviceId was specified.";
|
|
248
|
+
readonly causes: readonly ["No microphone connected", "Device was disconnected", "Invalid deviceId"];
|
|
249
|
+
readonly solutions: readonly ["Check that a microphone is connected", "Select a valid audio input device"];
|
|
250
|
+
readonly fatal: true;
|
|
251
|
+
};
|
|
252
|
+
readonly 42003: {
|
|
253
|
+
readonly name: "MEDIA_GET_USER_MEDIA_FAILED";
|
|
254
|
+
readonly message: "Failed to access microphone";
|
|
255
|
+
readonly description: "getUserMedia() was rejected for an unexpected reason. The device may be in use by another application or the browser encountered an internal error.";
|
|
256
|
+
readonly causes: readonly ["Browser error", "Device in use by another application"];
|
|
257
|
+
readonly solutions: readonly ["Close other applications using the microphone", "Retry"];
|
|
258
|
+
readonly fatal: true;
|
|
64
259
|
};
|
|
65
260
|
readonly 44001: {
|
|
66
261
|
readonly name: "HOLD_FAILED";
|
|
@@ -68,6 +263,7 @@ export declare const SDK_ERRORS: {
|
|
|
68
263
|
readonly description: "The server rejected or did not respond to the hold request. The WebSocket connection may have been lost during the operation.";
|
|
69
264
|
readonly causes: readonly ["Server error", "WebSocket connection lost during hold"];
|
|
70
265
|
readonly solutions: readonly ["Retry the hold operation", "Check network connectivity"];
|
|
266
|
+
readonly fatal: false;
|
|
71
267
|
};
|
|
72
268
|
readonly 44002: {
|
|
73
269
|
readonly name: "INVALID_CALL_PARAMETERS";
|
|
@@ -75,6 +271,7 @@ export declare const SDK_ERRORS: {
|
|
|
75
271
|
readonly description: "The call could not be initiated because required parameters are missing or invalid. For example, no destination number was provided to newCall().";
|
|
76
272
|
readonly causes: readonly ["Missing destinationNumber in call options", "Invalid or empty call parameters"];
|
|
77
273
|
readonly solutions: readonly ["Provide a valid destinationNumber when calling newCall()", "Check the call options object for required fields"];
|
|
274
|
+
readonly fatal: true;
|
|
78
275
|
};
|
|
79
276
|
readonly 44003: {
|
|
80
277
|
readonly name: "BYE_SEND_FAILED";
|
|
@@ -82,6 +279,7 @@ export declare const SDK_ERRORS: {
|
|
|
82
279
|
readonly description: "The hangup signal could not be delivered to the server. The call was terminated locally but the server may not be aware.";
|
|
83
280
|
readonly causes: readonly ["WebSocket connection lost before BYE sent"];
|
|
84
281
|
readonly solutions: readonly ["No action needed — call is terminated locally", "Check network connectivity"];
|
|
282
|
+
readonly fatal: false;
|
|
85
283
|
};
|
|
86
284
|
readonly 44004: {
|
|
87
285
|
readonly name: "SUBSCRIBE_FAILED";
|
|
@@ -89,6 +287,15 @@ export declare const SDK_ERRORS: {
|
|
|
89
287
|
readonly description: "The Verto subscribe request for the call channel failed. This may prevent receiving call state updates from the server.";
|
|
90
288
|
readonly causes: readonly ["WebSocket connection lost during subscribe", "Server rejected the subscription request"];
|
|
91
289
|
readonly solutions: readonly ["Check network connectivity", "Retry the call"];
|
|
290
|
+
readonly fatal: false;
|
|
291
|
+
};
|
|
292
|
+
readonly 44005: {
|
|
293
|
+
readonly name: "PEER_CLOSED_DURING_INIT";
|
|
294
|
+
readonly message: "Call was closed during setup";
|
|
295
|
+
readonly description: "The PeerConnection was closed (e.g. by hangup()) while peer.init() was still running. This is a race condition: an async operation such as setRemoteDescription, getUserMedia, or the media recovery flow yielded control, and close() ran during that gap. The init() cannot continue because the underlying RTCPeerConnection has been destroyed.";
|
|
296
|
+
readonly causes: readonly ["call.hangup() or call.close() was called while the call was still setting up", "A WebSocket Bye message arrived during getUserMedia prompt or SDP negotiation", "User clicked hangup/decline before media permissions were granted"];
|
|
297
|
+
readonly solutions: readonly ["This is expected if the user intentionally hung up during setup — no action needed", "If this happens frequently without user action, check for automatic hangup triggers that may fire too early"];
|
|
298
|
+
readonly fatal: true;
|
|
92
299
|
};
|
|
93
300
|
readonly 45001: {
|
|
94
301
|
readonly name: "WEBSOCKET_CONNECTION_FAILED";
|
|
@@ -96,6 +303,7 @@ export declare const SDK_ERRORS: {
|
|
|
96
303
|
readonly description: "The WebSocket connection to the signaling server could not be established. The server may be unreachable, the URL may be incorrect, or a firewall may be blocking the connection.";
|
|
97
304
|
readonly causes: readonly ["Server unreachable", "Incorrect WebSocket URL", "Firewall blocking WebSocket connections", "Network interruption"];
|
|
98
305
|
readonly solutions: readonly ["Check network connectivity", "Verify the signaling server URL", "Ensure WebSocket connections are not blocked by a firewall"];
|
|
306
|
+
readonly fatal: true;
|
|
99
307
|
};
|
|
100
308
|
readonly 45002: {
|
|
101
309
|
readonly name: "WEBSOCKET_ERROR";
|
|
@@ -103,6 +311,7 @@ export declare const SDK_ERRORS: {
|
|
|
103
311
|
readonly description: "An error occurred on the WebSocket connection after it was established. The connection may have been dropped due to network issues or server-side closure.";
|
|
104
312
|
readonly causes: readonly ["Network interruption", "Server closed the connection", "Idle timeout"];
|
|
105
313
|
readonly solutions: readonly ["Check network connectivity", "SDK will attempt automatic reconnection if configured"];
|
|
314
|
+
readonly fatal: false;
|
|
106
315
|
};
|
|
107
316
|
readonly 45003: {
|
|
108
317
|
readonly name: "RECONNECTION_EXHAUSTED";
|
|
@@ -110,13 +319,15 @@ export declare const SDK_ERRORS: {
|
|
|
110
319
|
readonly description: "All automatic reconnection attempts have been exhausted. The SDK tried to re-establish the WebSocket connection multiple times but failed on every attempt.";
|
|
111
320
|
readonly causes: readonly ["Prolonged network outage", "Server unreachable", "Firewall or proxy blocking reconnection"];
|
|
112
321
|
readonly solutions: readonly ["Check network connectivity", "Call client.disconnect() and client.connect() to manually retry", "Notify the user that the connection was lost"];
|
|
322
|
+
readonly fatal: true;
|
|
113
323
|
};
|
|
114
324
|
readonly 45004: {
|
|
115
325
|
readonly name: "GATEWAY_FAILED";
|
|
116
326
|
readonly message: "Gateway connection failed";
|
|
117
|
-
readonly description: "The upstream gateway reported a FAILED or
|
|
327
|
+
readonly description: "The upstream gateway reported a FAILED, FAIL_WAIT, or TIMEOUT state. The signaling server could not establish or maintain a connection to the gateway. When autoReconnect is disabled, this is immediately fatal. When enabled, the SDK will retry until RECONNECTION_EXHAUSTED.";
|
|
118
328
|
readonly causes: readonly ["Gateway down or unreachable", "Server-side infrastructure issue", "Network partition between signaling server and gateway"];
|
|
119
329
|
readonly solutions: readonly ["Wait for automatic reconnection (if autoReconnect is enabled)", "Call client.disconnect() and client.connect() to manually retry", "Check Telnyx service status"];
|
|
330
|
+
readonly fatal: false;
|
|
120
331
|
};
|
|
121
332
|
readonly 46001: {
|
|
122
333
|
readonly name: "LOGIN_FAILED";
|
|
@@ -124,6 +335,7 @@ export declare const SDK_ERRORS: {
|
|
|
124
335
|
readonly description: "The login request was rejected by the server. The credentials may be invalid, expired, or the account may be suspended.";
|
|
125
336
|
readonly causes: readonly ["Invalid credentials (username/password or token)", "Expired authentication token", "Account suspended or disabled"];
|
|
126
337
|
readonly solutions: readonly ["Verify credentials", "Generate a new authentication token", "Check account status"];
|
|
338
|
+
readonly fatal: true;
|
|
127
339
|
};
|
|
128
340
|
readonly 46002: {
|
|
129
341
|
readonly name: "INVALID_CREDENTIALS";
|
|
@@ -131,6 +343,7 @@ export declare const SDK_ERRORS: {
|
|
|
131
343
|
readonly description: "The SDK rejected the login options before sending any request to the server. This is an internal client-side validation guard — the credentials object is missing required fields or has an invalid structure. No network request was made.";
|
|
132
344
|
readonly causes: readonly ["Missing login and password fields", "Missing or malformed authentication token", "Invalid combination of credential fields in the options object"];
|
|
133
345
|
readonly solutions: readonly ["Provide valid login/password or a valid authentication token", "Check the TelnyxRTC constructor options against the documentation", "Ensure the credential object matches one of the supported auth modes (credentials, token, or anonymous)"];
|
|
346
|
+
readonly fatal: true;
|
|
134
347
|
};
|
|
135
348
|
readonly 46003: {
|
|
136
349
|
readonly name: "AUTHENTICATION_REQUIRED";
|
|
@@ -138,6 +351,7 @@ export declare const SDK_ERRORS: {
|
|
|
138
351
|
readonly description: "The server rejected a request because the session is not authenticated. This can happen when the client sends a message (e.g. Invite, Subscribe, or Ping) before login completes, after a token expires mid-session, or after the server drops the authenticated state for any reason.";
|
|
139
352
|
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
353
|
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"];
|
|
354
|
+
readonly fatal: false;
|
|
141
355
|
};
|
|
142
356
|
readonly 47001: {
|
|
143
357
|
readonly name: "ICE_RESTART_FAILED";
|
|
@@ -145,6 +359,7 @@ export declare const SDK_ERRORS: {
|
|
|
145
359
|
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
360
|
readonly causes: readonly ["WebSocket connection lost during ICE restart", "Server rejected the Modify request", "Timeout waiting for server response"];
|
|
147
361
|
readonly solutions: readonly ["The call may recover via WebSocket reconnect + Attach", "If the call does not recover, hang up and retry"];
|
|
362
|
+
readonly fatal: false;
|
|
148
363
|
};
|
|
149
364
|
readonly 48001: {
|
|
150
365
|
readonly name: "NETWORK_OFFLINE";
|
|
@@ -152,6 +367,15 @@ export declare const SDK_ERRORS: {
|
|
|
152
367
|
readonly description: "The browser reported that the device has lost network connectivity (navigator.onLine === false). All WebSocket and media connections will fail until the network is restored.";
|
|
153
368
|
readonly causes: readonly ["Wi-Fi or ethernet disconnected", "Airplane mode enabled", "Network interface went down"];
|
|
154
369
|
readonly solutions: readonly ["Check network connectivity", "Reconnect to Wi-Fi or ethernet", "Disable airplane mode"];
|
|
370
|
+
readonly fatal: false;
|
|
371
|
+
};
|
|
372
|
+
readonly 48501: {
|
|
373
|
+
readonly name: "SESSION_NOT_REATTACHED";
|
|
374
|
+
readonly message: "Active call lost after reconnect";
|
|
375
|
+
readonly description: "The WebSocket reconnected successfully but the server did not reattach the active call session. The server no longer knows about the call, so any subsequent call-control operation (hangup, hold, etc.) will fail with CALL_DOES_NOT_EXIST. The call is unrecoverable and must be terminated locally.";
|
|
376
|
+
readonly causes: readonly ["Server-side session expired during the disconnection window", "Reconnect token was invalidated", "Backend restarted or lost in-memory call state"];
|
|
377
|
+
readonly solutions: readonly ["Terminate the local call and notify the user", "Start a new call", "Investigate why the session was not preserved on the server"];
|
|
378
|
+
readonly fatal: true;
|
|
155
379
|
};
|
|
156
380
|
readonly 49001: {
|
|
157
381
|
readonly name: "UNEXPECTED_ERROR";
|
|
@@ -159,6 +383,7 @@ export declare const SDK_ERRORS: {
|
|
|
159
383
|
readonly description: "An error was thrown that does not match any known SDK error category. This is a catch-all for unclassified failures.";
|
|
160
384
|
readonly causes: readonly ["Unknown or unhandled error condition"];
|
|
161
385
|
readonly solutions: readonly ["Check the originalError property for the underlying cause", "Report the issue if it persists"];
|
|
386
|
+
readonly fatal: true;
|
|
162
387
|
};
|
|
163
388
|
};
|
|
164
389
|
export declare type SdkErrorCode = keyof typeof SDK_ERRORS;
|
|
@@ -47,6 +47,13 @@ export declare const SDK_WARNINGS: {
|
|
|
47
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
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
49
|
};
|
|
50
|
+
readonly 31006: {
|
|
51
|
+
readonly name: "LOW_INBOUND_AUDIO";
|
|
52
|
+
readonly message: "Low inbound audio detected";
|
|
53
|
+
readonly description: "Inbound (remote) audio level stayed below the acceptable threshold for multiple consecutive stats intervals while RTP packets continued to flow. This may indicate the remote party is sending silence or comfort-noise (e.g. one-way audio caused by a media bridge issue), as opposed to LOW_BYTES_RECEIVED which fires when no bytes arrive at all.";
|
|
54
|
+
readonly causes: readonly ["Remote party microphone is muted or capturing very low audio", "Media bridge or PBX is injecting comfort-noise/silence instead of forwarding real audio", "One-way audio where RTP flows but content is silent (server-side media issue)", "Remote party is on hold or not speaking"];
|
|
55
|
+
readonly solutions: readonly ["Verify the remote party is not muted and is actively speaking", "Check the media bridge / PBX for comfort-noise injection or transcoding issues", "Inspect PCAP RTP payload uniqueness to distinguish real audio from comfort-noise", "If the issue persists, report the call for server-side media investigation"];
|
|
56
|
+
};
|
|
50
57
|
readonly 32001: {
|
|
51
58
|
readonly name: "LOW_BYTES_RECEIVED";
|
|
52
59
|
readonly message: "No audio data received";
|
|
@@ -124,24 +131,10 @@ export declare const SDK_WARNINGS: {
|
|
|
124
131
|
readonly causes: readonly ["Token was issued with a limited lifetime"];
|
|
125
132
|
readonly solutions: readonly ["Generate a new authentication token", "Reconnect with fresh credentials before the token expires"];
|
|
126
133
|
};
|
|
127
|
-
readonly 36001: {
|
|
128
|
-
readonly name: "SIGNALING_HEALTH_PROBE_TIMEOUT";
|
|
129
|
-
readonly message: "Signaling health probe timed out";
|
|
130
|
-
readonly description: "A signaling liveness probe (Ping) was sent during an active call but no response was received within the timeout window. This indicates the WebSocket may be half-dead — the browser reports it as OPEN but data is not flowing. The SDK will force-close the socket to trigger reconnection.";
|
|
131
|
-
readonly causes: readonly ["Network interface removed mid-call while another interface remains", "TCP connection bound to a removed IP/route became half-dead", "Firewall or NAT state expired silently", "WebSocket proxy or load balancer dropped the connection without a close frame"];
|
|
132
|
-
readonly solutions: readonly ["The SDK will automatically force-close the socket and reconnect", "Check for network interface changes during the call", "Verify firewall/NAT timeout settings"];
|
|
133
|
-
};
|
|
134
|
-
readonly 36002: {
|
|
135
|
-
readonly name: "SIGNALING_REQUEST_TIMEOUT";
|
|
136
|
-
readonly message: "Signaling request timed out";
|
|
137
|
-
readonly description: "A signaling-critical JSON-RPC request (e.g. ICE restart Modify) did not receive a response within the timeout window while the socket reports OPEN. This may indicate the WebSocket is half-dead or the server is unresponsive. The SDK will mark signaling as unhealthy and force reconnection.";
|
|
138
|
-
readonly causes: readonly ["Half-dead WebSocket (browser reports OPEN but data does not flow)", "Server unresponsive or overloaded", "Network path interruption without TCP RST"];
|
|
139
|
-
readonly solutions: readonly ["The SDK will automatically force-close the socket and reconnect", "Check server health and response times", "Check for network path issues"];
|
|
140
|
-
};
|
|
141
134
|
readonly 36003: {
|
|
142
135
|
readonly name: "SIGNALING_RECOVERY_REQUIRED";
|
|
143
136
|
readonly message: "Signaling recovery required";
|
|
144
|
-
readonly description: "The signaling (WebSocket) path has been detected as unhealthy and the SDK will force-close the socket and reconnect.
|
|
137
|
+
readonly description: "The signaling (WebSocket) path has been detected as unhealthy and the SDK will force-close the socket and reconnect. The source field in the warning payload indicates what triggered the recovery (probe, request, peer_failure, or no_rtp). Active calls will be recovered via reattach after reconnection.";
|
|
145
138
|
readonly causes: readonly ["WebSocket probe timed out with no response", "Critical signaling request timed out", "Peer/media failure detected while signaling is also unhealthy"];
|
|
146
139
|
readonly solutions: readonly ["The SDK will automatically reconnect and recover the call", "Check for network interface changes or interruptions", "Verify firewall/NAT timeout settings"];
|
|
147
140
|
};
|
|
@@ -152,12 +145,33 @@ export declare const SDK_WARNINGS: {
|
|
|
152
145
|
readonly causes: readonly ["ICE connection state changed to failed", "RTCPeerConnection state changed to failed", "No RTP packets/bytes received while media should be active"];
|
|
153
146
|
readonly solutions: readonly ["The SDK will automatically attempt ICE restart", "Check network connectivity and ICE candidate availability", "Verify TURN server configuration"];
|
|
154
147
|
};
|
|
155
|
-
readonly
|
|
156
|
-
readonly name: "
|
|
157
|
-
readonly message: "
|
|
158
|
-
readonly description: "The WebSocket
|
|
159
|
-
readonly causes: readonly ["
|
|
160
|
-
readonly solutions: readonly ["
|
|
148
|
+
readonly 36005: {
|
|
149
|
+
readonly name: "RECONNECTION_FAILED_WITH_NO_AUTO_RECONNECT";
|
|
150
|
+
readonly message: "Reconnection failed — auto-reconnect disabled";
|
|
151
|
+
readonly description: "The WebSocket was closed and auto-reconnect is disabled, so the SDK will not attempt to reconnect. This typically occurs after the user called disconnect() or after reconnection attempts were exhausted.";
|
|
152
|
+
readonly causes: readonly ["Auto-reconnect was disabled by the application", "Reconnection attempts were previously exhausted", "The session was intentionally disconnected"];
|
|
153
|
+
readonly solutions: readonly ["Call connect() manually to re-establish the session", "Check if disconnect() was called intentionally", "Review maxReconnectAttempts configuration"];
|
|
154
|
+
};
|
|
155
|
+
readonly 33009: {
|
|
156
|
+
readonly name: "AUDIO_INPUT_DEVICE_CHANGE_SKIPPED";
|
|
157
|
+
readonly message: "Audio input device change skipped";
|
|
158
|
+
readonly description: "The SDK could not change the microphone because the active peer connection has no audio RTP sender to replace. The existing local media and mute state were left unchanged.";
|
|
159
|
+
readonly causes: readonly ["The call was created without an audio sender", "The peer connection was not ready when setAudioInDevice was called", "The call is already ending or the local media sender was removed"];
|
|
160
|
+
readonly solutions: readonly ["Retry after the call is active and local media is attached", "Verify the call was started with audio enabled", "Inspect call state and peer connection sender availability"];
|
|
161
|
+
};
|
|
162
|
+
readonly 33010: {
|
|
163
|
+
readonly name: "MULTIPLE_ACTIVE_CALLS_DETECTED";
|
|
164
|
+
readonly message: "Multiple active calls detected in one SDK session";
|
|
165
|
+
readonly description: "A new call was created or received while another call is still active (ringing, answering, active, held, or recovering) in the same SDK session. This may be intentional for some applications (e.g. call waiting, transfer) but is often abnormal and makes call reports and application behavior harder to reason about. The new call proceeds normally — this warning is diagnostic only.";
|
|
166
|
+
readonly causes: readonly ["Application created an outbound call while another call is active", "An inbound call arrived while another call is already active", "Application did not hang up the previous call before starting a new one", "Call waiting or multi-call scenario (may be intentional)"];
|
|
167
|
+
readonly solutions: readonly ["Verify this is the expected behavior for your application", "Ensure the previous call is hung up before creating a new one if only one call is expected", "Use call.hold() before starting a new call if needed", "Check the warning payload for call IDs to correlate which calls are involved"];
|
|
168
|
+
};
|
|
169
|
+
readonly 35002: {
|
|
170
|
+
readonly name: "UNKNOWN_REATTACHED_SESSION";
|
|
171
|
+
readonly message: "Unknown reattach session after reconnect";
|
|
172
|
+
readonly description: "The WebSocket reconnected successfully and the server sent an Attach message for a session that does not match any active SDK call. The unknown Attach is ACK'd and ignored.";
|
|
173
|
+
readonly causes: readonly ["Server sent an Attach for a call that no longer exists in the SDK", "Multiple Attach messages arrived and only the first was recovered", "Race condition between reconnection and new inbound call"];
|
|
174
|
+
readonly solutions: readonly ["Check application logic for multiple simultaneous calls", "Inspect the Attach callID in the warning payload for details", "If a call should be active, start a new call manually"];
|
|
161
175
|
};
|
|
162
176
|
};
|
|
163
177
|
export declare type SdkWarningCode = keyof typeof SDK_WARNINGS;
|
|
@@ -12,6 +12,7 @@ export interface ITelnyxError {
|
|
|
12
12
|
causes: string[];
|
|
13
13
|
solutions: string[];
|
|
14
14
|
originalError?: unknown;
|
|
15
|
+
fatal: boolean;
|
|
15
16
|
}
|
|
16
17
|
export interface ITelnyxMediaError extends Omit<ITelnyxError, 'code'> {
|
|
17
18
|
code: TelnyxMediaErrorCode;
|
|
@@ -38,6 +39,7 @@ export declare class TelnyxError extends Error implements ITelnyxError {
|
|
|
38
39
|
readonly causes: string[];
|
|
39
40
|
readonly solutions: string[];
|
|
40
41
|
readonly originalError?: unknown;
|
|
42
|
+
readonly fatal: boolean;
|
|
41
43
|
constructor(params: Omit<ITelnyxError, 'message'> & {
|
|
42
44
|
message?: string;
|
|
43
45
|
});
|
|
@@ -45,7 +47,7 @@ export declare class TelnyxError extends Error implements ITelnyxError {
|
|
|
45
47
|
}
|
|
46
48
|
export declare function isMediaRecoveryErrorEvent(event: ITelnyxErrorEvent): event is ITelnyxMediaRecoveryErrorEvent;
|
|
47
49
|
export declare function classifyMediaErrorCode(error: unknown): typeof MEDIA_MICROPHONE_PERMISSION_DENIED | typeof MEDIA_DEVICE_NOT_FOUND | typeof MEDIA_GET_USER_MEDIA_FAILED;
|
|
48
|
-
export declare function createTelnyxError(code: SdkErrorCode, originalError?: unknown, message?: string): TelnyxError;
|
|
50
|
+
export declare function createTelnyxError(code: SdkErrorCode, originalError?: unknown, message?: string, fatal?: boolean): TelnyxError;
|
|
49
51
|
export declare class RequestTimeoutError extends Error {
|
|
50
52
|
readonly requestId: string;
|
|
51
53
|
readonly timeoutMs: number;
|