@jambonz/node-red-contrib-jambonz 2.4.17 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jambonz/node-red-contrib-jambonz",
3
- "version": "2.4.17",
3
+ "version": "2.4.18",
4
4
  "description": "Node-RED nodes for jambonz platform",
5
5
  "keywords": [
6
6
  "node-red"
@@ -1,12 +1,11 @@
1
1
  <!-- Javascript -->
2
2
  <script type="text/javascript">
3
-
4
- var mustacheType = {
5
- value: 'mustache',
6
- label: 'mustache',
7
- hasvalue: true,
8
- icon: 'resources/@jambonz/node-red-contrib-jambonz/icons/mustache.svg'
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="input" id="node-input-loop" placeholder="number of times to repeat">
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 a wav or mp3 file</p>
90
+ <p>Play recorded audio to a call</p>
59
91
  <h3>Properties</h3>
60
92
  <p><code>Url</code> -
61
- a single url or array of urls (will play in sequence) to a wav or mp3 file</p>
93
+ A single url to a wav or mp3 file</p>
62
94
  <p><code>Early media</code> -
63
- if checked, play the url over an early media connection</p>
95
+ If checked, play the url over an early media connection</p>
64
96
  <p><code>Loop</code> -
65
- number of times to play the url</p>
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
  });