@jambonz/node-red-contrib-jambonz 2.3.10 → 2.4.1

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.
Files changed (60) hide show
  1. package/package.json +5 -5
  2. package/resources/editor.js +5 -3
  3. package/resources/icons/mustache.svg +1 -0
  4. package/src/nodes/{template.js → _template.js} +1 -1
  5. package/src/nodes/conference.html +11 -4
  6. package/src/nodes/conference.js +5 -7
  7. package/src/nodes/config.html +17 -17
  8. package/src/nodes/config.js +18 -18
  9. package/src/nodes/create_call.html +11 -4
  10. package/src/nodes/create_call.js +5 -5
  11. package/src/nodes/create_sms.html +11 -4
  12. package/src/nodes/create_sms.js +5 -5
  13. package/src/nodes/dequeue.html +11 -5
  14. package/src/nodes/dequeue.js +7 -6
  15. package/src/nodes/dial.html +25 -20
  16. package/src/nodes/dial.js +19 -19
  17. package/src/nodes/dialogflow.html +16 -10
  18. package/src/nodes/dialogflow.js +10 -11
  19. package/src/nodes/dtmf.html +8 -2
  20. package/src/nodes/dtmf.js +3 -3
  21. package/src/nodes/enqueue.html +10 -4
  22. package/src/nodes/enqueue.js +5 -7
  23. package/src/nodes/gather.html +17 -5
  24. package/src/nodes/gather.js +8 -8
  25. package/src/nodes/get_alerts.html +9 -3
  26. package/src/nodes/get_alerts.js +4 -4
  27. package/src/nodes/get_calls.html +10 -4
  28. package/src/nodes/get_calls.js +5 -10
  29. package/src/nodes/get_recent_calls.html +12 -5
  30. package/src/nodes/get_recent_calls.js +6 -6
  31. package/src/nodes/lcc.html +12 -5
  32. package/src/nodes/lcc.js +6 -6
  33. package/src/nodes/lex.html +25 -10
  34. package/src/nodes/lex.js +10 -11
  35. package/src/nodes/libs.js +36 -0
  36. package/src/nodes/listen.html +14 -7
  37. package/src/nodes/listen.js +12 -12
  38. package/src/nodes/message.html +10 -4
  39. package/src/nodes/message.js +5 -10
  40. package/src/nodes/pause.html +8 -1
  41. package/src/nodes/pause.js +2 -3
  42. package/src/nodes/play.html +9 -1
  43. package/src/nodes/play.js +2 -2
  44. package/src/nodes/rasa.html +10 -4
  45. package/src/nodes/rasa.js +5 -5
  46. package/src/nodes/redirect.html +7 -1
  47. package/src/nodes/redirect.js +2 -2
  48. package/src/nodes/say.html +1 -1
  49. package/src/nodes/say.js +2 -2
  50. package/src/nodes/sip-decline.html +8 -2
  51. package/src/nodes/sip-decline.js +3 -3
  52. package/src/nodes/sip-refer.html +11 -5
  53. package/src/nodes/sip-refer.js +6 -6
  54. package/src/nodes/sip-request.html +9 -3
  55. package/src/nodes/sip-request.js +4 -4
  56. package/src/nodes/tag.html +7 -1
  57. package/src/nodes/tag.js +2 -2
  58. package/src/nodes/userauth.html +11 -5
  59. package/src/nodes/userauth.js +6 -6
  60. /package/src/nodes/{template.html → _template.html} +0 -0
package/src/nodes/dial.js CHANGED
@@ -1,4 +1,4 @@
1
- var {appendVerb, v_resolve} = require('./libs')
1
+ var {appendVerb, new_resolve} = require('./libs')
2
2
 
