@jambonz/node-red-contrib-jambonz 2.4.13 → 2.4.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jambonz/node-red-contrib-jambonz",
3
- "version": "2.4.13",
3
+ "version": "2.4.15",
4
4
  "description": "Node-RED nodes for jambonz platform",
5
5
  "keywords": [
6
6
  "node-red"
@@ -18,7 +18,9 @@
18
18
  to: {value: '', required: true},
19
19
  toType: {value: ''},
20
20
  dest: {value: 'phone', required: true},
21
- timeout: {},
21
+ timeout: {validate: RED.validators.regex(/^\d*$/) },
22
+ tag: {required: true},
23
+ tagType: {value: 'json'},
22
24
  application: {value: ''},
23
25
  appName: {},
24
26
  mode: {value: 'app'},
@@ -91,6 +93,11 @@
91
93
  types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
92
94
  typeField: $('#node-input-callernameType')
93
95
  });
96
+ $('#node-input-tag').typedInput({
97
+ default: $('#node-input-tagType').val(),
98
+ types: ['json', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
99
+ typeField: $('#node-input-tagType')
100
+ });
94
101
 
95
102
  var populateApplications = function() {
96
103
  var serverId = $('#node-input-server option:selected').val();
@@ -229,7 +236,11 @@
229
236
  <div class="form-row">
230
237
  <label for="node-input-timeout">Ring timeout</label>
231
238
  <input type="text" id="node-input-timeout" placeholder="ring no answer timeout in secs (default: 60)">
232
- <input type="hidden" id="node-input-timeoutType">
239
+ </div>
240
+ <div class="form-row">
241
+ <label for="node-input-tag">Tag data</label>
242
+ <input type="text" id="node-input-tag" placeholder="tag object">
243
+ <input type="hidden" id="node-input-tagType">
233
244
  </div>
234
245
  <div class="form-row">
235
246
  <label for="node-input-application">Connect to</label>
@@ -342,8 +353,10 @@
342
353
  <h3>Properties</h3>
343
354
  <p><code>Server</code> - Jambonz server to connect to</p>
344
355
  <p><code>From</code> - Calling party phone number</p>
356
+ <p><code>From name</code> - Calling party name</p>
345
357
  <p><code>To</code> - Called party phone number, or other identifier</p>
346
358
  <p><code>Call type</code> - Type of destination: phone number, registered user, sip endpoint, or microsoft teams</p>
359
+ <p><code>Tag data</code> - Initial set of customer-supplied metadata to associate with the call</p>
347
360
  <p><code>Application</code> - Application to execute when call is answered</p>
348
361
  <p><code>Webhooks</code> - Webhooks to execute when call is answered</p>
349
362
 
@@ -21,12 +21,14 @@ module.exports = function(RED) {
21
21
 
22
22
  var from = new_resolve(RED, config.from, config.fromType, node, msg);
23
23
  var to = new_resolve(RED, config.to, config.toType, node, msg);
24
+ var tag = new_resolve(RED, config.tag, config.tagType, node, msg);
24
25
 
25
26
  const opts = {
26
27
  from,
27
28
  to: {
28
29
  type: config.dest
29
30
  },
31
+ tag
30
32
  };
31
33
 
32
34
  if (config.headers) {
@@ -66,6 +68,7 @@ module.exports = function(RED) {
66
68
  const timeout = parseInt(config.timeout);
67
69
  if (timeout > 0) opts.timeout = timeout;
68
70
  }
71
+
69
72
  switch (config.dest) {
70
73
  case 'phone':
71
74
  opts.to.number = to;
@@ -26,6 +26,8 @@ RED.nodes.registerType('listen',{
26
26
  metadataType: {value: 'json'},
27
27
  mixtype: {value: 'mono'},
28
28
  beep: {value: false},
29
+ passDtmf: {value: false},
30
+ disableBidirectionalAudio: {value: false},
29
31
  samplerate: {value: 8000},
30
32
  timeout: {},
31
33
  transcriptionhook: {},
@@ -76,9 +78,9 @@ RED.nodes.registerType('listen',{
76
78
  types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
77
79
  typeField: $('#node-input-authuserType')
78
80
  });
79
- $('#node-input-authpassword').typedInput({
81
+ $('#node-input-authpass').typedInput({
80
82
  types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
81
- typeField: $('#node-input-authpasswordType')
83
+ typeField: $('#node-input-authpassType')
82
84
  });
83
85
  $('#node-input-metadata').typedInput({
84
86
  types: ['json', 'msg', 'flow', 'global'],
@@ -131,9 +133,9 @@ RED.nodes.registerType('listen',{
131
133
  <input type="hidden" id="node-input-authuserType">
132
134
  </div>
133
135
  <div class="form-row">
134
- <label for="node-input-authpassword">Password</label>
135
- <input type="text" id="node-input-authpassword" placeholder="basic auth password">
136
- <input type="hidden" id="node-input-authpasswordType">
136
+ <label for="node-input-authpass">Password</label>
137
+ <input type="text" id="node-input-authpass" placeholder="basic auth password">
138
+ <input type="hidden" id="node-input-authpassType">
137
139
  </div>
138
140
  <div class="form-row">
139
141
  <label for="node-input-actionhook">Action hook</label>
@@ -157,6 +159,14 @@ RED.nodes.registerType('listen',{
157
159
  <label for="node-input-beep">Beep</label>
158
160
  <input type="checkbox" id="node-input-beep">
159
161
  </div>
162
+ <div class="form-row">
163
+ <label for="node-input-passDtmf">Pass Dtmf</label>
164
+ <input type="checkbox" id="node-input-passDtmf">
165
+ </div>
166
+ <div class="form-row">
167
+ <label for="node-input-disableBidirectionalAudio">Disable Bi-Audio</label>
168
+ <input type="checkbox" id="node-input-disableBidirectionalAudio">
169
+ </div>
160
170
  <div class="form-row">
161
171
  <label for="node-input-mixtype">Mix type</label>
162
172
  <select id="node-input-mixtype">
@@ -252,7 +262,7 @@ RED.nodes.registerType('listen',{
252
262
  <label for="node-input-interactiontype">Type of Interaction</label>
253
263
  <select id="node-input-interactiontype">
254
264
  <option value="unspecified" selected>Unspecified</option>
255
- <option value="discussion">Discusssion</option>
265
+ <option value="discussion">Discussion</option>
256
266
  <option value="presentation">Presentation</option>
257
267
  <option value="phone_call">Phone call</option>
258
268
  <option value="voicemail">Voicemail</option>
@@ -302,37 +312,40 @@ RED.nodes.registerType('listen',{
302
312
 
303
313
  <!-- Help Text -->
304
314
  <script type="text/html" data-help-name="listen">
305
- <p>send live audio for the call to an over a websocket connection</p>
315
+ <p>Send live audio for the call to an over a websocket connection</p>
306
316
  <h3>Properties</h3>
307
- <p><code>ws url</code> -
308
- url of remote server to connect to </p>
317
+ <p><code>Url</code> -
318
+ WebSocket URL of remote server to connect to</p>
309
319
  <p><code>User</code> -
310
320
  Username for HTTP Basic Auth</p>
311
321
  <p><code>Password</code> -
312
322
  Password for HTTP Basic Auth</p>
313
323
  <p><code>Action hook</code> -
314
- webhook to invoke when listen operation ends</p>
324
+ Webhook to invoke when listen operation ends</p>
315
325
  <p><code>Metadata</code> -
316
- arbitrary data to add to the JSON payload sent to the remote server when websocket connection is first connected</p>
326
+ Arbitrary data to add to the JSON payload sent to the remote server when websocket connection is first connected</p>
317
327
  <p><code>Max duration</code> -
318
- the maximum length of the listened audio stream, in secs</p>
328
+ The maximum length of the listened audio stream, in secs</p>
319
329
  <p><code>End key</code> -
320
330
  The set of digits that can end the listen action</p>
321
331
  <p><code>Beep</code> -
322
- if checked, play a beep at the start of the listen operation</p>
323
- <p><code>Mix type</code> -
324
- whether to record a mono or stereo stream</p>
332
+ If checked, play a beep at the start of the listen operation</p>
333
+ <p><code>Pass Dtmf</code> -
334
+ If true, any dtmf digits detected from the caller will be passed over the websocket as text frames in JSON format</p>
335
+ <p><code>Disable Bi-Audio</code> -
336
+ If true, bidirectional audio will be disabled</p>
337
+ <p><code>Mix type</code> -
338
+ Whether to record a mono or stereo stream</p>
325
339
  <p><code>Sample rate</code> -
326
340
  Sample rate of audio to stream</p>
327
341
  <p><code>Transcription hook</code> -
328
- webhook to call when a transcription is received</p>
342
+ Webhook to call when a transcription is received</p>
329
343
  <p><code>Language</code> -
330
344
  Language to use for transcription</p>
331
345
  <p><code>Send interim transcriptions</code> -
332
- if checked, send interim transcriptions</p>
346
+ If checked, send interim transcriptions</p>
333
347
  <p><code>Profanity filter</code> -
334
- if checked, enable profanity filtering</p>
335
-
348
+ If checked, enable profanity filtering</p>
336
349
  <h3>Outputs</h3>
337
350
  <dl class="message-properties">
338
351
  <dt>jambonz<span class="property-type">object</span></dt>
@@ -12,9 +12,20 @@ module.exports = function(RED) {
12
12
  finishOnKey: config.finishonkey,
13
13
  mixType: config.mixtype,
14
14
  playBeep: config.beep,
15
+ passDtmf: config.passDtmf,
16
+ disableBidirectionalAudio: config.disableBidirectionalAudio,
15
17
  sampleRate: config.sampleRate,
16
18
  };
17
19
 
20
+ const authUser = new_resolve(RED, config.authuser, config.authuserType, node, msg);
21
+ const authPass = new_resolve(RED, config.authpass, config.authpassType, node, msg);
22
+ if (authUser && authPass) {
23
+ obj.wsAuth = {
24
+ username: authUser,
25
+ password: authPass
26
+ };
27
+ }
28
+
18
29
  if (config.transcriptionhook) {
19
30
  const recognizer = {
20
31
  vendor: config.transcriptionvendor,