@jambonz/node-red-contrib-jambonz 2.3.1 → 2.3.4

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 (66) hide show
  1. package/package.json +4 -4
  2. package/src/nodes/auth.html +9 -16
  3. package/src/nodes/auth.js +2 -9
  4. package/src/nodes/conference.html +12 -15
  5. package/src/nodes/conference.js +0 -4
  6. package/src/nodes/config.js +0 -4
  7. package/src/nodes/create_call.html +12 -18
  8. package/src/nodes/create_call.js +24 -22
  9. package/src/nodes/create_sms.html +18 -21
  10. package/src/nodes/create_sms.js +8 -10
  11. package/src/nodes/dequeue.html +6 -8
  12. package/src/nodes/dequeue.js +0 -4
  13. package/src/nodes/dial.html +3 -8
  14. package/src/nodes/dial.js +0 -5
  15. package/src/nodes/dialogflow.html +3 -13
  16. package/src/nodes/dialogflow.js +0 -5
  17. package/src/nodes/dtmf.html +5 -11
  18. package/src/nodes/dtmf.js +0 -5
  19. package/src/nodes/enqueue.html +7 -14
  20. package/src/nodes/enqueue.js +0 -6
  21. package/src/nodes/gather.html +3 -8
  22. package/src/nodes/gather.js +0 -5
  23. package/src/nodes/get_alerts.html +5 -27
  24. package/src/nodes/get_alerts.js +14 -16
  25. package/src/nodes/get_calls.html +6 -28
  26. package/src/nodes/get_calls.js +36 -36
  27. package/src/nodes/get_recent_calls.html +25 -27
  28. package/src/nodes/get_recent_calls.js +21 -21
  29. package/src/nodes/hangup.html +5 -11
  30. package/src/nodes/hangup.js +2 -7
  31. package/src/nodes/lcc.html +12 -19
  32. package/src/nodes/lcc.js +0 -4
  33. package/src/nodes/leave.html +4 -5
  34. package/src/nodes/leave.js +0 -6
  35. package/src/nodes/lex.html +5 -3
  36. package/src/nodes/lex.js +0 -5
  37. package/src/nodes/listen.html +2 -3
  38. package/src/nodes/listen.js +0 -5
  39. package/src/nodes/message.html +5 -6
  40. package/src/nodes/message.js +30 -30
  41. package/src/nodes/pause.html +5 -8
  42. package/src/nodes/pause.js +0 -6
  43. package/src/nodes/play.html +7 -10
  44. package/src/nodes/play.js +0 -5
  45. package/src/nodes/rasa.html +5 -13
  46. package/src/nodes/rasa.js +1 -5
  47. package/src/nodes/redirect.html +4 -8
  48. package/src/nodes/redirect.js +0 -6
  49. package/src/nodes/s3-upload.html +0 -2
  50. package/src/nodes/s3-upload.js +1 -6
  51. package/src/nodes/say.html +5 -7
  52. package/src/nodes/say.js +0 -4
  53. package/src/nodes/sip-decline.html +5 -8
  54. package/src/nodes/sip-decline.js +0 -5
  55. package/src/nodes/sip-refer.html +4 -12
  56. package/src/nodes/sip-refer.js +1 -5
  57. package/src/nodes/sip-request.html +5 -11
  58. package/src/nodes/sip-request.js +1 -8
  59. package/src/nodes/tag.html +2 -4
  60. package/src/nodes/tag.js +0 -5
  61. package/src/nodes/template.html +7 -16
  62. package/src/nodes/userauth.html +47 -21
  63. package/src/nodes/userauth.js +18 -6
  64. package/src/nodes/webhooks.html +26 -29
  65. package/src/utils/http-helpers.js +5 -4
  66. package/src/utils/tts-utils.js +1 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jambonz/node-red-contrib-jambonz",
3
- "version": "2.3.1",
4
- "description": "Node-RED nodes for jambonz",
3
+ "version": "2.3.4",
4
+ "description": "Node-RED nodes for jambonz platform",
5
5
  "keywords": [
6
6
  "node-red"
7
7
  ],