3
3
  module.exports = function(RED) {
4
4
  function dial(config) {
@@ -9,9 +9,9 @@ module.exports = function(RED) {
9
9
  node.log(`dial config: ${JSON.stringify(config)}, msg.call: ${JSON.stringify(msg.call)}`);
10
10
  var target = config.targets.map((t) => {
11
11
  const obj = Object.assign({}, t);
12
- var dest = v_resolve(obj.dest, obj.varType, this.context(), msg);
13
- var trunk = v_resolve(obj.trunk, obj.trunkType, this.context(), msg);
14
- node.log(`dial: dest ${t.varType}:${t.dest} resolved to ${dest}`);
12
+ var dest = new_resolve(RED, config.dest, config.destType, node, msg)
13
+ var trunk = new_resolve(RED, config.trunk, config.trunkType, node, msg)
14
+ node.log(`dial: dest ${t.destType}:${t.dest} resolved to ${dest}`);
15
15
  switch (t.type) {
16
16
  case 'phone':
17
17
  obj.number = dest;
@@ -46,11 +46,11 @@ module.exports = function(RED) {
46
46
  answerOnBridge: config.answeronbridge,
47
47
  timeLimit: config.timelimit ? parseInt(config.timelimit) : null,
48
48
  timeout: config.timeout ? parseInt(config.timeout) : null,
49
- callerId: v_resolve(config.callerid, config.calleridType, this.context(), msg),
50
- actionHook: v_resolve(config.actionhook, config.actionhookType, this.context(), msg),
51
- confirmHook: v_resolve(config.confirmhook, config.confirmhookType, this.context(), msg),
52
- dialMusic: v_resolve(config.dialmusic, config.dialmusicType, this.context(), msg),
53
- dtmfHook: v_resolve(config.dtmfhook, config.dtmfhookType, this.context(), msg)
49
+ callerId: new_resolve(RED, config.callerId, config.callerIdType, node, msg),
50
+ actionHook: new_resolve(RED, config.actionHook, config.actionHookType, node, msg),
51
+ confirmHook: new_resolve(RED, config.confirmHook, config.confirmHookType, node, msg),
52
+ dialMusic: new_resolve(RED, config.dialMusic, config.dialMusicType, node, msg),
53
+ dtmfHook: new_resolve(RED, config.dtmfHook, config.dtmfHookType, node, msg),
54
54
  };
55
55
 
56
56
  // headers
@@ -63,7 +63,7 @@ module.exports = function(RED) {
63
63
  // nested listen
64
64
  if (config.listenurl && config.listenurl.length > 0) {
65
65
  data.listen = {
66
- url: v_resolve(config.listenurl, config.listenurlType, this.context(), msg),
66
+ url: new_resolve(RED, config.listenurl, config.listenurlType, node, msg),
67
67
  mixType: 'stereo'
68
68
  };
69
69
  }
@@ -78,11 +78,11 @@ module.exports = function(RED) {
78
78
  diarization: config.diarization
79
79
  };
80
80
  if (recognizer.vendor === 'google') {
81
- var diarizationMin = v_resolve(config.diarizationmin, config.diarizationminType, this.context(), msg);
82
- var diarizationMax = v_resolve(config.diarizationmax, config.diarizationmaxType, this.context(), msg);
83
- var hints = v_resolve(config.transcriptionhints, config.transcriptionhintsType, this.context(), msg);
84
- var altlangs = v_resolve(config.recognizeraltlang, config.recognizeraltlangType, this.context(), msg);
85
- var naics = v_resolve(config.naics, config.naicsType, this.context(), msg);
81
+ var diarizationMin = new_resolve(RED, config.diarizationMin, config.diarizationMinType, node, msg);
82
+ var diarizationMax = new_resolve(RED, config.diarizationMax, config.diarizationMaxType, node, msg)
83
+ var hints = new_resolve(RED, config.hints, config.hintsType, node, msg)
84
+ var altlangs = new_resolve(RED, config.altlangs, config.altlangsType, node, msg)
85
+ var naics = new_resolve(RED, config.naics, config.naicsType, node, msg)
86
86
  Object.assign(recognizer, {
87
87
  profanityFilter: config.profanityfilter,
88
88
  hints: hints.length > 0 ?
@@ -103,8 +103,8 @@ module.exports = function(RED) {
103
103
  }
104
104
  }
105
105
  else if (recognizer.vendor === 'aws') {
106
- var vocab = v_resolve(config.vocabularyname, config.vocabularynameType, this.context(), msg);
107
- var vocabFilter = v_resolve(config.vocabularyfiltername, config.vocabularynameType, this.context(), msg);
106
+ var vocab = new_resolve(RED, config.vocabularyname, config.vocabularynameType, node, msg);
107
+ var vocabFilter = new_resolve(RED, config.vocabularyfiltername, config.vocabularyfilternameType, node, msg);
108
108
  Object.assign(recognizer, {
109
109
  vocabularyName: vocab,
110
110
  vocabularyFilterName: vocabFilter,
@@ -112,12 +112,12 @@ module.exports = function(RED) {
112
112
  });
113
113
  }
114
114
  data.transcribe = {
115
- transcriptionHook: v_resolve(config.transcriptionhook, config.transcriptionhookType, this.context(), msg),
115
+ transcriptionHook: new_resolve(RED, config.transcriptionHook, config.transcriptionHookType, node, msg),
116
116
  recognizer
117
117
  };
118
118
  }
119
119
  // dtmf capture
120
- const dtmfCapture = v_resolve(config.dtmfcapture, config.dtmfcaptureType, this.context(), msg);
120
+ const dtmfCapture = new_resolve(RED, config.dtmfcapture, config.dtmfcaptureType, node, msg);
121
121
  if (dtmfCapture && dtmfCapture.length) {
122
122
  data.dtmfCapture = dtmfCapture.split(',').map((i) => i.trim());
123
123
  }
@@ -1,5 +1,11 @@
1
1
  <!-- Javascript -->
2
2
  <script type="text/javascript">
3
+ var mustacheType = {
4
+ value: 'mustache',
5
+ label: 'mustache',
6
+ hasvalue: true,
7
+ icon: 'resources/@jambonz/node-red-contrib-jambonz/icons/mustache.svg'
8
+ }
3
9
  RED.nodes.registerType('dialogflow',{
4
10
  category: 'jambonz',
5
11
  color: '#bbabaa',
@@ -50,39 +56,39 @@
50
56
  var node = this;
51
57
  $('#node-input-serviceAccountCredentials').typedInput({
52
58
  typeField: $('#node-input-serviceAccountCredentialsType'),
53
- types: ['json', 'msg', 'flow', 'global', 'jsonata', 'env']
59
+ types: ['json', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType]
54
60
  });
55
61
  $('#node-input-project').typedInput({
56
62
  typeField: $('#node-input-projectType'),
57
- types: ['str','msg', 'flow', 'global', 'jsonata', 'env']
63
+ types: ['str','msg', 'flow', 'global', 'jsonata', 'env', mustacheType]
58
64
  });
59
65
  $('#node-input-environment').typedInput({
60
66
  typeField: $('#node-input-environmentType'),
61
- types: ['str','msg', 'flow', 'global', 'jsonata', 'env']
67
+ types: ['str','msg', 'flow', 'global', 'jsonata', 'env', mustacheType]
62
68
  });
63
69
  $('#node-input-welcomeEvent').typedInput({
64
70
  typeField: $('#node-input-welcomeEventType'),
65
- types: ['str','msg', 'flow', 'global', 'jsonata', 'env']
71
+ types: ['str','msg', 'flow', 'global', 'jsonata', 'env', mustacheType]
66
72
  });
67
73
  $('#node-input-welcomeEventParams').typedInput({
68
74
  typeField: $('#node-input-welcomeEventParamsType'),
69
- types: ['json', 'msg', 'flow', 'global', 'jsonata', 'env']
75
+ types: ['json', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType]
70
76
  });
71
77
  $('#node-input-eventHook').typedInput({
72
78
  typeField: $('#node-input-eventHookType'),
73
- types: ['str','msg', 'flow', 'global', 'jsonata', 'env']
79
+ types: ['str','msg', 'flow', 'global', 'jsonata', 'env', mustacheType]
74
80
  });
75
81
  $('#node-input-actionHook').typedInput({
76
82
  typeField: $('#node-input-actionHookType'),
77
- types: ['str','msg', 'flow', 'global', 'jsonata', 'env']
83
+ types: ['str','msg', 'flow', 'global', 'jsonata', 'env', mustacheType]
78
84
  });
79
85
  $('#node-input-inputTimeout').typedInput({
80
- typeField: $('#node-input-inputTimeout'),
81
- types: ['num','msg', 'flow', 'global', 'jsonata', 'env']
86
+ typeField: $('#node-input-inputTimeoutType'),
87
+ types: ['num','msg', 'flow', 'global', 'jsonata', 'env', mustacheType]
82
88
  });
83
89
  $('#node-input-noinputEvent').typedInput({
84
90
  typeField: $('#node-input-noinputEventType'),
85
- types: ['str','msg', 'flow', 'global', 'jsonata', 'env']
91
+ types: ['str','msg', 'flow', 'global', 'jsonata', 'env', mustacheType]
86
92
  });
87
93
  var promptElem = $('#node-input-prompt');
88
94
  var ttsDiv = $('#tts-options');
@@ -1,26 +1,25 @@
1
- var {appendVerb, v_resolve} = require('./libs')
1
+ var {appendVerb, new_resolve} = require('./libs')
2
2
 
3
3
  module.exports = function(RED) {
4
4
  function dialogflow(config) {
5
5
  RED.nodes.createNode(this, config);
6
6
  var node = this;
7
7
  node.on('input', function(msg) {
8
- var val = v_resolve(config.inputTimeout, config.inputTimeoutType, this.context(), msg);
8
+ var val = new_resolve(RED, config.inputTimeout, config.inputTimeoutType, node, msg);
9
9
  var timeout = /^\d+$/.test(val) ? parseInt(val) : 0;
10
- var eventHook = v_resolve(config.eventHook, config.eventHookType, this.context(), msg);
11
- var actionHook = v_resolve(config.actionHook, config.actionHookType, this.context(), msg);
12
- var welcomeEvent = v_resolve(config.welcomeEvent, config.welcomeEventType, this.context(), msg);
13
- var environment = v_resolve(config.environment, config.environmentType, this.context(), msg);
10
+ var eventHook = new_resolve(RED, config.eventHook, config.eventHookType, node, msg);
11
+ var actionHook = new_resolve(RED, config.actionHook, config.actionHookType, node, msg);
12
+ var welcomeEvent = new_resolve(RED, config.welcomeEvent, config.welcomeEventType, node, msg);
13
+ var environment = new_resolve(RED, config.environment, config.environmentType, node, msg);
14
14
  var welcomeEventParams;
15
15
  if (welcomeEvent && welcomeEvent.length > 0) {
16
- welcomeEventParams = v_resolve(config.welcomeEventParams, config.welcomeEventParamsType, this.context(), msg);
16
+ welcomeEventParams = new_resolve(RED, config.welcomeEventParams, config.welcomeEventParamsType, node, msg);
17
17
  }
18
- var noInputEvent = v_resolve(config.noInputEvent, config.noInputEventType, this.context(), msg);
18
+ var noInputEvent = new_resolve(RED, config.noinputEvent, config.noinputEventType, node, msg);
19
19
  const obj = {
20
20
  verb: 'dialogflow',
21
- credentials: v_resolve(config.serviceAccountCredentials,
22
- config.serviceAccountCredentialsType, this.context(), msg),
23
- project: v_resolve(config.project, config.projectType, this.context(), msg),
21
+ credentials: new_resolve(RED, config.serviceAccountCredentials, config.serviceAccountCredentialsType, node, msg),
22
+ project: new_resolve(RED, config.project, config.projectType, node, msg),
24
23
  lang: config.recognizerlang,
25
24
  bargein: config.bargein
26
25
  };
@@ -1,5 +1,11 @@
1
1
  <!-- Javascript -->
2
2
  <script type="text/javascript">
3
+ var mustacheType = {
4
+ value: 'mustache',
5
+ label: 'mustache',
6
+ hasvalue: true,
7
+ icon: 'resources/@jambonz/node-red-contrib-jambonz/icons/mustache.svg'
8
+ }
3
9
  RED.nodes.registerType('dtmf',{
4
10
  category: 'jambonz',
5
11
  color: '#bbabaa',
@@ -15,12 +21,12 @@
15
21
  oneditprepare: function() {
16
22
  $('#node-input-dtmf').typedInput({
17
23
  default: $('#node-input-dtmfType').val(),
18
- types: ['str','msg', 'flow', 'global', 'jsonata', 'env'],
24
+ types: ['str','msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
19
25
  typeField: $('#node-input-dtmfType')
20
26
  })
21
27
  $('#node-input-duration').typedInput({
22
28
  default: $('#node-input-durationType').val(),
23
- types: ['num','msg', 'flow', 'global', 'jsonata', 'env'],
29
+ types: ['num','msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
24
30
  typeField: $('#node-input-durationType')
25
31
  })
26
32
  }
package/src/nodes/dtmf.js CHANGED
@@ -1,4 +1,4 @@
1
- var {appendVerb} = require('./libs')
1
+ var {appendVerb, new_resolve} = require('./libs')
2
2
 
3
3
  module.exports = function(RED) {
4
4
  function dtmf(config) {
@@ -7,8 +7,8 @@ module.exports = function(RED) {
7
7
  node.on('input', function(msg) {
8
8
  appendVerb(msg, {
9
9
  verb: 'dtmf',
10
- dtmf: config.dtmf,
11
- duration: parseInt(config.duration)
10
+ dtmf: new_resolve(RED, config.dtmf, config.dtmfType, node, msg),
11
+ duration: new_resolve(RED, config.duration, config.durationType, node, msg),
12
12
  });
13
13
  node.send(msg);
14
14
  });
@@ -1,5 +1,11 @@
1
1
  <!-- Javascript -->
2
2
  <script type="text/javascript">
3
+ var mustacheType = {
4
+ value: 'mustache',
5
+ label: 'mustache',
6
+ hasvalue: true,
7
+ icon: 'resources/@jambonz/node-red-contrib-jambonz/icons/mustache.svg'
8
+ }
3
9
  RED.nodes.registerType('enqueue',{
4
10
  category: 'jambonz',
5
11
  color: '#bbabaa',
@@ -22,19 +28,19 @@
22
28
  },
23
29
  oneditprepare: function() {
24
30
  $('#node-input-queue').typedInput({
25
- types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
31
+ types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
26
32
  typeField: $('#node-input-queueType')
27
33
  });
28
34
  $('#node-input-priority').typedInput({
29
- types: ['num', 'msg', 'flow', 'global'],
35
+ types: ['num', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
30
36
  typeField: $('#node-input-priorityType')
31
37
  });
32
38
  $('#node-input-actionHook').typedInput({
33
- types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
39
+ types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
34
40
  typeField: $('#node-input-actionHookType')
35
41
  });
36
42
  $('#node-input-waitHook').typedInput({
37
- types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
43
+ types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
38
44
  typeField: $('#node-input-waitHookType')
39
45
  });
40
46
  }
@@ -1,4 +1,4 @@
1
- var {appendVerb, v_resolve} = require('./libs')
1
+ var {appendVerb, new_resolve} = require('./libs')
2
2
 
3
3
  module.exports = function(RED) {
4
4
  /** enqueue */
@@ -6,14 +6,12 @@ module.exports = function(RED) {
6
6
  RED.nodes.createNode(this, config);
7
7
  var node = this;
8
8
  node.on('input', function(msg, send, done) {
9
- const priorityValue = v_resolve(config.priority, config.priorityType, this.context(), msg);
10
-
11
9
  appendVerb(msg, {
12
10
  verb: 'enqueue',
13
- name: v_resolve(config.queue, config.queueType, this.context(), msg),
14
- priority: (/^\d+$/.test(priorityValue)) ? parseInt(priorityValue) : null,
15
- actionHook: v_resolve(config.actionHook, config.actionHookType, this.context(), msg),
16
- waitHook: v_resolve(config.waitHook, config.waitHookType, this.context(), msg)
11
+ name: new_resolve(RED, config.queue, config.queueType, node, msg),
12
+ priority: new_resolve(RED, config.priority, config.priorityType, node, msg),
13
+ actionHook: new_resolve(RED, config.actionHook, config.actionHookType, node, msg),
14
+ waitHook: new_resolve(RED, config.waitHook, config.waitHookType, node, msg)
17
15
  });
18
16
  node.send(msg);
19
17
  });
@@ -1,11 +1,18 @@
1
1
  <!-- Javascript -->
2
2
  <script type="text/javascript">
3
+ var mustacheType = {
4
+ value: 'mustache',
5
+ label: 'mustache',
6
+ hasvalue: true,
7
+ icon: 'resources/@jambonz/node-red-contrib-jambonz/icons/mustache.svg'
8
+ }
3
9
  RED.nodes.registerType('gather',{
4
10
  category: 'jambonz',
5
11
  color: '#bbabaa',
6
12
  defaults: {
7
13
  name: {value: ''},
8
14
  actionhook: {value: ''},
15
+ actionhooktype: {val: 'str'},
9
16
  finishonkey: {value: ''},
10
17
  dtmfinput: {value: 0},
11
18
  speechinput: {value: 1},
@@ -57,21 +64,25 @@
57
64
  var node = this;
58
65
  prepareTtsControls(node);
59
66
  prepareSttControls(node);
60
-
67
+
68
+ $('#node-input-actionhook').typedInput({
69
+ types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
70
+ typeField: $('#node-input-actionhookType')
71
+ });
61
72
  $('#node-input-playurl').typedInput({
62
- types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
73
+ types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
63
74
  typeField: $('#node-input-playurlType')
64
75
  });
65
76
  $('#node-input-transcriptionhints').typedInput({
66
- types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
77
+ types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
67
78
  typeField: $('#node-input-transcriptionhintsType')
68
79
  });
69
80
  $('#node-input-recognizeraltlang').typedInput({
70
- types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
81
+ types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
71
82
  typeField: $('#node-recognizeraltlangType')
72
83
  });
73
84
  $('#node-input-naics').typedInput({
74
- types: ['num', 'msg', 'flow', 'global'],
85
+ types: ['num', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
75
86
  typeField: $('#node-input-naicsType')
76
87
  });
77
88
 
@@ -122,6 +133,7 @@
122
133
  <div class="form-row">
123
134
  <label for="node-input-actionhook"><i class="icon-tag"></i> Action hook</label>
124
135
  <input type="text" id="node-input-actionhook" placeholder="webhook with results of gather">
136
+ <input type="hidden" id="node-input-actionhookType">
125
137
  </div>
126
138
  <fieldset>
127
139
  <legend>Prompt</legend>
@@ -1,4 +1,4 @@
1
- var {appendVerb, v_resolve, v_text_resolve} = require('./libs')
1
+ var {appendVerb, v_text_resolve, new_resolve} = require('./libs')
2
2
 
3
3
  module.exports = function(RED) {
4
4
  /** gather */
@@ -11,7 +11,7 @@ module.exports = function(RED) {
11
11
  node.log(`config: ${JSON.stringify(config)}`);
12
12
 
13
13
  var obj = {verb: 'gather', input: []};
14
- if (config.actionhook) obj.actionHook = config.actionhook;
14
+ if (config.actionhook) obj.actionHook = new_resolve(RED, config.actionHook, config.actionHookType, node, msg)
15
15
 
16
16
  // input
17
17
  if (config.speechinput) {
@@ -21,9 +21,9 @@ module.exports = function(RED) {
21
21
  language: config.recognizerlang
22
22
  };
23
23
  if (recognizer.vendor === 'google') {
24
- var hints = v_resolve(config.transcriptionhints, config.transcriptionhintsType, this.context(), msg);
25
- var altlangs = v_resolve(config.recognizeraltlang, config.recognizeraltlangType, this.context(), msg);
26
- var naics = v_resolve(config.naics, config.naicsType, this.context(), msg);
24
+ var hints = new_resolve(RED, config.transcriptionhints, config.transcriptionhintsType, node, msg);
25
+ var altlangs = new_resolve(RED, config.recognizeraltlang, config.recognizeraltlangType, node, msg);
26
+ var naics = new_resolve(RED, config.naics, config.naicsType, node, msg);
27
27
  Object.assign(recognizer, {
28
28
  profanityFilter: config.profanityfilter,
29
29
  hints: hints.length > 0 ?
@@ -36,8 +36,8 @@ module.exports = function(RED) {
36
36
  }
37
37
  }
38
38
  else if (recognizer.vendor === 'aws') {
39
- var vocab = v_resolve(config.vocabularyname, config.vocabularynameType, this.context(), msg);
40
- var vocabFilter = v_resolve(config.vocabularyfiltername, config.vocabularynameType, this.context(), msg);
39
+ var vocab = new_resolve(RED, config.vocabularyname, config.vocabularynameType, node, msg);
40
+ var vocabFilter = new_resolve(RED, config.vocabularyfiltername, config.vocabularyfilternameType, node, msg);
41
41
  Object.assign(recognizer, {
42
42
  vocabularyName: vocab,
43
43
  vocabularyFilterName: vocabFilter,
@@ -66,7 +66,7 @@ module.exports = function(RED) {
66
66
  });
67
67
  }
68
68
  }
69
- else obj.play = {url: v_resolve(config.playurl, config.playurlType, this.context(), msg)};
69
+ else obj.play = {url: new_resolve(RED, config.playurl, config.playurlType, node, msg)};
70
70
 
71
71
  node.log(`gather: ${JSON.stringify(obj)}`);
72
72
 
@@ -1,5 +1,11 @@
1
1
  <!-- Javascript -->
2
2
  <script type="text/javascript">
3
+ var mustacheType = {
4
+ value: 'mustache',
5
+ label: 'mustache',
6
+ hasvalue: true,
7
+ icon: 'resources/@jambonz/node-red-contrib-jambonz/icons/mustache.svg'
8
+ }
3
9
  RED.nodes.registerType('get_alerts',{
4
10
  category: 'jambonz',
5
11
  color: '#aebfb9',
@@ -21,15 +27,15 @@ RED.nodes.registerType('get_alerts',{
21
27
  oneditprepare: () => {
22
28
  var node = this;
23
29
  $('#node-input-page').typedInput({
24
- types: ['num', 'msg', 'flow', 'global', 'jsonata', 'env'],
30
+ types: ['num', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
25
31
  typeField: $('#node-input-pageType')
26
32
  });
27
33
  $('#node-input-count').typedInput({
28
- types: ['num', 'msg', 'flow', 'global', 'jsonata', 'env'],
34
+ types: ['num', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
29
35
  typeField: $('#node-input-countType')
30
36
  });
31
37
  $('#node-input-days').typedInput({
32
- types: ['num', 'msg', 'flow', 'global', 'jsonata', 'env'],
38
+ types: ['num', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
33
39
  typeField: $('#node-input-daysType')
34
40
  });
35
41
  }
@@ -1,5 +1,5 @@
1
1
  const bent = require('bent');
2
- var {v_resolve} = require('./libs');
2
+ var {new_resolve} = require('./libs');
3
3
 
4
4
  module.exports = function(RED) {
5
5
  function get_alerts(config) {
@@ -9,9 +9,9 @@ module.exports = function(RED) {
9
9
  const {accountSid, apiToken} = server.credentials;
10
10
  node.on('input', async(msg, send, done) => {
11
11
  const data = {
12
- page: v_resolve(config.page, config.pageType, this.context(), msg),
13
- count: v_resolve(config.count, config.countType, this.context(), msg),
14
- days: v_resolve(config.days, config.daysType, this.context(), msg),
12
+ page: new_resolve(RED, config.page, config.pageType, node, msg),
13
+ count: new_resolve(RED, config.count, config.countType, node, msg),
14
+ days: new_resolve(RED, config.days, config.daysType, node, msg),
15
15
  }
16
16
  Object.keys(data).forEach((k) => data[k] == null || data[k] == '' && delete data[k]);
17
17
  const params = new URLSearchParams(data).toString()
@@ -1,5 +1,11 @@
1
1
  <!-- Javascript -->
2
2
  <script type="text/javascript">
3
+ var mustacheType = {
4
+ value: 'mustache',
5
+ label: 'mustache',
6
+ hasvalue: true,
7
+ icon: 'resources/@jambonz/node-red-contrib-jambonz/icons/mustache.svg'
8
+ }
3
9
  RED.nodes.registerType('get_calls',{
4
10
  category: 'jambonz',
5
11
  color: '#aebfb9',
@@ -22,19 +28,19 @@
22
28
  label: function() { return this.name || 'Get Calls';},
23
29
  oneditprepare: () => {
24
30
  $('#node-input-direction').typedInput({
25
- types: ['str', 'msg', 'flow', 'global'],
31
+ types: ['str','msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
26
32
  typeField: $('#node-input-directionType')
27
33
  });
28
34
  $('#node-input-from').typedInput({
29
- types: ['str', 'msg', 'flow', 'global'],
35
+ types: ['str','msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
30
36
  typeField: $('#node-input-fromType')
31
37
  });
32
38
  $('#node-input-to').typedInput({
33
- types: ['str', 'msg', 'flow', 'global'],
39
+ types: ['str','msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
34
40
  typeField: $('#node-input-toType')
35
41
  });
36
42
  $('#node-input-callStatus').typedInput({
37
- types: ['str', 'msg', 'flow', 'global'],
43
+ types: ['str','msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
38
44
  typeField: $('#node-input-callStatusType')
39
45
  });
40
46
  }
@@ -1,5 +1,5 @@
1
1
  const bent = require("bent");
2
- var { v_resolve } = require("./libs");
2
+ var { new_resolve} = require("./libs");
3
3
 
4
4
  module.exports = function (RED) {
5
5
  function get_calls(config) {
@@ -9,15 +9,10 @@ module.exports = function (RED) {
9
9
  const { accountSid, apiToken } = server.credentials;
10
10
  node.on("input", async (msg, send, done) => {
11
11
  const data = {
12
- direction: v_resolve(
13
- config.direction,
14
- config.directionType,
15
- this.context(),
16
- msg
17
- ),
18
- from: v_resolve(config.from, config.fromType, this.context(), msg),
19
- to: v_resolve(config.to, config.toType, this.context(), msg),
20
- callStatus: v_resolve(config.callStatus, config.callStatusType, this.context(), msg),
12
+ direction: new_resolve(RED, config.direction, config.directionType, node, msg),
13
+ from: new_resolve(RED, config.from, config.fromType, node, msg),
14
+ to: new_resolve(RED, config.to, config.toType, node, msg),
15
+ callStatus: new_resolve(RED, config.callStatus, config.callStatusType, node, msg),
21
16
  };
22
17
  Object.keys(data).forEach(
23
18
  (k) => data[k] == null || (data[k] == '' && delete data[k])
@@ -1,5 +1,12 @@
1
1
  <!-- Javascript -->
2
2
  <script type="text/javascript">
3
+ var mustacheType = {
4
+ value: 'mustache',
5
+ label: 'mustache',
6
+ hasvalue: true,
7
+ icon: 'resources/@jambonz/node-red-contrib-jambonz/icons/mustache.svg'
8
+ }
9
+
3
10
  RED.nodes.registerType('get_recent_calls',{
4
11
  category: 'jambonz',
5
12
  color: '#aebfb9',
@@ -24,23 +31,23 @@
24
31
  label: function() { return this.name || 'Get Recent Calls';},
25
32
  oneditprepare: () => {
26
33
  $('#node-input-page').typedInput({
27
- types: ['num', 'msg', 'flow', 'global', 'jsonata', 'env'],
34
+ types: ['num', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
28
35
  typeField: $('#node-input-pageType')
29
36
  });
30
37
  $('#node-input-count').typedInput({
31
- types: ['num', 'msg', 'flow', 'global', 'jsonata', 'env'],
38
+ types: ['num', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
32
39
  typeField: $('#node-input-countType')
33
40
  });
34
41
  $('#node-input-days').typedInput({
35
- types: ['num', 'msg', 'flow', 'global', 'jsonata', 'env'],
42
+ types: ['num', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
36
43
  typeField: $('#node-input-daysType')
37
44
  });
38
45
  $('#node-input-direction').typedInput({
39
- types: ['str', 'msg', 'flow', 'global'],
46
+ types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
40
47
  typeField: $('#node-input-directionType')
41
48
  });
42
49
  $('#node-input-trunk').typedInput({
43
- types: ['str', 'msg', 'flow', 'global'],
50
+ types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
44
51
  typeField: $('#node-input-trunkType')
45
52
  });
46
53
  }
@@ -1,5 +1,5 @@
1
1
  const bent = require('bent');
2
- var {v_resolve} = require('./libs');
2
+ var {new_resolve} = require('./libs');
3
3
 
4
4
  module.exports = function(RED) {
5
5
  function get_recent_calls(config) {
@@ -9,11 +9,11 @@ module.exports = function(RED) {
9
9
  const {accountSid, apiToken} = server.credentials;
10
10
  node.on('input', async(msg, send, done) => {
11
11
  const data = {
12
- direction: v_resolve(config.direction, config.directionType, this.context(), msg),
13
- trunk: v_resolve(config.trunk, config.trunkType, this.context(), msg),
14
- page: v_resolve(config.page, config.pageType, this.context(), msg),
15
- count: v_resolve(config.count, config.countType, this.context(), msg),
16
- days: v_resolve(config.days, config.daysType, this.context(), msg),
12
+ direction: new_resolve(RED, config.direction, config.directionType, node, msg),
13
+ trunk: new_resolve(RED, config.trunk, config.trunkType, node, msg),
14
+ page: new_resolve(RED, config.page, config.pageType, node, msg),
15
+ count: new_resolve(RED, config.count, config.countType, node, msg),
16
+ days: new_resolve(RED, config.days, config.daysType, node, msg),
17
17
  }
18
18
  Object.keys(data).forEach((k) => data[k] == null || data[k] == '' && delete data[k]);
19
19
  const params = new URLSearchParams(data).toString();
@@ -1,5 +1,12 @@
1
1
  <!-- Javascript -->
2
2
  <script type="text/javascript">
3
+ var mustacheType = {
4
+ value: 'mustache',
5
+ label: 'mustache',
6
+ hasvalue: true,
7
+ icon: 'resources/@jambonz/node-red-contrib-jambonz/icons/mustache.svg'
8
+ }
9
+
3
10
  RED.nodes.registerType('lcc',{
4
11
  category: 'jambonz',
5
12
  color: '#aebfb9',
@@ -54,27 +61,27 @@
54
61
 
55
62
  $('#node-input-callSid').typedInput({
56
63
  default: $('#node-input-callSidType').val(),
57
- types: ['str','msg', 'flow', 'global', 'jsonata', 'env'],
64
+ types: ['str','msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
58
65
  typeField: $('#node-input-callSidType')
59
66
  });
60
67
  $('#node-input-callHook').typedInput({
61
68
  default: $('#node-input-callHookType').val(),
62
- types: ['str','msg', 'flow', 'global', 'jsonata', 'env'],
69
+ types: ['str','msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
63
70
  typeField: $('#node-input-callHookType')
64
71
  });
65
72
  $('#node-input-waitHook').typedInput({
66
73
  default: $('#node-input-waitHookType').val(),
67
- types: ['str','msg', 'flow', 'global', 'jsonata', 'env'],
74
+ types: ['str','msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
68
75
  typeField: $('#node-input-waitHookType')
69
76
  });
70
77
  $('#node-input-siprecServerURL').typedInput({
71
78
  default: $('#node-input-siprecServerURLType').val(),
72
- types: ['str','msg', 'flow', 'global', 'jsonata', 'env'],
79
+ types: ['str','msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
73
80
  typeField: $('#node-input-siprecServerURLType')
74
81
  });
75
82
  $('#node-input-recordingID').typedInput({
76
83
  default: $('#node-input-recordingIDType').val(),
77
- types: ['str','msg', 'flow', 'global', 'jsonata', 'env'],
84
+ types: ['str','msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
78
85
  typeField: $('#node-input-recordingIDType')
79
86
  });
80
87