@jambonz/node-red-contrib-jambonz 2.4.14 → 2.4.16
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 +1 -1
- package/src/nodes/gather.html +26 -0
- package/src/nodes/gather.js +5 -0
- package/src/nodes/listen.html +32 -19
- package/src/nodes/listen.js +11 -0
package/package.json
CHANGED
package/src/nodes/gather.html
CHANGED
|
@@ -13,10 +13,15 @@
|
|
|
13
13
|
name: {value: ''},
|
|
14
14
|
actionhook: {value: ''},
|
|
15
15
|
actionhookType: {val: 'str'},
|
|
16
|
+
partialresulthook: {value: ''},
|
|
17
|
+
partialresulthookType: {val: 'str'},
|
|
16
18
|
finishonkey: {value: ''},
|
|
17
19
|
dtmfinput: {value: 0},
|
|
18
20
|
speechinput: {value: 1},
|
|
19
21
|
numdigits: {value: ''},
|
|
22
|
+
mindigits: {value: ''},
|
|
23
|
+
maxdigits: {value: ''},
|
|
24
|
+
interdigittimeout: {value: ''},
|
|
20
25
|
timeout: {value: ''},
|
|
21
26
|
bargein: {value: true},
|
|
22
27
|
dtmfbargein: {value: true},
|
|
@@ -72,6 +77,10 @@
|
|
|
72
77
|
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
|
|
73
78
|
typeField: $('#node-input-actionhookType')
|
|
74
79
|
});
|
|
80
|
+
$('#node-input-partialresulthook').typedInput({
|
|
81
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
|
|
82
|
+
typeField: $('#node-input-partialresulthookType')
|
|
83
|
+
});
|
|
75
84
|
$('#node-input-playurl').typedInput({
|
|
76
85
|
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
|
|
77
86
|
typeField: $('#node-input-playurlType')
|
|
@@ -138,6 +147,11 @@
|
|
|
138
147
|
<input type="text" id="node-input-actionhook" placeholder="webhook with results of gather">
|
|
139
148
|
<input type="hidden" id="node-input-actionhookType">
|
|
140
149
|
</div>
|
|
150
|
+
<div class="form-row">
|
|
151
|
+
<label for="node-input-partialresulthook"><i class="icon-tag"></i> Partial result hook</label>
|
|
152
|
+
<input type="text" id="node-input-partialresulthook" placeholder="webhook with interim transcription results of gather">
|
|
153
|
+
<input type="hidden" id="node-input-partialresulthookType">
|
|
154
|
+
</div>
|
|
141
155
|
<fieldset>
|
|
142
156
|
<legend>Prompt</legend>
|
|
143
157
|
<div class="form-row">
|
|
@@ -218,6 +232,18 @@
|
|
|
218
232
|
<label for="node-input-numdigits"><i class="icon-tag"></i> Num. digits</label>
|
|
219
233
|
<input type="text" id="node-input-numdigits" placeholder="number of digits to collect">
|
|
220
234
|
</div>
|
|
235
|
+
<div class="form-row">
|
|
236
|
+
<label for="node-input-mindigits"><i class="icon-tag"></i> Min. digits</label>
|
|
237
|
+
<input type="text" id="node-input-mindigits" placeholder="Minimum number of dtmf digits expected to gather">
|
|
238
|
+
</div>
|
|
239
|
+
<div class="form-row">
|
|
240
|
+
<label for="node-input-maxdigits"><i class="icon-tag"></i> Max. digits</label>
|
|
241
|
+
<input type="text" id="node-input-maxdigits" placeholder="Maximum number of dtmf digits expected to gather">
|
|
242
|
+
</div>
|
|
243
|
+
<div class="form-row">
|
|
244
|
+
<label for="node-input-interdigittimeout"><i class="icon-tag"></i> Inter digit timeout</label>
|
|
245
|
+
<input type="text" id="node-input-interdigittimeout" placeholder="Amount of time to wait between digits after minDigits have been entered">
|
|
246
|
+
</div>
|
|
221
247
|
<div class="form-row">
|
|
222
248
|
<label for="node-input-numtimeout"><i class="icon-tag"></i> Timeout</label>
|
|
223
249
|
<input type="text" id="node-input-timeout" placeholder="dtmf timeout in secs">
|
package/src/nodes/gather.js
CHANGED
|
@@ -12,6 +12,7 @@ module.exports = function(RED) {
|
|
|
12
12
|
|
|
13
13
|
var obj = {verb: 'gather', input: []};
|
|
14
14
|
if (config.actionhook) obj.actionHook = new_resolve(RED, config.actionhook, config.actionhookType, node, msg)
|
|
15
|
+
if (config.partialresulthook) obj.partialResultHook = new_resolve(RED, config.partialresulthook, config.partialresulthookType, node, msg)
|
|
15
16
|
|
|
16
17
|
// input
|
|
17
18
|
if (config.speechinput) {
|
|
@@ -53,6 +54,10 @@ module.exports = function(RED) {
|
|
|
53
54
|
if (config.finishonkey && config.finishonkey.length) obj.finishOnKey = config.finishonkey;
|
|
54
55
|
if (/^\d+$/.test(config.numdigits)) obj.numDigits = parseInt(config.numdigits);
|
|
55
56
|
if (/^\d+$/.test(config.timeout)) obj.timeout = parseInt(config.timeout);
|
|
57
|
+
if (/^\d+$/.test(config.mindigits)) obj.minDigits = parseInt(config.mindigits);
|
|
58
|
+
if (/^\d+$/.test(config.maxdigits)) obj.maxDigits = parseInt(config.maxdigits);
|
|
59
|
+
if (/^\d+$/.test(config.interdigittimeout)) obj.interDigitTimeout = parseInt(config.interdigittimeout);
|
|
60
|
+
|
|
56
61
|
if (config.dtmfbargein) obj.dtmfBargein = config.dtmfbargein;
|
|
57
62
|
}
|
|
58
63
|
|
package/src/nodes/listen.html
CHANGED
|
@@ -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-
|
|
81
|
+
$('#node-input-authpass').typedInput({
|
|
80
82
|
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
|
|
81
|
-
typeField: $('#node-input-
|
|
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-
|
|
135
|
-
<input type="text" id="node-input-
|
|
136
|
-
<input type="hidden" id="node-input-
|
|
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">
|
|
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>
|
|
315
|
+
<p>Send live audio for the call to an over a websocket connection</p>
|
|
306
316
|
<h3>Properties</h3>
|
|
307
|
-
<p><code>
|
|
308
|
-
|
|
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
|
-
|
|
324
|
+
Webhook to invoke when listen operation ends</p>
|
|
315
325
|
<p><code>Metadata</code> -
|
|
316
|
-
|
|
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
|
-
|
|
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
|
-
|
|
323
|
-
|
|
324
|
-
|
|
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
|
-
|
|
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
|
-
|
|
346
|
+
If checked, send interim transcriptions</p>
|
|
333
347
|
<p><code>Profanity filter</code> -
|
|
334
|
-
|
|
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>
|
package/src/nodes/listen.js
CHANGED
|
@@ -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,
|