opensips-js 0.1.18 → 0.1.19
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 +2 -17
- package/dist/index.d.ts +0 -2
- package/dist/opensips-js.cjs.js +2 -2
- package/dist/opensips-js.es.js +550 -528
- package/dist/opensips-js.iife.js +4 -4
- package/dist/opensips-js.umd.js +27 -27
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -229,7 +229,6 @@ Also, there are next public fields on OpensipsJS instance:
|
|
|
229
229
|
- `setSpeakerVolume(value: Number): void` - set volume of callers. Value should be in range from 0 to 1
|
|
230
230
|
- `setDND(value: Boolean): void` - set the agent "Do not disturb" status
|
|
231
231
|
- `setMetricsConfig(config: WebrtcMetricsConfigType): void` - set the metric config (used for audio quality indicator)
|
|
232
|
-
- `setVADConfiguration(options: Partial<Omit<NoiseReductionOptions, 'vadModule'>>): void` - update noise reduction configuration at runtime. **Requires `vadModule` to be passed in the constructor, otherwise throws an error**
|
|
233
232
|
|
|
234
233
|
### Audio instance fields
|
|
235
234
|
- `sipOptions: Object` - returns sip options
|
|
@@ -248,14 +247,6 @@ Also, there are next public fields on OpensipsJS instance:
|
|
|
248
247
|
|
|
249
248
|
**Important**: Voice Activity Detection (VAD) is an **optional feature** that requires installing an additional peer dependency. It is **NOT compatible with React Native**.
|
|
250
249
|
|
|
251
|
-
#### Critical: VAD Module Must Be Passed to Constructor
|
|
252
|
-
|
|
253
|
-
**If you plan to use noise reduction features (including `setVADConfiguration` in runtime), you MUST pass `vadModule` to the OpenSIPSJS constructor during initialization.**
|
|
254
|
-
|
|
255
|
-
- ✅ **Required**: Pass `vadModule` in the constructor if you want to use noise reduction
|
|
256
|
-
- ❌ **Will throw error**: Calling `setVADConfiguration()` without `vadModule` in the constructor will throw an error
|
|
257
|
-
- ⚠️ **Cannot be changed later**: The `vadModule` cannot be set after initialization - it must be provided in the constructor
|
|
258
|
-
|
|
259
250
|
#### For Web Applications (with VAD support)
|
|
260
251
|
|
|
261
252
|
Install the VAD library:
|
|
@@ -265,7 +256,7 @@ npm install @ricky0123/vad-web
|
|
|
265
256
|
yarn add @ricky0123/vad-web
|
|
266
257
|
```
|
|
267
258
|
|
|
268
|
-
Then import and inject it in your configuration
|
|
259
|
+
Then import and inject it in your configuration:
|
|
269
260
|
```javascript
|
|
270
261
|
import OpenSIPSJS from 'opensips-js'
|
|
271
262
|
import * as VAD from '@ricky0123/vad-web'
|
|
@@ -275,7 +266,7 @@ const opensipsJS = new OpenSIPSJS({
|
|
|
275
266
|
// ... other configuration
|
|
276
267
|
noiseReductionOptions: {
|
|
277
268
|
mode: 'dynamic', // or 'enabled'
|
|
278
|
-
vadModule: VAD, //
|
|
269
|
+
vadModule: VAD, // Inject the VAD module
|
|
279
270
|
noiseThreshold: 0.004,
|
|
280
271
|
checkEveryMs: 500,
|
|
281
272
|
noiseCheckInterval: 2000
|
|
@@ -283,12 +274,6 @@ const opensipsJS = new OpenSIPSJS({
|
|
|
283
274
|
},
|
|
284
275
|
// ... rest of configuration
|
|
285
276
|
})
|
|
286
|
-
|
|
287
|
-
// ✅ Now you can use setVADConfiguration
|
|
288
|
-
opensipsJS.audio.setVADConfiguration({
|
|
289
|
-
mode: 'enabled',
|
|
290
|
-
noiseThreshold: 0.005
|
|
291
|
-
})
|
|
292
277
|
```
|
|
293
278
|
|
|
294
279
|
#### For React Native Applications (VAD not supported)
|
package/dist/index.d.ts
CHANGED
|
@@ -78,8 +78,6 @@ declare class AudioModule {
|
|
|
78
78
|
private MicVAD;
|
|
79
79
|
managedAudioContext: ManagedAudioContext;
|
|
80
80
|
constructor(context: OpenSIPSJS);
|
|
81
|
-
setVADConfiguration(options: Partial<Omit<NoiseReductionOptions, 'vadModule'>>): void;
|
|
82
|
-
private setupVADInstance;
|
|
83
81
|
private processVADConfiguration;
|
|
84
82
|
get sipOptions(): {
|
|
85
83
|
mediaConstraints: {
|