@jambonz/node-red-contrib-jambonz 2.3.11 → 2.4.2

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 +6 -6
  15. package/src/nodes/dial.html +25 -20
  16. package/src/nodes/dial.js +18 -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
@@ -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('sip:refer',{
4
10
  category: 'jambonz',
5
11
  color: '#bbabaa',
@@ -24,27 +30,27 @@
24
30
 
25
31
  $('#node-input-referTo').typedInput({
26
32
  default: $('#node-input-referToType').val(),
27
- types: ['str','msg', 'flow', 'global'],
33
+ types: ['str','msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
28
34
  typeField: $('#node-input-referToType')
29
35
  });
30
36
  $('#node-input-referredBy').typedInput({
31
37
  default: $('#node-input-referredByType').val(),
32
- types: ['str','msg', 'flow', 'global'],
38
+ types: ['str','msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
33
39
  typeField: $('#node-input-referredByType')
34
40
  });
35
41
  $('#node-input-actionHook').typedInput({
36
42
  default: $('#node-input-actionHookType').val(),
37
- types: ['str','msg', 'flow', 'global'],
43
+ types: ['str','msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
38
44
  typeField: $('#node-input-actionHookType')
39
45
  });
40
46
  $('#node-input-eventHook').typedInput({
41
47
  default: $('#node-input-eventHookType').val(),
42
- types: ['str','msg', 'flow', 'global'],
48
+ types: ['str','msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
43
49
  typeField: $('#node-input-actionHookType')
44
50
  });
45
51
  $('#node-input-headers').typedInput({
46
52
  default: $('#node-input-headersType').val(),
47
- types: ['json','msg', 'flow', 'global'],
53
+ types: ['json','msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
48
54
  typeField: $('#node-input-headersType')
49
55
  });
50
56
  }
@@ -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 sip_refer(config) {
@@ -12,15 +12,15 @@ module.exports = function(RED) {
12
12
  });
13
13
  obj = {
14
14
  verb: 'sip:refer',
15
- referTo: config.referTo
15
+ referTo: new_resolve(RED, config.referTo, config.referToType, node, msg)
16
16
  }
17
17
  if (typeof(config.headers == 'string')){
18
18
  config.headers=JSON.parse(config.headers)
19
19
  }
20
- config.headers ? obj.headers = config.headers : null
21
- config.referredBy ? obj.referredBy = config.referredBy : null
22
- config.actionHook ? obj.actionHook = config.actionHook : null
23
- config.eventHook ? obj.eventHook = config.eventHook : null
20
+ config.headers ? obj.headers = new_resolve(RED, config.headers, config.headersType, node, msg) : null
21
+ config.referredBy ? obj.referredBy = new_resolve(RED, config.referredBy, config.referredByType, node, msg) : null
22
+ config.actionHook ? obj.actionHook = new_resolve(RED, config.actionHook, config.actionHookType, node, msg) : null
23
+ config.eventHook ? obj.eventHook = new_resolve(RED, config.eventHook, config.eventHookType, node, msg) : null
24
24
  appendVerb(msg, obj)
25
25
  node.send(msg);
26
26
  });
@@ -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('sip:request',{
4
10
  category: 'jambonz',
5
11
  color: '#bbabaa',
@@ -19,17 +25,17 @@
19
25
  oneditprepare: function() {
20
26
  $('#node-input-headers').typedInput({
21
27
  default: $('#node-input-headersType').val(),
22
- types: ['json','msg', 'flow', 'global'],
28
+ types: ['json','msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
23
29
  typeField: $('#node-input-headersType')
24
30
  });
25
31
  $('#node-input-body').typedInput({
26
32
  default: $('#node-input-bodyType').val(),
27
- types: ['str','msg', 'flow', 'global'],
33
+ types: ['str','msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
28
34
  typeField: $('#node-input-bodyType')
29
35
  });
30
36
  $('#node-input-actionHook').typedInput({
31
37
  default: $('#node-input-actionHookType').val(),
32
- types: ['str','msg', 'flow', 'global'],
38
+ types: ['str','msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
33
39
  typeField: $('#node-input-actionHookType')
34
40
  });
35
41
  }
@@ -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
  /** sip:decline */
@@ -18,9 +18,9 @@ module.exports = function(RED) {
18
18
  if (typeof(config.headers == 'string')){
19
19
  config.headers=JSON.parse(config.headers)
20
20
  }
21
- config.headers ? obj.headers = config.headers : null
22
- config.body ? obj.body = config.body : null
23
- config.actionHook ? obj.actionHook = config.actionHook : null
21
+ config.headers ? obj.headers = new_resolve(RED, config.headers, config.headersType, node, msg) : null
22
+ config.body ? obj.body = new_resolve(RED, config.body, config.bodyType, node, msg) : null
23
+ config.actionHook ? obj.actionHook = new_resolve(RED, config.actionHook, config.actionHookType, node, msg) : null
24
24
  appendVerb(msg, obj)
25
25
  node.send(msg);
26
26
  });
@@ -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('tag',{
4
10
  category: 'jambonz',
5
11
  color: '#bbabaa',
@@ -15,7 +21,7 @@
15
21
  oneditprepare: function() {
16
22
  $('#node-input-data').typedInput({
17
23
  default: $('#node-input-dataType').val(),
18
- types: ['json', 'msg', 'flow', 'global'],
24
+ types: ['json', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
19
25
  typeField: $('#node-input-dataType')
20
26
  });
21
27
  }
package/src/nodes/tag.js CHANGED
@@ -1,11 +1,11 @@
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 tag(config) {
5
5
  RED.nodes.createNode(this, config);
6
6
  var node = this;
7
7
  node.on('input', function(msg) {
8
- var data = v_resolve(config.data, config.dataType, this.context(), msg, true);
8
+ var data = new_resolve(RED, config.data, config.dataType, node, msg);
9
9
  appendVerb(msg, {
10
10
  verb: 'tag',
11
11
  data
@@ -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('user auth',{
4
10
  category: 'jambonz',
5
11
  color:"#c1f986",
@@ -22,23 +28,23 @@ RED.nodes.registerType('user auth',{
22
28
  label: function() { return this.name || 'user auth';},
23
29
  oneditprepare: function() {
24
30
  $('#node-input-password').typedInput({
25
- types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
31
+ types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
26
32
  typeField: $('#node-input-passwordType')
27
33
  });
28
34
  $('#node-input-ha1').typedInput({
29
- types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
35
+ types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
30
36
  typeField: $('#node-input-ha1Type')
31
37
  });
32
38
  $('#node-input-expires').typedInput({
33
- types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
39
+ types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
34
40
  typeField: $('#node-input-expiresType')
35
41
  });
36
42
  $('#node-input-callHook').typedInput({
37
- types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
43
+ types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
38
44
  typeField: $('#node-input-callHookType')
39
45
  });
40
46
  $('#node-input-callStatusHook').typedInput({
41
- types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
47
+ types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
42
48
  typeField: $('#node-input-callStatusHookType')
43
49
  });
44
50
  }
@@ -1,5 +1,5 @@
1
1
  var {createHash} = require('crypto');
2
- var {v_resolve} = require('./libs');
2
+ var {new_resolve} = require('./libs');
3
3
 
4
4
  /** user auth */
5
5
  module.exports = function(RED) {
@@ -12,11 +12,11 @@ module.exports = function(RED) {
12
12
  var authResponse = {};
13
13
  var ha1_string;
14
14
  if (config.ha1 && config.ha1.length) {
15
- ha1_string = v_resolve(config.ha1, config.ha1Type, this.context(), msg);
15
+ ha1_string = new_resolve(RED, config.ha1, config.ha1Type, node, msg),
16
16
  attemptedAuthentication = true;
17
17
  }
18
18
  else if (config.password && config.password.length) {
19
- var password = v_resolve(config.password, config.passwordType, this.context(), msg);
19
+ var password = new_resolve(RED, config.password, config.passwordType, node, msg);
20
20
  var ha1 = createHash('md5');
21
21
  ha1.update([auth.username, auth.realm, password].join(':'));
22
22
  ha1_string = ha1.digest('hex');
@@ -51,13 +51,13 @@ module.exports = function(RED) {
51
51
  if (calculated === auth.response) {
52
52
  let grantedExpires = auth.expires;
53
53
  if (config.expires && config.expires.length) {
54
- const expires = v_resolve(config.expires, config.expiresType, this.context(), msg);
54
+ const expires = new_resolve(RED, config.expires, config.expiresType, node, msg);
55
55
  if (auth.expires && expires != null) {
56
56
  grantedExpires = Math.min(auth.expires, expires);
57
57
  }
58
58
  }
59
- const callHook = v_resolve(config.callHook, config.callHookType, this.context(), msg);
60
- const callStatusHook = v_resolve(config.callStatusHook, config.callStatusHookType, this.context(), msg);
59
+ const callHook = new_resolve(RED, config.callHook, config.callHookType, node, msg);
60
+ const callStatusHook = new_resolve(RED, config.callStatusHook, config.callStatusHookType, node, msg);
61
61
  Object.assign(authResponse, {
62
62
  status: 'ok',
63
63
  expires: grantedExpires != null ? grantedExpires : null,
File without changes