@telnyx/react-voice-commons-sdk 0.1.8 → 0.1.9
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/CHANGELOG.md +16 -0
- package/README.md +1 -1
- package/lib/internal/calls/call-state-controller.js +5 -0
- package/lib/internal/session/session-manager.js +13 -0
- package/lib/models/config.d.ts +16 -0
- package/lib/telnyx-voice-app.js +1 -1
- package/package.json +3 -3
- package/src/internal/calls/call-state-controller.ts +5 -0
- package/src/internal/session/session-manager.ts +13 -0
- package/src/models/config.ts +16 -0
- package/src/telnyx-voice-app.tsx +1 -1
- package/src/types/telnyx-sdk.d.ts +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# CHANGELOG.md
|
|
2
2
|
|
|
3
|
+
## [0.1.9](https://github.com/team-telnyx/react-native-voice-commons/releases/tag/0.1.9) (2026-03-19)
|
|
4
|
+
|
|
5
|
+
### Enhancement
|
|
6
|
+
|
|
7
|
+
- Upgraded low-level SDK dependency from `@telnyx/react-native-voice-sdk@0.3.0` to `@telnyx/react-native-voice-sdk@0.4.0`
|
|
8
|
+
- Commons SDK version now propagates to the low-level SDK User-Agent via `sdkVersion` option
|
|
9
|
+
- Added hidden long-press button on status text to disable push notifications for debugging
|
|
10
|
+
- Disabled debug logging and call reports by default for production readiness
|
|
11
|
+
|
|
12
|
+
### Bug Fixing
|
|
13
|
+
|
|
14
|
+
- Fixed stale push notification state by clearing pending VoIP push data on call end
|
|
15
|
+
- Fixed User-Agent inconsistency — all WebSocket messages now use `ReactNative-{version}` format
|
|
16
|
+
- Fixed unnecessary JSON-RPC ACK messages (invite, answer, ringing) that were causing issues
|
|
17
|
+
- Fixed `telnyxCallControlId` ReferenceError on inbound calls in the low-level SDK
|
|
18
|
+
|
|
3
19
|
## [0.1.8](https://github.com/team-telnyx/react-native-voice-commons/releases/tag/0.1.8) (2026-03-09)
|
|
4
20
|
|
|
5
21
|
### Bug Fixing
|
package/README.md
CHANGED
|
@@ -84,7 +84,7 @@ destroyTelnyxVoipClient(); // Disposes the singleton; next createTelnyxVoipClien
|
|
|
84
84
|
**Configuration Options Explained:**
|
|
85
85
|
|
|
86
86
|
- **`enableAppStateManagement: true`** - **Optional (default: true)**: Enables automatic background/foreground app state management. When enabled, the library automatically disconnects when the app goes to background (unless there's an active call) and handles reconnection logic. Set to `false` if you want to handle app lifecycle manually.
|
|
87
|
-
- **`debug: true`** - **Optional**: Enables detailed logging for connection states, call transitions, and push notification processing. Useful for development and troubleshooting.
|
|
87
|
+
- **`debug: true`** - **Optional (default: false)**: Enables detailed logging for connection states, call transitions, and push notification processing. Useful for development and troubleshooting.
|
|
88
88
|
|
|
89
89
|
### 2. TelnyxVoiceApp Wrapper
|
|
90
90
|
|
|
@@ -6,6 +6,7 @@ const operators_1 = require('rxjs/operators');
|
|
|
6
6
|
const call_1 = require('../../models/call');
|
|
7
7
|
const call_state_1 = require('../../models/call-state');
|
|
8
8
|
const callkit_coordinator_1 = require('../../callkit/callkit-coordinator');
|
|
9
|
+
const voice_pn_bridge_1 = require('../voice-pn-bridge');
|
|
9
10
|
/**
|
|
10
11
|
* Central state machine for call management.
|
|
11
12
|
*
|
|
@@ -349,6 +350,10 @@ class CallStateController {
|
|
|
349
350
|
state === call_state_1.TelnyxCallState.ENDED ||
|
|
350
351
|
state === call_state_1.TelnyxCallState.FAILED
|
|
351
352
|
) {
|
|
353
|
+
// Clear pending push data so the next app launch isn't mistaken for a push launch
|
|
354
|
+
voice_pn_bridge_1.VoicePnBridge.clearPendingVoipPush().catch((e) =>
|
|
355
|
+
console.warn('CallStateController: Failed to clear pending voip push:', e)
|
|
356
|
+
);
|
|
352
357
|
setTimeout(() => this._removeCall(call.callId), 0);
|
|
353
358
|
}
|
|
354
359
|
});
|
|
@@ -56,6 +56,7 @@ exports.SessionManager = void 0;
|
|
|
56
56
|
const rxjs_1 = require('rxjs');
|
|
57
57
|
const operators_1 = require('rxjs/operators');
|
|
58
58
|
const TelnyxSDK = __importStar(require('@telnyx/react-native-voice-sdk'));
|
|
59
|
+
const pkg = __importStar(require('../../../package.json'));
|
|
59
60
|
const connection_state_1 = require('../../models/connection-state');
|
|
60
61
|
const config_1 = require('../../models/config');
|
|
61
62
|
/**
|
|
@@ -313,7 +314,13 @@ class SessionManager {
|
|
|
313
314
|
login: this._currentConfig.sipUser,
|
|
314
315
|
password: this._currentConfig.sipPassword,
|
|
315
316
|
logLevel: this._currentConfig.debug ? 'debug' : 'warn',
|
|
317
|
+
debug: this._currentConfig.debug ?? false,
|
|
316
318
|
pushNotificationDeviceToken: this._currentConfig.pushNotificationDeviceToken,
|
|
319
|
+
enableCallReports: this._currentConfig.enableCallReports,
|
|
320
|
+
callReportInterval: this._currentConfig.callReportInterval,
|
|
321
|
+
callReportLogLevel: this._currentConfig.callReportLogLevel,
|
|
322
|
+
callReportMaxLogEntries: this._currentConfig.callReportMaxLogEntries,
|
|
323
|
+
sdkVersion: pkg.version,
|
|
317
324
|
};
|
|
318
325
|
console.log(
|
|
319
326
|
'🔧 SessionManager: Creating TelnyxRTC with credential config, logLevel:',
|
|
@@ -325,7 +332,13 @@ class SessionManager {
|
|
|
325
332
|
clientOptions = {
|
|
326
333
|
login_token: this._currentConfig.token,
|
|
327
334
|
logLevel: this._currentConfig.debug ? 'debug' : 'warn',
|
|
335
|
+
debug: this._currentConfig.debug ?? false,
|
|
328
336
|
pushNotificationDeviceToken: this._currentConfig.pushNotificationDeviceToken,
|
|
337
|
+
enableCallReports: this._currentConfig.enableCallReports,
|
|
338
|
+
callReportInterval: this._currentConfig.callReportInterval,
|
|
339
|
+
callReportLogLevel: this._currentConfig.callReportLogLevel,
|
|
340
|
+
callReportMaxLogEntries: this._currentConfig.callReportMaxLogEntries,
|
|
341
|
+
sdkVersion: pkg.version,
|
|
329
342
|
};
|
|
330
343
|
console.log(
|
|
331
344
|
'🔧 SessionManager: Creating TelnyxRTC with token config, logLevel:',
|
package/lib/models/config.d.ts
CHANGED
|
@@ -7,6 +7,14 @@ export interface CredentialConfig {
|
|
|
7
7
|
sipPassword: string;
|
|
8
8
|
debug?: boolean;
|
|
9
9
|
pushNotificationDeviceToken?: string;
|
|
10
|
+
/** Enable automatic call quality reporting. Default: true */
|
|
11
|
+
enableCallReports?: boolean;
|
|
12
|
+
/** Stats collection interval in seconds. Default: 5 */
|
|
13
|
+
callReportInterval?: number;
|
|
14
|
+
/** Minimum log level for call reports: 'debug' | 'info' | 'warn' | 'error'. Default: 'debug' */
|
|
15
|
+
callReportLogLevel?: string;
|
|
16
|
+
/** Max log entries per call. Default: 1000 */
|
|
17
|
+
callReportMaxLogEntries?: number;
|
|
10
18
|
}
|
|
11
19
|
/**
|
|
12
20
|
* Configuration for token-based authentication
|
|
@@ -16,6 +24,14 @@ export interface TokenConfig {
|
|
|
16
24
|
token: string;
|
|
17
25
|
debug?: boolean;
|
|
18
26
|
pushNotificationDeviceToken?: string;
|
|
27
|
+
/** Enable automatic call quality reporting. Default: true */
|
|
28
|
+
enableCallReports?: boolean;
|
|
29
|
+
/** Stats collection interval in seconds. Default: 5 */
|
|
30
|
+
callReportInterval?: number;
|
|
31
|
+
/** Minimum log level for call reports: 'debug' | 'info' | 'warn' | 'error'. Default: 'debug' */
|
|
32
|
+
callReportLogLevel?: string;
|
|
33
|
+
/** Max log entries per call. Default: 1000 */
|
|
34
|
+
callReportMaxLogEntries?: number;
|
|
19
35
|
}
|
|
20
36
|
/**
|
|
21
37
|
* Union type for all supported authentication configurations
|
package/lib/telnyx-voice-app.js
CHANGED
|
@@ -612,7 +612,7 @@ const handleBackgroundPush = async (message) => {
|
|
|
612
612
|
// TODO: Initialize push notification service in isolate if needed
|
|
613
613
|
// Use singleton pattern for background client to prevent multiple instances
|
|
614
614
|
let backgroundClient = (0, telnyx_voip_client_1.createBackgroundTelnyxVoipClient)({
|
|
615
|
-
debug:
|
|
615
|
+
debug: false,
|
|
616
616
|
});
|
|
617
617
|
await backgroundClient.handlePushNotification(message);
|
|
618
618
|
console.log('[TelnyxVoiceApp] Background push processed successfully');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telnyx/react-voice-commons-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "A high-level, state-agnostic, drop-in module for the Telnyx React Native SDK that simplifies WebRTC voice calling integration",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"android": "expo run:android",
|
|
40
40
|
"ios": "expo run:ios",
|
|
41
41
|
"dev:local": "npm pkg set dependencies.@telnyx/react-native-voice-sdk=file:../package",
|
|
42
|
-
"dev:published": "npm pkg set dependencies.@telnyx/react-native-voice-sdk=^0.
|
|
42
|
+
"dev:published": "npm pkg set dependencies.@telnyx/react-native-voice-sdk=^0.4.0",
|
|
43
43
|
"prepublishOnly": "npm run dev:published && npm install --legacy-peer-deps",
|
|
44
44
|
"postpublish": "npm run dev:local && npm install --legacy-peer-deps"
|
|
45
45
|
},
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
},
|
|
91
91
|
"dependencies": {
|
|
92
92
|
"@react-native-community/eslint-config": "^3.2.0",
|
|
93
|
-
"@telnyx/react-native-voice-sdk": "^0.
|
|
93
|
+
"@telnyx/react-native-voice-sdk": "^0.4.0",
|
|
94
94
|
"eventemitter3": "^5.0.1",
|
|
95
95
|
"expo": "~53.0.22",
|
|
96
96
|
"react-native-voip-push-notification": "^3.3.3",
|
|
@@ -5,6 +5,7 @@ import { Call } from '../../models/call';
|
|
|
5
5
|
import { TelnyxCallState } from '../../models/call-state';
|
|
6
6
|
import { SessionManager } from '../session/session-manager';
|
|
7
7
|
import { callKitCoordinator } from '../../callkit/callkit-coordinator';
|
|
8
|
+
import { VoicePnBridge } from '../voice-pn-bridge';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Central state machine for call management.
|
|
@@ -408,6 +409,10 @@ export class CallStateController {
|
|
|
408
409
|
// Clean up when call ends - delay to next tick so external subscribers
|
|
409
410
|
// receive the ENDED/FAILED state before the call is disposed
|
|
410
411
|
if (state === TelnyxCallState.ENDED || state === TelnyxCallState.FAILED) {
|
|
412
|
+
// Clear pending push data so the next app launch isn't mistaken for a push launch
|
|
413
|
+
VoicePnBridge.clearPendingVoipPush().catch((e) =>
|
|
414
|
+
console.warn('CallStateController: Failed to clear pending voip push:', e)
|
|
415
|
+
);
|
|
411
416
|
setTimeout(() => this._removeCall(call.callId), 0);
|
|
412
417
|
}
|
|
413
418
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BehaviorSubject, Observable } from 'rxjs';
|
|
2
2
|
import { distinctUntilChanged } from 'rxjs/operators';
|
|
3
3
|
import * as TelnyxSDK from '@telnyx/react-native-voice-sdk';
|
|
4
|
+
import * as pkg from '../../../package.json';
|
|
4
5
|
import { TelnyxConnectionState } from '../../models/connection-state';
|
|
5
6
|
import {
|
|
6
7
|
Config,
|
|
@@ -302,7 +303,13 @@ export class SessionManager {
|
|
|
302
303
|
login: this._currentConfig.sipUser,
|
|
303
304
|
password: this._currentConfig.sipPassword,
|
|
304
305
|
logLevel: this._currentConfig.debug ? 'debug' : 'warn',
|
|
306
|
+
debug: this._currentConfig.debug ?? false,
|
|
305
307
|
pushNotificationDeviceToken: this._currentConfig.pushNotificationDeviceToken,
|
|
308
|
+
enableCallReports: this._currentConfig.enableCallReports,
|
|
309
|
+
callReportInterval: this._currentConfig.callReportInterval,
|
|
310
|
+
callReportLogLevel: this._currentConfig.callReportLogLevel,
|
|
311
|
+
callReportMaxLogEntries: this._currentConfig.callReportMaxLogEntries,
|
|
312
|
+
sdkVersion: pkg.version,
|
|
306
313
|
};
|
|
307
314
|
console.log(
|
|
308
315
|
'🔧 SessionManager: Creating TelnyxRTC with credential config, logLevel:',
|
|
@@ -314,7 +321,13 @@ export class SessionManager {
|
|
|
314
321
|
clientOptions = {
|
|
315
322
|
login_token: this._currentConfig.token,
|
|
316
323
|
logLevel: this._currentConfig.debug ? 'debug' : 'warn',
|
|
324
|
+
debug: this._currentConfig.debug ?? false,
|
|
317
325
|
pushNotificationDeviceToken: this._currentConfig.pushNotificationDeviceToken,
|
|
326
|
+
enableCallReports: this._currentConfig.enableCallReports,
|
|
327
|
+
callReportInterval: this._currentConfig.callReportInterval,
|
|
328
|
+
callReportLogLevel: this._currentConfig.callReportLogLevel,
|
|
329
|
+
callReportMaxLogEntries: this._currentConfig.callReportMaxLogEntries,
|
|
330
|
+
sdkVersion: pkg.version,
|
|
318
331
|
};
|
|
319
332
|
console.log(
|
|
320
333
|
'🔧 SessionManager: Creating TelnyxRTC with token config, logLevel:',
|
package/src/models/config.ts
CHANGED
|
@@ -7,6 +7,14 @@ export interface CredentialConfig {
|
|
|
7
7
|
sipPassword: string;
|
|
8
8
|
debug?: boolean;
|
|
9
9
|
pushNotificationDeviceToken?: string;
|
|
10
|
+
/** Enable automatic call quality reporting. Default: true */
|
|
11
|
+
enableCallReports?: boolean;
|
|
12
|
+
/** Stats collection interval in seconds. Default: 5 */
|
|
13
|
+
callReportInterval?: number;
|
|
14
|
+
/** Minimum log level for call reports: 'debug' | 'info' | 'warn' | 'error'. Default: 'debug' */
|
|
15
|
+
callReportLogLevel?: string;
|
|
16
|
+
/** Max log entries per call. Default: 1000 */
|
|
17
|
+
callReportMaxLogEntries?: number;
|
|
10
18
|
}
|
|
11
19
|
|
|
12
20
|
/**
|
|
@@ -17,6 +25,14 @@ export interface TokenConfig {
|
|
|
17
25
|
token: string;
|
|
18
26
|
debug?: boolean;
|
|
19
27
|
pushNotificationDeviceToken?: string;
|
|
28
|
+
/** Enable automatic call quality reporting. Default: true */
|
|
29
|
+
enableCallReports?: boolean;
|
|
30
|
+
/** Stats collection interval in seconds. Default: 5 */
|
|
31
|
+
callReportInterval?: number;
|
|
32
|
+
/** Minimum log level for call reports: 'debug' | 'info' | 'warn' | 'error'. Default: 'debug' */
|
|
33
|
+
callReportLogLevel?: string;
|
|
34
|
+
/** Max log entries per call. Default: 1000 */
|
|
35
|
+
callReportMaxLogEntries?: number;
|
|
20
36
|
}
|
|
21
37
|
|
|
22
38
|
/**
|
package/src/telnyx-voice-app.tsx
CHANGED
|
@@ -775,7 +775,7 @@ const handleBackgroundPush = async (message: any): Promise<void> => {
|
|
|
775
775
|
|
|
776
776
|
// Use singleton pattern for background client to prevent multiple instances
|
|
777
777
|
let backgroundClient = createBackgroundTelnyxVoipClient({
|
|
778
|
-
debug:
|
|
778
|
+
debug: false,
|
|
779
779
|
});
|
|
780
780
|
|
|
781
781
|
await backgroundClient.handlePushNotification(message);
|
|
@@ -26,6 +26,11 @@ declare module '@telnyx/react-native-voice-sdk' {
|
|
|
26
26
|
debug?: boolean;
|
|
27
27
|
logLevel?: string;
|
|
28
28
|
pushNotificationDeviceToken?: string;
|
|
29
|
+
enableCallReports?: boolean;
|
|
30
|
+
callReportInterval?: number;
|
|
31
|
+
callReportLogLevel?: string;
|
|
32
|
+
callReportMaxLogEntries?: number;
|
|
33
|
+
sdkVersion?: string;
|
|
29
34
|
}
|
|
30
35
|
|
|
31
36
|
export enum CallState {
|