@jambonz/node-red-contrib-jambonz 2.4.16 → 2.4.18
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/lcc.html +2 -0
- package/src/nodes/lcc.js +6 -0
- package/src/nodes/play.html +53 -15
- package/src/nodes/play.js +4 -1
package/package.json
CHANGED
package/src/nodes/lcc.html
CHANGED
|
@@ -292,6 +292,8 @@
|
|
|
292
292
|
<option value="resume">resume listen audio feed</option>
|
|
293
293
|
<option value="redirect">redirect call</option>
|
|
294
294
|
<option value="whisper">whisper</option>
|
|
295
|
+
<option value="pause_transcribe">pause transcribe</option>
|
|
296
|
+
<option value="resume_transcribe">resume transcribe</option>
|
|
295
297
|
<option value="sip_request">sip request</option>
|
|
296
298
|
<option value="start_call_recording">start call recording</option>
|
|
297
299
|
<option value="stop_call_recording">stop call recording</option>
|
package/src/nodes/lcc.js
CHANGED
|
@@ -44,6 +44,12 @@ function lcc(config) {
|
|
|
44
44
|
case 'resume':
|
|
45
45
|
opts.listen_status = 'resume';
|
|
46
46
|
break;
|
|
47
|
+
case 'pause_transcribe':
|
|
48
|
+
opts.transcribe_status = 'pause';
|
|
49
|
+
break;
|
|
50
|
+
case 'resume_transcribe':
|
|
51
|
+
opts.transcribe_status = 'resume';
|
|
52
|
+
break;
|
|
47
53
|
case 'redirect':
|
|
48
54
|
opts.call_hook = {url: new_resolve(RED, config.callHook, config.callHookType, node, msg)};
|
|
49
55
|
if (config.childCallHook) {
|
package/src/nodes/play.html
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
<!-- Javascript -->
|
|
2
2
|
<script type="text/javascript">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
3
|
+
var mustacheType = {
|
|
4
|
+
value: 'mustache',
|
|
5
|
+
label: 'mustache',
|
|
6
|
+
hasvalue: true,
|
|
7
|
+
icon: 'resources/@jambonz/node-red-contrib-jambonz/icons/mustache.svg'
|
|
8
|
+
}
|
|
10
9
|
|
|
11
10
|
RED.nodes.registerType('play',{
|
|
12
11
|
category: 'jambonz',
|
|
@@ -17,6 +16,12 @@ RED.nodes.registerType('play',{
|
|
|
17
16
|
urlType: {value: 'str'},
|
|
18
17
|
early: {value: false},
|
|
19
18
|
loop: {value: 1, required: true, validate: RED.validators.number()},
|
|
19
|
+
timeout: {value: ''},
|
|
20
|
+
timeoutType: {value: 'num'},
|
|
21
|
+
offset: {value: ''},
|
|
22
|
+
offsetType: {value: 'num'},
|
|
23
|
+
hook: {value: ''},
|
|
24
|
+
hookType: {value: 'str'}
|
|
20
25
|
},
|
|
21
26
|
inputs:1,
|
|
22
27
|
outputs:1,
|
|
@@ -28,8 +33,20 @@ RED.nodes.registerType('play',{
|
|
|
28
33
|
types: ['str','msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
|
|
29
34
|
typeField: $('#node-input-urlType')
|
|
30
35
|
});
|
|
36
|
+
$('#node-input-timeout').typedInput({
|
|
37
|
+
types: ['num', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
|
|
38
|
+
typeField: $('#node-input-timeoutType')
|
|
39
|
+
});
|
|
40
|
+
$('#node-input-offset').typedInput({
|
|
41
|
+
types: ['num', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
|
|
42
|
+
typeField: $('#node-input-offsetType')
|
|
43
|
+
});
|
|
44
|
+
$('#node-input-hook').typedInput({
|
|
45
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
|
|
46
|
+
typeField: $('#node-input-hookType')
|
|
47
|
+
});
|
|
31
48
|
}
|
|
32
|
-
|
|
49
|
+
});
|
|
33
50
|
</script>
|
|
34
51
|
|
|
35
52
|
<!-- HTML -->
|
|
@@ -49,21 +66,42 @@ RED.nodes.registerType('play',{
|
|
|
49
66
|
</div>
|
|
50
67
|
<div class="form-row">
|
|
51
68
|
<label for="node-input-loop"><i class="icon-tag"></i>Loop</label>
|
|
52
|
-
<input type="
|
|
53
|
-
</div>
|
|
69
|
+
<input type="number" step="1" id="node-input-loop" placeholder="number of times to repeat">
|
|
70
|
+
</div>
|
|
71
|
+
<div class="form-row">
|
|
72
|
+
<label for="node-input-timeout">Timeout</label>
|
|
73
|
+
<input type="text" id="node-input-timeout" placeholder="timeout in secs">
|
|
74
|
+
<input type="hidden" id="node-input-timeoutType">
|
|
75
|
+
</div>
|
|
76
|
+
<div class="form-row">
|
|
77
|
+
<label for="node-input-offset">Seek Offset</label>
|
|
78
|
+
<input type="text" id="node-input-offset" placeholder="samples to seek">
|
|
79
|
+
<input type="hidden" id="node-input-offsetType">
|
|
80
|
+
</div>
|
|
81
|
+
<div class="form-row">
|
|
82
|
+
<label for="node-input-hook">Action hook</label>
|
|
83
|
+
<input type="text" id="node-input-hook" placeholder="url">
|
|
84
|
+
<input type="hidden" id="node-input-hookType">
|
|
85
|
+
</div>
|
|
54
86
|
</script>
|
|
55
87
|
|
|
56
88
|
<!-- Help Text -->
|
|
57
89
|
<script type="text/html" data-help-name="play">
|
|
58
|
-
<p>Play
|
|
90
|
+
<p>Play recorded audio to a call</p>
|
|
59
91
|
<h3>Properties</h3>
|
|
60
92
|
<p><code>Url</code> -
|
|
61
|
-
|
|
93
|
+
A single url to a wav or mp3 file</p>
|
|
62
94
|
<p><code>Early media</code> -
|
|
63
|
-
|
|
95
|
+
If checked, play the url over an early media connection</p>
|
|
64
96
|
<p><code>Loop</code> -
|
|
65
|
-
|
|
66
|
-
|
|
97
|
+
The Number of times to play the url</p>
|
|
98
|
+
<p><code>Timeout</code> -
|
|
99
|
+
The number of seconds to play the url</p>
|
|
100
|
+
<p><code>Seek Offset</code> -
|
|
101
|
+
How many samples to seek into the url</p>
|
|
102
|
+
<p><code>Action hook</code> -
|
|
103
|
+
Webhook that is called when the play verb completes</p>
|
|
104
|
+
|
|
67
105
|
<h3>Outputs</h3>
|
|
68
106
|
<dl class="message-properties">
|
|
69
107
|
<dt>jambonz<span class="property-type">object</span></dt>
|
package/src/nodes/play.js
CHANGED
|
@@ -9,7 +9,10 @@ module.exports = function(RED) {
|
|
|
9
9
|
verb: 'play',
|
|
10
10
|
url: new_resolve(RED, config.url, config.urlType, node, msg),
|
|
11
11
|
earlyMedia: config.early,
|
|
12
|
-
loop: config.loop
|
|
12
|
+
loop: config.loop,
|
|
13
|
+
timeoutSecs: config.timeout ? new_resolve(RED, config.timeout, config.timeoutType, node, msg) : null,
|
|
14
|
+
seekOffset: config.offset ? new_resolve(RED, config.offset, config.offsetType, node, msg) : null,
|
|
15
|
+
actionHook: config.hook ? new_resolve(RED, config.hook, config.hookType, node, msg) : null
|
|
13
16
|
});
|
|
14
17
|
node.send(msg);
|
|
15
18
|
});
|