@@ -53,7 +53,7 @@
53
53
  "author": "Dave Horton",
54
54
  "license": "MIT",
55
55
  "dependencies": {
56
- "aws-sdk": "^2.833.0",
56
+ "aws-sdk": "^2.1302.0",
57
57
  "bent": "^7.3.12",
58
58
  "body-parser": "^1.20.1",
59
59
  "cookie-parser": "^1.4.6",
@@ -66,6 +66,6 @@
66
66
  "on-headers": "^1.0.2",
67
67
  "raw-body": "^2.5.1",
68
68
  "s3-upload-stream": "^1.0.7",
69
- "ws": "^8.11.0"
69
+ "ws": "^8.12.1"
70
70
  }
71
71
  }
@@ -1,6 +1,5 @@
1
1
  <!-- Javascript -->
2
2
  <script type="text/javascript">
3
-
4
3
  RED.nodes.registerType('jambonz_auth',{
5
4
  category: 'config',
6
5
  defaults: {
@@ -20,13 +19,16 @@
20
19
  {value: 'https://api.jambonz.us', label : 'jambonz.us', hasValue: false},
21
20
  {value: 'https://api.jambonz.xyz', label : 'jambonz.xyz', hasValue: false}],
22
21
  typeField: $('#node-config-input-urlType')
23
- });
22
+ });
23
+ },
24
+ oneditsave: function() {
25
+ const baseUrl = $('#node-config-input-url').val();
26
+ if (baseUrl.endsWith('/')) {
27
+ $('#node-config-input-url').val(baseUrl.slice(0, -1));
28
+ }
24
29
  }
25
30
  });
26
31
 
