opensips-js 0.1.12 → 0.1.14

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 CHANGED
@@ -119,27 +119,33 @@ If you prefer using ES modules in the browser and your environment supports them
119
119
  import OpensipsJS from 'https://cdn.opensipsjs.org/opensipsjs/v0.1.1/opensips-js.es.js';\
120
120
 
121
121
  const opensipsJS = new OpensipsJS({
122
- configuration: {
123
- session_timers: false,
124
- uri: 'sip:extension_user@domain',
125
- // --- Use password or authorization_jwt to authorize
126
- password: 'password',
127
- // or
128
- authorization_jwt: 'token',
129
- },
130
- socketInterfaces: ['wss://domain'],
131
- pnExtraHeaders: {
132
- 'pn-provider': 'acme',
133
- 'pn-param': 'acme-param',
134
- 'pn-prid': 'ZH11Y4ZDJlMNzODE1NgKi0K>',
135
- },
136
- sipDomain: 'domain',
137
- sipOptions: {
138
- session_timers: false,
139
- extraHeaders: ['X-Bar: bar'],
140
- pcConfig: {},
141
- },
142
- modules: ['audio', 'video', 'msrp'],
122
+ configuration: {
123
+ session_timers: false,
124
+ noiseReductionOptions: {
125
+ mode: 'dynamic',
126
+ noiseThreshold: 0.004
127
+ checkEveryMs: 500
128
+ noiseCheckInterval: 2000
129
+ },
130
+ uri: 'sip:extension_user@domain',
131
+ // --- Use password or authorization_jwt to authorize
132
+ password: 'password',
133
+ // or
134
+ authorization_jwt: 'token',
135
+ },
136
+ socketInterfaces: ['wss://domain'],
137
+ pnExtraHeaders: {
138
+ 'pn-provider': 'acme',
139
+ 'pn-param': 'acme-param',
140
+ 'pn-prid': 'ZH11Y4ZDJlMNzODE1NgKi0K>',
141
+ },
142
+ sipDomain: 'domain',
143
+ sipOptions: {
144
+ session_timers: false,
145
+ extraHeaders: ['X-Bar: bar'],
146
+ pcConfig: {},
147
+ },
148
+ modules: ['audio', 'video', 'msrp'],
143
149
  });
144
150
 
145
151
  // Use the modules as before
@@ -237,6 +243,16 @@ Also, there are next public fields on OpensipsJS instance:
237
243
  - `isDND: Boolean` - returns if the agent is in "Do not disturb" status
238
244
  - `isMuted: Boolean` - returns if the agent is muted
239
245
 
246
+ ### Noise Reduction Options
247
+
248
+ | Parameter | Type | Default | Description |
249
+ |----------------------|----------------------------------|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
250
+ | `mode` | `disabled \| enabled \| dynamic` | `disabled` | Noice reduction mode |
251
+ | `vadConfig` | `Partial<RealTimeVADOptions>` | `{}` | VAD configuration |
252
+ | `noiseThreshold` | `number` | `0.004` | Noise threshold |
253
+ | `noiseCheckInterval` | `number` | `2000` | The interval, used to check if we need to disable/enable outgoing audio every N-milliseconds |
254
+ | `checkEveryMs` | `number` | `500` | The interval, used inside noiseCheckInterval loop, checks current noise state every N-milliseconds, to define the average noise level. Then on every noiseCheckInterval iteration, the values getting on checkEveryMs will be summed, then divided by it's number and compared to noiseThreshold |
255
+
240
256
  ## MSRP
241
257
 
242
258
  ### MSRP methods