27
-
28
-
29
-
30
32
  RED.nodes.registerType('aws_auth',{
31
33
  category: 'config',
32
34
  credentials: {
@@ -43,12 +45,9 @@
43
45
  });
44
46
  </script>
45
47
 
46
-
47
48
  <!-- HTML -->
48
49
 
49
-
50
-
51
- <!-- aws auth -->
50
+ <!-- aws auth -->
52
51
  <script type="text/html" data-template-name="aws_auth">
53
52
  <div class="form-row">
54
53
  <label for="node-config-input-accessKey">AWS Access Key ID</label>
@@ -60,8 +59,6 @@
60
59
  </div>
61
60
  </script>
62
61
 
63
-
64
-
65
62
  <!-- jambonz auth -->
66
63
  <script type="text/html" data-template-name="jambonz_auth">
67
64
  <div class="form-row">
@@ -72,10 +69,9 @@
72
69
  <label for="node-config-input-url">Base URL</label>
73
70
  <input type="text" id="node-config-input-url" placeholder="http://localhost:3000">
74
71
  <input type="hidden" id="node-config-input-urlType">
75
-
76
72
  </div>
77
73
  <div class="form-row">
78
- <label for="node-config-input-accountSid">AccountSid</label>
74
+ <label for="node-config-input-accountSid">Account SID</label>
79
75
  <input type="text" id="node-config-input-accountSid">
80
76
  </div>
81
77
  <div class="form-row">
@@ -88,8 +84,6 @@
88
84
  </div>
89
85
  </script>
90
86
 
91
-
92
-
93
87
  <!-- Help Text -->
94
88
 
95
89
  <!-- AWS auth-->
@@ -100,7 +94,6 @@
100
94
  </script>
101
95
 
102
96
  <!-- jambonz auth -->
103
-
104
97
  <script type="text/x-red" data-help-name="jambonz_auth">
105
98
  <p>Creates a new jambonz server credential </p>
106
99
  <h3>Properties</h3>
package/src/nodes/auth.js CHANGED
@@ -1,11 +1,4 @@
1
- var {createHash} = require('crypto');
2
- const bent = require('bent');
3
- var mustache = require('mustache');
4
- mustache.escape = function(text) {return text;};
5
- var {v_resolve} = require('./libs')
6
-
7
1
  module.exports = function(RED) {
8
-
9
2
  function jambonz_auth(config) {
10
3
  RED.nodes.createNode(this, config);
11
4
  this.accountSid = config.accountSid;
@@ -18,6 +11,7 @@ module.exports = function(RED) {
18
11
  this.url = config.urlType;
19
12
  }
20
13
  }
14
+
21
15
  RED.nodes.registerType('jambonz_auth', jambonz_auth, {
22
16
  credentials: {
23
17
  url: {type: 'text'},
@@ -39,5 +33,4 @@ module.exports = function(RED) {
39
33
  secretAccessKey: {type: 'text'}
40
34
  }
41
35
  });
42
-
43
- }
36
+ }
@@ -1,6 +1,6 @@
1
1
  <!-- Javascript -->
2
2
  <script type="text/javascript">
3
- RED.nodes.registerType('conference',{
3
+ RED.nodes.registerType('conference',{
4
4
  category: 'jambonz',
5
5
  color: '#bbabaa',
6
6
  defaults: {
@@ -43,10 +43,8 @@ RED.nodes.registerType('conference',{
43
43
  });
44
44
  }
45
45
  });
46
-
47
46
  </script>
48
47
 
49
-
50
48
  <!-- HTML -->
51
49
  <script type="text/html" data-template-name="conference">
52
50
  <div class="form-row">
@@ -95,25 +93,24 @@ RED.nodes.registerType('conference',{
95
93
  <script type="text/html" data-help-name="conference">
96
94
  <p>places a caller in a conference.</p>
97
95
  <h3>Properties</h3>
98
- <p><code>Conference Name </code> - The name of the conference to join the caller to.</p>
99
- <p><code>Enter hook </code> - A webhook to retrieve something to play or say to the caller just before they are put into a conference after waiting for it to start</p>
100
- <p><code>Wait hook </code> - A webhook to retrieve commands to play or say while the caller is waiting for the conference to start</p>
101
- <p><code>Beep on entry</code> - if checked, play a beep tone to the conference when caller enters </p>
102
- <p><code>Start on entry</code> - if checked, start the conference only when this caller enters</p>
103
- <p><code>End on exit</code> - if checked, end the conference when this caller hangs up</p>
104
- <p><code>Max participants</code> - maximum number of participants that will be allowed in the conference</p>
105
-
106
- <h3>Outputs</h3>
96
+ <p><code>Conference Name </code> - The name of the conference to join the caller to.</p>
97
+ <p><code>Enter hook </code> - A webhook to retrieve something to play or say to the caller just before they are put into a conference after waiting for it to start</p>
98
+ <p><code>Wait hook </code> - A webhook to retrieve commands to play or say while the caller is waiting for the conference to start</p>
99
+ <p><code>Beep on entry</code> - if checked, play a beep tone to the conference when caller enters </p>
100
+ <p><code>Start on entry</code> - if checked, start the conference only when this caller enters</p>
101
+ <p><code>End on exit</code> - if checked, end the conference when this caller hangs up</p>
102
+ <p><code>Max participants</code> - maximum number of participants that will be allowed in the conference</p>
103
+ <h3>Outputs</h3>
107
104
  <dl class="message-properties">
108
- <dt>jambonz<span class="property-type">object</span></dt>
109
- <dd> <code>msg.jambonz</code> will contain any previous actions provided to the input with the new <code>conference</code> action appended </dd>
105
+ <dt>jambonz<span class="property-type">object</span></dt>
106
+ <dd> <code>msg.jambonz</code> will contain any previous actions provided to the input with the new <code>conference</code> action appended </dd>
110
107
  </dl>
111
108
 
112
109
  <h3>Details</h3>
113
110
  The conference verb places a call into a conference.
114
111
  <h3>References</h3>
115
112
  <ul>
116
- <li><a href="https://docs.jambonz.org/jambonz/#conference">Jambonz conference reference</a></li>
113
+ <li><a href="https://www.jambonz.org/docs/webhooks/conference/">Jambonz conference reference</a></li>
117
114
  </ul>
118
115
  </script>
119
116
 
@@ -1,7 +1,3 @@
1
- var {createHash} = require('crypto');
2
- const bent = require('bent');
3
- var mustache = require('mustache');
4
- mustache.escape = function(text) {return text;};
5
1
  var {appendVerb, v_resolve} = require('./libs')
6
2
 
7
3
  module.exports = function(RED) {
@@ -1,7 +1,3 @@
1
- var {createHash} = require('crypto');
2
- const bent = require('bent');
3
- var mustache = require('mustache');
4
- mustache.escape = function(text) {return text;};
5
1
  var {appendVerb} = require('./libs')
6
2
 
7
3
  module.exports = function(RED) {
@@ -1,6 +1,6 @@
1
1
  <!-- Javascript -->
2
2
  <script type="text/javascript">
3
- RED.nodes.registerType('create-call',{
3
+ RED.nodes.registerType('create-call',{
4
4
  category: 'jambonz',
5
5
  color: '#aebfb9',
6
6
  defaults: {
@@ -57,7 +57,6 @@
57
57
  prepareTtsControls(node);
58
58
  prepareSttControls(node);
59
59
 
60
-
61
60
  $('#node-input-from').typedInput({
62
61
  default: $('#node-input-fromType').val(),
63
62
  types: ['str','msg', 'flow', 'global', 'jsonata', 'env'],
@@ -125,7 +124,6 @@
125
124
  });
126
125
  </script>
127
126
 
128
-
129
127
  <!-- HTML -->
130
128
  <script type="text/html" data-template-name="create-call">
131
129
  <div class="form-row">
@@ -254,34 +252,30 @@
254
252
  </div>
255
253
  </fieldset>
256
254
  </div>
257
-
258
-
259
- </script>
255
+ </script>
260
256
 
261
257
  <!-- Help Text -->
262
-
263
258
  <script type="text/html" data-help-name="create-call">
264
259
  <p>Create an outbound call</p>
265
260
  <h3>Properties</h3>
266
- <p><code>Server</code> -jambonz server to connect to</p>
261
+ <p><code>Server</code> - Jambonz server to connect to</p>
267
262
  <p><code>From</code> - Calling party phone number</p>
268
263
  <p><code>To</code> - Called party phone number, or other identifier</p>
269
264
  <p><code>Call type</code> - Type of destination: phone number, registered user, sip endpoint, or microsoft teams</p>
270
265
  <p><code>Application</code> - Application to execute when call is answered</p>
271
-
266
+ <p><code>Webhooks</code> - Webhooks to execute when call is answered</p>
267
+
272
268
  <h3>Outputs</h3>
273
269
  <dl class="message-properties">
274
- <dt>statusCode<span class="property-type">int</span></dt>
275
- <dd> <code>msg.statusCode</code> will contain the response code from Jambomnz to the createCall request</dd>
276
- <dt>callSid<span class="property-type">string</span></dt>
277
- <dd> <code>msg.callSid</code> will contain the SID of the call that was created</dd>
270
+ <dt>statusCode<span class="property-type">int</span></dt>
271
+ <dd> <code>msg.statusCode</code> will contain the response code from Jambonz to the createCall request</dd>
272
+ <dt>callSid<span class="property-type">string</span></dt>
273
+ <dd> <code>msg.callSid</code> will contain the SID of the call that was created</dd>
274
+ <dt>callId<span class="property-type">string</span></dt>
275
+ <dd> <code>msg.callId</code> will contain the call id of the call that was created</dd>
278
276
  </dl>
279
277
 
280
278
  <h3>Details</h3>
281
279
  The create call command is used to generate a new outbound call.
282
280
  When the call is answered the specified application's call hook will be invoked.
283
- <h3>References</h3>
284
- <ul>
285
- <li><a href="https://docs.jambonz.org/rest/#create-a-call">Jambonz reference</a></li>
286
- </ul>
287
- </script>
281
+ </script>
@@ -1,12 +1,8 @@
1
- var {createHash} = require('crypto');
2
- var mustache = require('mustache');
3
- const { toNamespacedPath } = require('path');
4
- mustache.escape = function(text) {return text;};
5
1
  var {v_resolve, doCreateCall, } = require('./libs')
6
2
 
7
3
  module.exports = function(RED) {
8
- /** Create call */
9
- function create_call(config) {
4
+ /** Create call */
5
+ function create_call(config) {
10
6
  RED.nodes.createNode(this, config);
11
7
  var node = this;
12
8
  const server = RED.nodes.getNode(config.server);
@@ -35,23 +31,23 @@ module.exports = function(RED) {
35
31
 
36
32
  switch (config.mode) {
37
33
  case 'app':
38
- opts.application_sid = config.application
34
+ opts.application_sid = config.application;
39
35
  break
40
36
  case 'url':
41
37
  opts.call_hook = {
42
- url: config.call_hook_url,
38
+ url: v_resolve(config.call_hook_url, config.call_hook_urlType, this.context(), msg),
43
39
  method: config.call_hook_method
44
- }
40
+ };
45
41
  opts.call_status_hook = {
46
- url: config.call_status_url,
42
+ url: v_resolve(config.call_status_url, config.call_status_urlType, this.context(), msg),
47
43
  method: config.call_status_method
48
- }
49
- opts.speech_synthesis_vendor = config.vendor
50
- opts.speech_synthesis_language = config.lang
51
- opts.speech_synthesis_voice = config.voice
52
- opts.speech_recognizer_vendor = config.transcriptionvendor
53
- opts.speech_recognizer_language = config.recognizerlang
54
- break
44
+ };
45
+ opts.speech_synthesis_vendor = config.vendor;
46
+ opts.speech_synthesis_language = config.lang;
47
+ opts.speech_synthesis_voice = config.voice;
48
+ opts.speech_recognizer_vendor = config.transcriptionvendor;
49
+ opts.speech_recognizer_language = config.recognizerlang;
50
+ break;
55
51
  }
56
52
 
57
53
  if (config.timeout) {
@@ -77,19 +73,25 @@ module.exports = function(RED) {
77
73
  send(msg);
78
74
  return;
79
75
  }
80
- node.log(JSON.stringify(opts))
81
76
  try {
77
+ node.log(`sending create call ${JSON.stringify(opts)}`);
82
78
  const res = await doCreateCall(url, accountSid, apiToken, opts);
83
- msg.statusCode = 202;
79
+ msg.statusCode = 201;
84
80
  msg.callSid = res.sid;
81
+ msg.callId = res.callId;
85
82
  } catch (err) {
86
83
  if (err.statusCode) {
87
- console.log(JSON.stringify(err))
88
- node.error(`create-call failed with ${err.statusCode}`);
84
+ node.log(JSON.stringify(err));
85
+ try {
86
+ const responseBody = await err.json();
87
+ node.error(`create-call failed with ${err.statusCode}. Response ${JSON.stringify(responseBody)}`);
88
+ } catch (e) {
89
+ node.error(`create-call failed with ${err.statusCode}`);
90
+ }
89
91
  msg.statusCode = err.statusCode;
90
92
  }
91
93
  else {
92
- node.error(`Error sending create all ${JSON.stringify(err)}`);
94
+ node.error(`Error sending create call ${JSON.stringify(err)}`);
93
95
  if (done) done(err);
94
96
  else node.error(err, msg);
95
97
  send(msg);
@@ -1,6 +1,6 @@
1
1
  <!-- Javascript -->
2
2
  <script type="text/javascript">
3
- RED.nodes.registerType('create-sms',{
3
+ RED.nodes.registerType('create-sms',{
4
4
  category: 'jambonz',
5
5
  color: '#aebfb9',
6
6
  defaults: {
@@ -46,12 +46,9 @@
46
46
  });
47
47
  }
48
48
  });
49
-
50
49
  </script>
51
50
 
52
-
53
51
  <!-- HTML -->
54
-
55
52
  <script type="text/html" data-template-name="create-sms">
56
53
  <div class="form-row">
57
54
  <label for="node-input-name"><i class="icon-tag"></i> Name</label>
@@ -81,26 +78,26 @@
81
78
  <input type="text" id="node-input-provider">
82
79
  <input type="hidden" id="node-input-providerType">
83
80
  </div>
84
- </script>
81
+ </script>
85
82
 
86
-
87
83
  <!-- Help Text -->
88
-
89
84
  <script type="text/html" data-help-name="create-sms">
90
- <p>Send an SMS</p>
91
- <h3>Properties</h3>
92
- <p><code>Server</code> - jambonz server to connect to</p>
93
- <p><code>From</code> - Sending party phone number</p>
94
- <p><code>To</code> - Destination phone number</p>
85
+ <p>Create an outbound SMS message</p>
86
+ <h3>Properties</h3>
87
+ <p><code>Server</code> - Jambonz server to connect to</p>
88
+ <p><code>From</code> - Sending party phone number</p>
89
+ <p><code>To</code> - Destination phone number</p>
95
90
  <p><code>Text</code> - Text message</p>
96
91
 
97
-
92
+ <h3>Outputs</h3>
93
+ <dl class="message-properties">
94
+ <dt>statusCode<span class="property-type">int</span></dt>
95
+ <dd> <code>msg.statusCode</code> will contain the response code from Jambonz to the createMessage request</dd>
96
+ <dt>messageSid<span class="property-type">string</span></dt>
97
+ <dd> <code>msg.messageSid</code> will contain the SID of the message that was created</dd>
98
+ <dt>providerResponse<span class="property-type">string</span></dt>
99
+ <dd> <code>msg.providerResponse</code> will contain the provider response of the call that was created</dd>
100
+ </dl>
98
101
  <h3>Details</h3>
99
- The create message command is used to send an SMS message.
100
- <!--
101
- <h3>References</h3>
102
- <ul>
103
- <li><a href="https://docs.jambonz.org/rest/#create-a-call">Jambonz reference</a></li>
104
- </ul>
105
- -->
106
- </script>
102
+ The create message command is used to send an outbound SMS message.
103
+ </script>
@@ -1,10 +1,5 @@
1
- var {createHash} = require('crypto');
2
- const bent = require('bent');
3
- var mustache = require('mustache');
4
- mustache.escape = function(text) {return text;};
5
1
  var {v_resolve, doCreateMessage} = require('./libs')
6
2
 
7
-
8
3
  module.exports = function(RED) {
9
4
  /** Create sms */
10
5
  function create_sms(config) {
@@ -35,17 +30,21 @@ function create_sms(config) {
35
30
  text,
36
31
  provider
37
32
  };
38
-
39
33
  try {
40
34
  node.log(`sending create message ${JSON.stringify(opts)}`);
41
35
  const res = await doCreateMessage(url, accountSid, apiToken, opts);
42
- msg.statusCode = 202;
36
+ msg.statusCode = 201;
43
37
  msg.messageSid = res.sid;
44
38
  msg.providerResponse = res.providerResponse;
45
- node.log(`successfully launched call with messageSid ${msg.messageSid}`);
46
39
  } catch (err) {
47
40
  if (err.statusCode) {
48
- node.log(`create_message failed with ${err.statusCode}`);
41
+ node.log(JSON.stringify(err));
42
+ try {
43
+ const responseBody = await err.json();
44
+ node.error(`create_sms failed with ${err.statusCode}. Response ${JSON.stringify(responseBody)}`);
45
+ } catch (e) {
46
+ node.error(`create_sms failed with ${err.statusCode}`);
47
+ }
49
48
  msg.statusCode = err.statusCode;
50
49
  }
51
50
  else {
@@ -61,5 +60,4 @@ function create_sms(config) {
61
60
  });
62
61
  }
63
62
  RED.nodes.registerType('create-sms', create_sms);
64
-
65
63
  }
@@ -1,6 +1,6 @@
1
1
  <!-- Javascript -->
2
2
  <script type="text/javascript">
3
- RED.nodes.registerType('dequeue',{
3
+ RED.nodes.registerType('dequeue',{
4
4
  category: 'jambonz',
5
5
  color: '#bbabaa',
6
6
  defaults: {
@@ -42,7 +42,6 @@ RED.nodes.registerType('dequeue',{
42
42
  });
43
43
  </script>
44
44
 
45
-
46
45
  <!-- HTML -->
47
46
  <script type="text/html" data-template-name="dequeue">
48
47
  <div class="form-row">
@@ -73,9 +72,8 @@ RED.nodes.registerType('dequeue',{
73
72
  <input type="text" id="node-input-timeout" placeholder="seconds to wait if queue is empty">
74
73
  <input type="hidden" id="node-input-timeoutType">
75
74
  </div>
76
- </script>
75
+ </script>
77
76
 
78
-
79
77
  <!-- Help Text -->
80
78
  <script type="text/html" data-help-name="dequeue">
81
79
  <p>removes the a call from the front of a queue and bridges that call to the current caller.</p>
@@ -89,14 +87,14 @@ RED.nodes.registerType('dequeue',{
89
87
 
90
88
  <h3>Outputs</h3>
91
89
  <dl class="message-properties">
92
- <dt>jambonz<span class="property-type">object</span></dt>
93
- <dd> <code>msg.jambonz</code> will contain any previous actions provided to the input with the new <code>dequeue</code> action appended </dd>
90
+ <dt>jambonz<span class="property-type">object</span></dt>
91
+ <dd> <code>msg.jambonz</code> will contain any previous actions provided to the input with the new <code>dequeue</code> action appended </dd>
94
92
  </dl>
95
93
 
96
94
  <h3>Details</h3>
97
95
  The dequeue verb removes the a call from the front of a specified queue and bridges that call to the current caller.
98
96
  <h3>References</h3>
99
97
  <ul>
100
- <li><a href="https://docs.jambonz.org/jambonz/#dequeue">Jambonz dequeue reference</a></li>
98
+ <li><a href="https://www.jambonz.org/docs/webhooks/dequeue/">Jambonz dequeue reference</a></li>
101
99
  </ul>
102
- </script>
100
+ </script>
@@ -1,7 +1,3 @@
1
- var {createHash} = require('crypto');
2
- const bent = require('bent');
3
- var mustache = require('mustache');
4
- mustache.escape = function(text) {return text;};
5
1
  var {appendVerb, v_resolve} = require('./libs')
6
2
 
7
3
  module.exports = function(RED) {
@@ -1,6 +1,6 @@
1
1
  <!-- Javascript -->
2
2
  <script type="text/javascript">
3
- RED.nodes.registerType('dial',{
3
+ RED.nodes.registerType('dial',{
4
4
  category: 'jambonz',
5
5
  color: '#bbabaa',
6
6
  defaults: {
@@ -363,13 +363,9 @@ RED.nodes.registerType('dial',{
363
363
  console.log(`saved headers ${JSON.stringify(node.headers)}`);
364
364
  },
365
365
  });
366
-
367
-
368
366
  </script>
369
367
 
370
-
371
368
  <!-- HTML -->
372
-
373
369
  <script type="text/html" data-template-name="dial">
374
370
  <style>
375
371
  ol#node-input-target-container .red-ui-typedInput-container {
@@ -569,7 +565,7 @@ RED.nodes.registerType('dial',{
569
565
  </div>
570
566
  </fieldset>
571
567
  </div>
572
- </script>
568
+ </script>
573
569
 
574
570
  <!-- Help Text -->
575
571
  <script type="text/html" data-help-name="dial">
@@ -614,7 +610,6 @@ RED.nodes.registerType('dial',{
614
610
  <p><code>Send interim transcriptions</code> -
615
611
  <dd>if true interim transcriptions are sent.</p>
616
612
 
617
-
618
613
  <h3>Outputs</h3>
619
614
  <dl class="message-properties">
620
615
  <dt>jambonz<span class="property-type">object</span></dt>
@@ -624,6 +619,6 @@ RED.nodes.registerType('dial',{
624
619
  <h3>Details</h3>
625
620
  The dial verb is used to create a new call by dialing out to a number, a registered sip user, or sip endpoint
626
621
  <ul>
627
- <li><a href="https://docs.jambonz.org/jambonz/#dial">Jambonz dial reference</a></li>
622
+ <li><a href="https://www.jambonz.org/docs/webhooks/dial/">Jambonz dial reference</a></li>
628
623
  </ul>
629
624
  </script>
package/src/nodes/dial.js CHANGED
@@ -1,5 +1,3 @@
1
- var {createHash} = require('crypto');
2
- const bent = require('bent');
3
1
  var {appendVerb, v_resolve} = require('./libs')
4
2
 
5
3
  module.exports = function(RED) {
@@ -8,7 +6,6 @@ module.exports = function(RED) {
8
6
  var node = this;
9
7
 
10
8
  node.on('input', function(msg) {
11
-
12
9
  node.log(`dial config: ${JSON.stringify(config)}, msg.call: ${JSON.stringify(msg.call)}`);
13
10
  var target = config.targets.map((t) => {
14
11
  const obj = Object.assign({}, t);
@@ -56,7 +53,6 @@ module.exports = function(RED) {
56
53
  dtmfHook: v_resolve(config.dtmfhook, config.dtmfhookType, this.context(), msg)
57
54
  };
58
55
 
59
-
60
56
  // headers
61
57
  var headers = {};
62
58
  config.headers.forEach(function(h) {
@@ -129,7 +125,6 @@ module.exports = function(RED) {
129
125
  delete data.dtmfHook;
130
126
  }
131
127
 
132
-
133
128
  node.log(`dial verb: ${JSON.stringify(data)}`);
134
129
 
135
130
  appendVerb(msg, data);
@@ -1,6 +1,6 @@
1
1
  <!-- Javascript -->
2
2
  <script type="text/javascript">
3
- RED.nodes.registerType('dialogflow',{
3
+ RED.nodes.registerType('dialogflow',{
4
4
  category: 'jambonz',
5
5
  color: '#bbabaa',
6
6
  defaults: {
@@ -107,10 +107,8 @@ RED.nodes.registerType('dialogflow',{
107
107
  recLangElem.val(node.recognizerlang);
108
108
  }
109
109
  });
110
-
111
110
  </script>
112
111
 
113
-
114
112
  <!-- HTML -->
115
113
  <script type="text/html" data-template-name="dialogflow">
116
114
  <div class="form-row">
@@ -215,9 +213,7 @@ RED.nodes.registerType('dialogflow',{
215
213
  </script>
216
214
 
217
215
  <!-- Help Text -->
218
-
219
- <script type="text/html" data-help-name="audio in">
220
- <script type="text/html" data-help-name="dialogflow">
216
+ <script type="text/html" data-help-name="dialogflow">
221
217
  <p>Run a Google dialogflow bot on the call</p>
222
218
  <h3>Properties</h3>
223
219
  <p><code>Dialogflow Project ID</code> -
@@ -236,7 +232,6 @@ RED.nodes.registerType('dialogflow',{
236
232
  Webhook to call when an intent, transcription or other dialogflow event is received. Optional.</p>
237
233
  <p><code>Action Hook</code> -
238
234
  Webhook to call when the dialogflow bot interaction concludes. Optional.</p>
239
-
240
235
 
241
236
  <h3>Outputs</h3>
242
237
  <dl class="message-properties">
@@ -250,11 +245,6 @@ RED.nodes.registerType('dialogflow',{
250
245
 
251
246
  <h3>References</h3>
252
247
  <ul>
253
- <li><a href="https://docs.jambonz.org/jambonz/#dialogflow">Jambonz dialogflow reference</a></li>
248
+ <li><a href="https://www.jambonz.org/docs/webhooks/dialogflow/">Jambonz dialogflow reference</a></li>
254
249
  </ul>
255
- </script>
256
-
257
-
258
-
259
-
260
250
  </script>
@@ -1,7 +1,3 @@
1
- var {createHash} = require('crypto');
2
- const bent = require('bent');
3
- var mustache = require('mustache');
4
- mustache.escape = function(text) {return text;};
5
1
  var {appendVerb, v_resolve} = require('./libs')
6
2
 
7
3
  module.exports = function(RED) {
@@ -44,7 +40,6 @@ function dialogflow(config) {
44
40
  voice: config.voice
45
41
  };
46
42
  }
47
-
48
43
  appendVerb(msg, obj);
49
44
  node.send(msg);
50
45
  });