@jambonz/node-red-contrib-jambonz 2.2.72 → 2.3.0
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/examples/Authenticating sip devices.json +1 -0
- package/examples/Conference with LCC.json +1 -0
- package/{src/examples → examples}/Connecting to a dialogflow bot.json +0 -0
- package/examples/Create Call and Send DTMF.json +1 -0
- package/examples/Get Log Data.json +1 -0
- package/examples/Leave Queue.json +1 -0
- package/examples/SIP Responses.json +1 -0
- package/{src/examples → examples}/SIP trunking outbound call.json +0 -0
- package/examples/Simple IVR.json +1 -0
- package/examples/Simple Queue.json +1 -0
- package/examples/Using Redirect.json +1 -0
- package/examples/Voicemail using Listen into S3 bucket.json +130 -0
- package/examples/config.json +1 -0
- package/examples/gather.json +1 -0
- package/examples/lex.json +1 -0
- package/examples/messages.json +1 -0
- package/examples/rasa.json +1 -0
- package/examples/tag a call.json +1 -0
- package/package.json +52 -14
- package/resources/editor.js +414 -0
- package/src/data/recognizer.json +685 -1
- package/src/data/tts.json +2970 -1
- package/src/nodes/auth.html +108 -0
- package/src/nodes/auth.js +43 -0
- package/src/nodes/conference.html +121 -0
- package/src/nodes/conference.js +31 -0
- package/src/nodes/config.html +484 -0
- package/src/nodes/config.js +74 -0
- package/src/nodes/create_call.html +287 -0
- package/src/nodes/create_call.js +104 -0
- package/src/nodes/create_sms.html +106 -0
- package/src/nodes/create_sms.js +65 -0
- package/src/nodes/dequeue.html +102 -0
- package/src/nodes/dequeue.js +25 -0
- package/src/nodes/dial.html +619 -0
- package/src/nodes/dial.js +138 -0
- package/src/nodes/dialogflow.html +260 -0
- package/src/nodes/dialogflow.js +53 -0
- package/src/nodes/dtmf.html +74 -0
- package/src/nodes/dtmf.js +22 -0
- package/src/nodes/enqueue.html +90 -0
- package/src/nodes/enqueue.js +25 -0
- package/src/nodes/gather.html +322 -0
- package/src/nodes/gather.js +83 -0
- package/src/nodes/get_alerts.html +94 -0
- package/src/nodes/get_alerts.js +47 -0
- package/src/nodes/get_calls.html +59 -0
- package/src/nodes/get_calls.js +38 -0
- package/src/nodes/get_recent_calls.html +95 -0
- package/src/nodes/get_recent_calls.js +47 -0
- package/src/nodes/hangup.html +46 -0
- package/src/nodes/hangup.js +20 -0
- package/src/nodes/jambonz.html +96 -42
- package/src/nodes/lcc.html +256 -0
- package/src/nodes/lcc.js +102 -0
- package/src/nodes/leave.html +40 -0
- package/src/nodes/leave.js +21 -0
- package/src/nodes/lex.html +264 -0
- package/src/nodes/lex.js +75 -0
- package/src/nodes/libs.js +99 -0
- package/src/nodes/listen.html +341 -0
- package/src/nodes/listen.js +82 -0
- package/src/nodes/message.html +95 -0
- package/src/nodes/message.js +32 -0
- package/src/nodes/pause.html +62 -0
- package/src/nodes/pause.js +25 -0
- package/src/nodes/play.html +76 -0
- package/src/nodes/play.js +23 -0
- package/src/nodes/rasa.html +106 -0
- package/src/nodes/rasa.js +22 -0
- package/src/nodes/redirect.html +64 -0
- package/src/nodes/redirect.js +24 -0
- package/src/nodes/s3-upload.html +29 -14
- package/src/nodes/s3-upload.js +24 -9
- package/src/nodes/say.html +115 -0
- package/src/nodes/say.js +38 -0
- package/src/nodes/sip-decline.html +76 -0
- package/src/nodes/sip-decline.js +25 -0
- package/src/nodes/sip-refer.html +116 -0
- package/src/nodes/sip-refer.js +33 -0
- package/src/nodes/sip-request.html +96 -0
- package/src/nodes/sip-request.js +36 -0
- package/src/nodes/tag.html +60 -0
- package/src/nodes/tag.js +22 -0
- package/src/nodes/template.html +63 -0
- package/src/nodes/template.js +9 -0
- package/src/nodes/userauth.html +85 -0
- package/src/nodes/userauth.js +70 -0
- package/src/nodes/webhooks.js +0 -16
- package/src/utils/http-helpers.js +68 -0
- package/src/examples/Authenticating sip devices.json +0 -10
- package/src/nodes/http-helpers.js +0 -26
- package/src/nodes/jambonz.js +0 -1032
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
<!-- Javascript -->
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
<script type="text/javascript">
|
|
5
|
+
RED.nodes.registerType('get_recent_calls',{
|
|
6
|
+
category: 'jambonz',
|
|
7
|
+
color: '#aebfb9',
|
|
8
|
+
defaults: {
|
|
9
|
+
name: {value: ''},
|
|
10
|
+
server: {value: '', required: true, type: 'jambonz_auth'},
|
|
11
|
+
page:{value: 1},
|
|
12
|
+
pageType:{value: 'num'},
|
|
13
|
+
count:{value: 25},
|
|
14
|
+
countType:{value: 'num'},
|
|
15
|
+
days:{value: 7},
|
|
16
|
+
countType:{value: 'num'}
|
|
17
|
+
},
|
|
18
|
+
inputs:1,
|
|
19
|
+
outputs:1,
|
|
20
|
+
icon: "font-awesome/fa-cubes",
|
|
21
|
+
paletteLabel: "Get - Recent Calls",
|
|
22
|
+
label: function() { return this.name || 'Get Recent Calls';},
|
|
23
|
+
oneditprepare: () => {
|
|
24
|
+
var node = this;
|
|
25
|
+
$('#node-input-page').typedInput({
|
|
26
|
+
types: ['num', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
27
|
+
typeField: $('#node-input-pageType')
|
|
28
|
+
});
|
|
29
|
+
$('#node-input-count').typedInput({
|
|
30
|
+
types: ['num', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
31
|
+
typeField: $('#node-input-countType')
|
|
32
|
+
});
|
|
33
|
+
$('#node-input-days').typedInput({
|
|
34
|
+
types: ['num', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
35
|
+
typeField: $('#node-input-daysType')
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
<!-- HTML -->
|
|
45
|
+
|
|
46
|
+
<script type="text/html" data-template-name="get_recent_calls">
|
|
47
|
+
<div class="form-row">
|
|
48
|
+
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
|
|
49
|
+
<input type="text" id="node-input-name" placeholder="Name">
|
|
50
|
+
</div>
|
|
51
|
+
<div class="form-row">
|
|
52
|
+
<label for="node-input-server">Server</label>
|
|
53
|
+
<input type="text" id="node-input-server">
|
|
54
|
+
</div>
|
|
55
|
+
<div class="form-row">
|
|
56
|
+
<label for="node-input-page">Page</label>
|
|
57
|
+
<input type="text" id="node-input-page" >
|
|
58
|
+
<input type="hidden" id="node-input-pageType">
|
|
59
|
+
</div>
|
|
60
|
+
<div class="form-row">
|
|
61
|
+
<label for="node-input-count">Count</label>
|
|
62
|
+
<input type="text" id="node-input-count" >
|
|
63
|
+
<input type="hidden" id="node-input-countType">
|
|
64
|
+
</div>
|
|
65
|
+
<div class="form-row">
|
|
66
|
+
<label for="node-input-days">Days</label>
|
|
67
|
+
<input type="text" id="node-input-days" >
|
|
68
|
+
<input type="hidden" id="node-input-daysType">
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
</script>
|
|
73
|
+
|
|
74
|
+
<!-- Help Text -->
|
|
75
|
+
|
|
76
|
+
<script type="text/html" data-help-name="get_recent_calls">
|
|
77
|
+
<p>Get previous call records</p>
|
|
78
|
+
<h3>Properties</h3>
|
|
79
|
+
<p><code>XXXX</code> - TEXT</p>
|
|
80
|
+
|
|
81
|
+
<h3>Outputs</h3>
|
|
82
|
+
<dl class="message-properties">
|
|
83
|
+
<dt>payload<span class="property-type">object</span></dt>
|
|
84
|
+
<dd> <code>msg.payload</code> will contain ... </dd>
|
|
85
|
+
</dl>
|
|
86
|
+
|
|
87
|
+
<h3>Details</h3>
|
|
88
|
+
Call detail records are only kept in the system for 30 days. As there could be a large number of CDRs, this node allows you to query pages of data at a time.
|
|
89
|
+
|
|
90
|
+
<ul>
|
|
91
|
+
<li><a href="https://api.jambonz.org/#4e82bdc2-327b-40a5-9b52-f86357647b45">Jambonz Get Recent Calls reference</a></li>
|
|
92
|
+
</ul>
|
|
93
|
+
</script>
|
|
94
|
+
|
|
95
|
+
</script>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
var {createHash} = require('crypto');
|
|
2
|
+
const bent = require('bent');
|
|
3
|
+
var mustache = require('mustache');
|
|
4
|
+
mustache.escape = function(text) {return text;};
|
|
5
|
+
var {appendVerb, v_resolve, v_text_resolve, doLCC, doCreateCall, doCreateMessage} = require('./libs')
|
|
6
|
+
|
|
7
|
+
module.exports = function(RED) {
|
|
8
|
+
function get_recent_calls(config) {
|
|
9
|
+
RED.nodes.createNode(this, config);
|
|
10
|
+
var node = this;
|
|
11
|
+
const server = RED.nodes.getNode(config.server);
|
|
12
|
+
const {accountSid, apiToken} = server.credentials;
|
|
13
|
+
node.on('input', async(msg, send, done) => {
|
|
14
|
+
const data = {
|
|
15
|
+
page: config.page,
|
|
16
|
+
count : config.count,
|
|
17
|
+
days : config.days
|
|
18
|
+
}
|
|
19
|
+
const params = new URLSearchParams(data).toString()
|
|
20
|
+
const req = bent(`${server.url}/v1/Accounts/${accountSid}/RecentCalls?${params}`, 'GET', 'json', {
|
|
21
|
+
'Authorization': `Bearer ${apiToken}`
|
|
22
|
+
});
|
|
23
|
+
try {
|
|
24
|
+
const res = await req();
|
|
25
|
+
msg.payload = res.data
|
|
26
|
+
msg.total = res.total
|
|
27
|
+
msg.page_size = res.page_size
|
|
28
|
+
msg.page = res.page
|
|
29
|
+
} catch (err) {
|
|
30
|
+
if (err.statusCode) {
|
|
31
|
+
node.error(`create-call failed with ${err.statusCode}`);
|
|
32
|
+
msg.statusCode = err.statusCode;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
node.error(`Error getting alerts ${JSON.stringify(err)}`);
|
|
36
|
+
if (done) done(err);
|
|
37
|
+
else node.error(err, msg);
|
|
38
|
+
send(msg);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
send(msg);
|
|
43
|
+
if (done) done();
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
RED.nodes.registerType('get_recent_calls', get_recent_calls);
|
|
47
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<!-- Javascript -->
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
<script type="text/javascript">
|
|
5
|
+
|
|
6
|
+
RED.nodes.registerType('hangup',{
|
|
7
|
+
category: 'jambonz',
|
|
8
|
+
color: '#bbabaa',
|
|
9
|
+
defaults: {
|
|
10
|
+
name: {value: ''},
|
|
11
|
+
},
|
|
12
|
+
inputs:1,
|
|
13
|
+
outputs:1,
|
|
14
|
+
icon: "font-awesome/fa-cubes",
|
|
15
|
+
label: function() { return this.name || 'hangup';},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
<!-- HTML -->
|
|
23
|
+
<script type="text/html" data-template-name="hangup">
|
|
24
|
+
<div class="form-row">
|
|
25
|
+
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
|
|
26
|
+
<input type="text" id="node-input-name" placeholder="Name">
|
|
27
|
+
</div>
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<!-- Help Text -->
|
|
31
|
+
<script type="text/html" data-help-name="hangup">
|
|
32
|
+
<p>Hangup the call</p>
|
|
33
|
+
|
|
34
|
+
<h3>Outputs</h3>
|
|
35
|
+
<dl class="message-properties">
|
|
36
|
+
<dt>jambonz<span class="property-type">object</span></dt>
|
|
37
|
+
<dd> <code>msg.jambonz</code> will contain any previous actions provided to the input with the new <code>hangup</code> action appended </dd>
|
|
38
|
+
</dl>
|
|
39
|
+
|
|
40
|
+
<h3>Details</h3>
|
|
41
|
+
The hangup verb hangs up the current call.
|
|
42
|
+
<h3>References</h3>
|
|
43
|
+
<ul>
|
|
44
|
+
<li><a href="https://docs.jambonz.org/jambonz/#hangup">Jambonz hangup reference</a></li>
|
|
45
|
+
</ul>
|
|
46
|
+
</script>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var {createHash} = require('crypto');
|
|
2
|
+
const bent = require('bent');
|
|
3
|
+
var mustache = require('mustache');
|
|
4
|
+
mustache.escape = function(text) {return text;};
|
|
5
|
+
var {appendVerb} = require('./libs')
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
module.exports = function(RED) {
|
|
9
|
+
function hangup(config) {
|
|
10
|
+
RED.nodes.createNode(this, config);
|
|
11
|
+
var node = this;
|
|
12
|
+
node.on('input', function(msg) {
|
|
13
|
+
appendVerb(msg, {
|
|
14
|
+
verb: 'hangup'
|
|
15
|
+
});
|
|
16
|
+
node.send(msg);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
RED.nodes.registerType('hangup', hangup);
|
|
20
|
+
}
|
package/src/nodes/jambonz.html
CHANGED
|
@@ -264,11 +264,11 @@
|
|
|
264
264
|
label: function() { return this.name || 'user auth';},
|
|
265
265
|
oneditprepare: function() {
|
|
266
266
|
$('#node-input-password').typedInput({
|
|
267
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
267
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
268
268
|
typeField: $('#node-input-passwordType')
|
|
269
269
|
});
|
|
270
270
|
$('#node-input-ha1').typedInput({
|
|
271
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
271
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
272
272
|
typeField: $('#node-input-ha1Type')
|
|
273
273
|
});
|
|
274
274
|
}
|
|
@@ -289,7 +289,8 @@
|
|
|
289
289
|
enterHook: {},
|
|
290
290
|
enterHookType: {value: 'str'},
|
|
291
291
|
waitHook: {},
|
|
292
|
-
waitHookType: {value: 'str'}
|
|
292
|
+
waitHookType: {value: 'str'},
|
|
293
|
+
joinMuted : {value: false}
|
|
293
294
|
},
|
|
294
295
|
inputs:1,
|
|
295
296
|
outputs:1,
|
|
@@ -299,15 +300,15 @@
|
|
|
299
300
|
},
|
|
300
301
|
oneditprepare: function() {
|
|
301
302
|
$('#node-input-conference').typedInput({
|
|
302
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
303
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
303
304
|
typeField: $('#node-input-conferenceType')
|
|
304
305
|
});
|
|
305
306
|
$('#node-input-enterHook').typedInput({
|
|
306
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
307
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
307
308
|
typeField: $('#node-input-enterHookType')
|
|
308
309
|
});
|
|
309
310
|
$('#node-input-waitHook').typedInput({
|
|
310
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
311
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
311
312
|
typeField: $('#node-input-waitHookType')
|
|
312
313
|
});
|
|
313
314
|
$('#node-input-maxParticipants').typedInput({
|
|
@@ -340,15 +341,15 @@
|
|
|
340
341
|
},
|
|
341
342
|
oneditprepare: function() {
|
|
342
343
|
$('#node-input-queue').typedInput({
|
|
343
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
344
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
344
345
|
typeField: $('#node-input-queueType')
|
|
345
346
|
});
|
|
346
347
|
$('#node-input-actionHook').typedInput({
|
|
347
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
348
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
348
349
|
typeField: $('#node-input-actionHookType')
|
|
349
350
|
});
|
|
350
351
|
$('#node-input-confirmHook').typedInput({
|
|
351
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
352
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
352
353
|
typeField: $('#node-input-confirmHookType')
|
|
353
354
|
});
|
|
354
355
|
$('#node-input-timeout').typedInput({
|
|
@@ -363,7 +364,7 @@
|
|
|
363
364
|
color: '#bbabaa',
|
|
364
365
|
defaults: {
|
|
365
366
|
name: {value: ''},
|
|
366
|
-
targets:{value:[{type: 'phone', dest: '', user: '', pass: '', varType: 'str'}]},
|
|
367
|
+
targets:{value:[{type: 'phone', dest: '', user: '', pass: '', varType: 'str', trunk: ''}]},
|
|
367
368
|
headers: {value: []},
|
|
368
369
|
actionhook: {value: ''},
|
|
369
370
|
actionhookType: {value: 'str'},
|
|
@@ -419,47 +420,47 @@
|
|
|
419
420
|
oneditprepare: function() {
|
|
420
421
|
var node = this;
|
|
421
422
|
$('#node-input-callerid').typedInput({
|
|
422
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
423
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
423
424
|
typeField: $('#node-input-calleridType')
|
|
424
425
|
});
|
|
425
426
|
$('#node-input-actionhook').typedInput({
|
|
426
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
427
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
427
428
|
typeField: $('#node-input-actionhookType')
|
|
428
429
|
});
|
|
429
430
|
$('#node-input-confirmhook').typedInput({
|
|
430
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
431
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
431
432
|
typeField: $('#node-input-confirmhookType')
|
|
432
433
|
});
|
|
433
434
|
$('#node-input-dialmusic').typedInput({
|
|
434
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
435
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
435
436
|
typeField: $('#node-input-dialmusicType')
|
|
436
437
|
});
|
|
437
438
|
$('#node-input-dtmfcapture').typedInput({
|
|
438
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
439
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
439
440
|
typeField: $('#node-input-dtmfcaptureType')
|
|
440
441
|
});
|
|
441
442
|
$('#node-input-dtmfhook').typedInput({
|
|
442
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
443
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
443
444
|
typeField: $('#node-input-dtmfhookType')
|
|
444
445
|
});
|
|
445
446
|
$('#node-input-transcribeurl').typedInput({
|
|
446
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
447
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
447
448
|
typeField: $('#node-input-transcribeurlType')
|
|
448
449
|
});
|
|
449
450
|
$('#node-input-listenurl').typedInput({
|
|
450
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
451
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
451
452
|
typeField: $('#node-input-listenurlType')
|
|
452
453
|
});
|
|
453
454
|
$('#node-input-transcriptionhook').typedInput({
|
|
454
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
455
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
455
456
|
typeField: $('#node-input-transcriptionhookType')
|
|
456
457
|
});
|
|
457
458
|
$('#node-input-transcriptionhints').typedInput({
|
|
458
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
459
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
459
460
|
typeField: $('#node-input-transcriptionhintsType')
|
|
460
461
|
});
|
|
461
462
|
$('#node-input-recognizeraltlang').typedInput({
|
|
462
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
463
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
463
464
|
typeField: $('#node-recognizeraltlangType')
|
|
464
465
|
});
|
|
465
466
|
$('#node-input-diarizationmin').typedInput({
|
|
@@ -501,6 +502,7 @@
|
|
|
501
502
|
var row2 = $('<div/>',{style:"display:flex;margin-top:8px;"}).appendTo(fragment);
|
|
502
503
|
var row3 = $('<div/>',{style:"margin-top:8px;"}).appendTo(fragment);
|
|
503
504
|
var row4 = $('<div/>',{style:"display:flex;margin-top:8px;"}).appendTo(fragment);
|
|
505
|
+
var row5 = $('<div/>',{style:"margin-top:8px;"}).appendTo(fragment);
|
|
504
506
|
|
|
505
507
|
var selectField = $('<select/>',{class:"node-input-target-type",style:"width:110px; margin-right:10px;"})
|
|
506
508
|
.appendTo(row1);
|
|
@@ -530,6 +532,16 @@
|
|
|
530
532
|
placeholder: '(if required by remote endpoint)'
|
|
531
533
|
})
|
|
532
534
|
.appendTo(row3);
|
|
535
|
+
|
|
536
|
+
$('<label style="padding-top:8px; padding-right:20px">Trunk:</label>')
|
|
537
|
+
.appendTo(row5);
|
|
538
|
+
|
|
539
|
+
$('<input/>',{
|
|
540
|
+
class:"node-input-target-property-trunk",
|
|
541
|
+
type:"text",
|
|
542
|
+
placeholder: 'Specify the name of the trunk used for this outbound call'
|
|
543
|
+
})
|
|
544
|
+
.appendTo(row5);
|
|
533
545
|
|
|
534
546
|
selectField.on('change', function() {
|
|
535
547
|
var type = $(this).val();
|
|
@@ -558,6 +570,12 @@
|
|
|
558
570
|
row2.show();
|
|
559
571
|
row3.show();
|
|
560
572
|
}
|
|
573
|
+
|
|
574
|
+
if(type !== 'phone') {
|
|
575
|
+
row5.hide();
|
|
576
|
+
} else {
|
|
577
|
+
row5.show();
|
|
578
|
+
}
|
|
561
579
|
});
|
|
562
580
|
selectField.val(target.type);
|
|
563
581
|
propertyName.typedInput('value', target.dest);
|
|
@@ -566,10 +584,13 @@
|
|
|
566
584
|
var datafield = row1.find('.node-input-target-property-name');
|
|
567
585
|
var userfield = row2.find('.node-input-target-property-authuser');
|
|
568
586
|
var passfield = row3.find('.node-input-target-property-authpassword');
|
|
587
|
+
var trunkfield = row5.find('.node-input-target-property-trunk');
|
|
569
588
|
|
|
570
589
|
datafield.typedInput('type', target.varType);
|
|
571
590
|
|
|
572
591
|
switch (target.type) {
|
|
592
|
+
case 'phone':
|
|
593
|
+
trunkfield.val(target.trunk);
|
|
573
594
|
case 'sip':
|
|
574
595
|
userfield.val(target.user);
|
|
575
596
|
passfield.val(target.pass);
|
|
@@ -590,6 +611,7 @@
|
|
|
590
611
|
dest: '',
|
|
591
612
|
user: '',
|
|
592
613
|
pass: '',
|
|
614
|
+
trunk: '',
|
|
593
615
|
varType: 'str'
|
|
594
616
|
}
|
|
595
617
|
this.targets = [target];
|
|
@@ -659,6 +681,7 @@
|
|
|
659
681
|
var dest = target.find('.node-input-target-property-name').typedInput('value');
|
|
660
682
|
var user = target.find('.node-input-target-property-authuser').val();
|
|
661
683
|
var pass = target.find('.node-input-target-property-authpassword').val();
|
|
684
|
+
var trunk = target.find('.node-input-target-property-trunk').val();
|
|
662
685
|
if (!['phone', 'user', 'sip', 'teams'].includes(type) || 0 === dest.length) return;
|
|
663
686
|
|
|
664
687
|
var t = {
|
|
@@ -669,6 +692,9 @@
|
|
|
669
692
|
if ('sip' === type && user.length > 0 && pass.length > 0) {
|
|
670
693
|
Object.assign(t, {user, pass});
|
|
671
694
|
}
|
|
695
|
+
if ('phone' === type && trunk.length > 0) {
|
|
696
|
+
t.trunk = trunk;
|
|
697
|
+
}
|
|
672
698
|
node.targets.push(t);
|
|
673
699
|
});
|
|
674
700
|
console.log(`saved targets ${JSON.stringify(node.targets)}`);
|
|
@@ -817,15 +843,15 @@
|
|
|
817
843
|
},
|
|
818
844
|
oneditprepare: function() {
|
|
819
845
|
$('#node-input-queue').typedInput({
|
|
820
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
846
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
821
847
|
typeField: $('#node-input-queueType')
|
|
822
848
|
});
|
|
823
849
|
$('#node-input-actionHook').typedInput({
|
|
824
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
850
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
825
851
|
typeField: $('#node-input-actionHookType')
|
|
826
852
|
});
|
|
827
853
|
$('#node-input-waitHook').typedInput({
|
|
828
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
854
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
829
855
|
typeField: $('#node-input-waitHookType')
|
|
830
856
|
});
|
|
831
857
|
}
|
|
@@ -889,15 +915,15 @@
|
|
|
889
915
|
prepareSttControls(node);
|
|
890
916
|
|
|
891
917
|
$('#node-input-playurl').typedInput({
|
|
892
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
918
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
893
919
|
typeField: $('#node-input-playurlType')
|
|
894
920
|
});
|
|
895
921
|
$('#node-input-transcriptionhints').typedInput({
|
|
896
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
922
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
897
923
|
typeField: $('#node-input-transcriptionhintsType')
|
|
898
924
|
});
|
|
899
925
|
$('#node-input-recognizeraltlang').typedInput({
|
|
900
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
926
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
901
927
|
typeField: $('#node-recognizeraltlangType')
|
|
902
928
|
});
|
|
903
929
|
$('#node-input-naics').typedInput({
|
|
@@ -1014,19 +1040,19 @@
|
|
|
1014
1040
|
prepareTtsControls(node);
|
|
1015
1041
|
|
|
1016
1042
|
$('#node-input-bot').typedInput({
|
|
1017
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
1043
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
1018
1044
|
typeField: $('#node-input-botType')
|
|
1019
1045
|
});
|
|
1020
1046
|
$('#node-input-alias').typedInput({
|
|
1021
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
1047
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
1022
1048
|
typeField: $('#node-input-aliasType')
|
|
1023
1049
|
});
|
|
1024
1050
|
$('#node-input-locale').typedInput({
|
|
1025
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
1051
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
1026
1052
|
typeField: $('#node-input-localeType')
|
|
1027
1053
|
});
|
|
1028
1054
|
$('#node-input-intent').typedInput({
|
|
1029
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
1055
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
1030
1056
|
typeField: $('#node-input-intentType')
|
|
1031
1057
|
});
|
|
1032
1058
|
$('#node-input-inputTimeout').typedInput({
|
|
@@ -1122,19 +1148,19 @@
|
|
|
1122
1148
|
oneditprepare: function() {
|
|
1123
1149
|
var node = this;
|
|
1124
1150
|
$('#node-input-actionhook').typedInput({
|
|
1125
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
1151
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
1126
1152
|
typeField: $('#node-input-actionhookType')
|
|
1127
1153
|
});
|
|
1128
1154
|
$('#node-input-url').typedInput({
|
|
1129
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
1155
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
1130
1156
|
typeField: $('#node-input-urlType')
|
|
1131
1157
|
});
|
|
1132
1158
|
$('#node-input-authuser').typedInput({
|
|
1133
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
1159
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
1134
1160
|
typeField: $('#node-input-authuserType')
|
|
1135
1161
|
});
|
|
1136
1162
|
$('#node-input-authpassword').typedInput({
|
|
1137
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
1163
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
1138
1164
|
typeField: $('#node-input-authpasswordType')
|
|
1139
1165
|
});
|
|
1140
1166
|
$('#node-input-metadata').typedInput({
|
|
@@ -1142,15 +1168,15 @@
|
|
|
1142
1168
|
typeField: $('#node-input-metadataType')
|
|
1143
1169
|
});
|
|
1144
1170
|
$('#node-input-transcriptionhook').typedInput({
|
|
1145
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
1171
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
1146
1172
|
typeField: $('#node-input-transcriptionhookType')
|
|
1147
1173
|
});
|
|
1148
1174
|
$('#node-input-transcriptionhints').typedInput({
|
|
1149
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
1175
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
1150
1176
|
typeField: $('#node-input-transcriptionhintsType')
|
|
1151
1177
|
});
|
|
1152
1178
|
$('#node-input-recognizeraltlang').typedInput({
|
|
1153
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
1179
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
1154
1180
|
typeField: $('#node-recognizeraltlangType')
|
|
1155
1181
|
});
|
|
1156
1182
|
$('#node-input-diarizationmin').typedInput({
|
|
@@ -1277,7 +1303,7 @@
|
|
|
1277
1303
|
},
|
|
1278
1304
|
oneditprepare: function() {
|
|
1279
1305
|
$('#node-input-hook').typedInput({
|
|
1280
|
-
types: ['str', 'msg', 'flow', 'global'],
|
|
1306
|
+
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
|
|
1281
1307
|
typeField: $('#node-input-hookType')
|
|
1282
1308
|
});
|
|
1283
1309
|
}
|
|
@@ -1407,6 +1433,11 @@
|
|
|
1407
1433
|
return action !== 'redirect' || v.length > 0;
|
|
1408
1434
|
}},
|
|
1409
1435
|
callHookType: {value: 'str'},
|
|
1436
|
+
waitHook: {value: '', validate: function(v) {
|
|
1437
|
+
const action = $('#node-input-action').val();
|
|
1438
|
+
return action !== 'hold_conf' || v.length > 0;
|
|
1439
|
+
}},
|
|
1440
|
+
waitHookType: {value: 'str'},
|
|
1410
1441
|
},
|
|
1411
1442
|
inputs:1,
|
|
1412
1443
|
outputs:1,
|
|
@@ -1422,8 +1453,9 @@
|
|
|
1422
1453
|
var voiceElem = $('#node-input-voice');
|
|
1423
1454
|
var sayDiv = $('#say-options');
|
|
1424
1455
|
var redirectDiv = $('#redirect-options');
|
|
1425
|
-
|
|
1456
|
+
var waitHookDiv = $('#wait-options');
|
|
1426
1457
|
sayDiv.hide();
|
|
1458
|
+
waitHookDiv.hide();
|
|
1427
1459
|
|
|
1428
1460
|
$('#node-input-callSid').typedInput({
|
|
1429
1461
|
default: $('#node-input-callSidType').val(),
|
|
@@ -1435,6 +1467,11 @@
|
|
|
1435
1467
|
types: ['str','msg', 'flow', 'global'],
|
|
1436
1468
|
typeField: $('#node-input-callHookType')
|
|
1437
1469
|
});
|
|
1470
|
+
$('#node-input-waitHook').typedInput({
|
|
1471
|
+
default: $('#node-input-waitHookType').val(),
|
|
1472
|
+
types: ['str','msg', 'flow', 'global'],
|
|
1473
|
+
typeField: $('#node-input-waitHookType')
|
|
1474
|
+
});
|
|
1438
1475
|
|
|
1439
1476
|
var onActionChanged = function () {
|
|
1440
1477
|
node.action = actionElem.find(':selected').val();
|
|
@@ -1442,6 +1479,8 @@
|
|
|
1442
1479
|
else sayDiv.hide();
|
|
1443
1480
|
if ('redirect' === node.action) redirectDiv.show();
|
|
1444
1481
|
else redirectDiv.hide();
|
|
1482
|
+
if ('hold_conf' === node.action) waitHookDiv.show();
|
|
1483
|
+
else waitHookDiv.hide();
|
|
1445
1484
|
}
|
|
1446
1485
|
|
|
1447
1486
|
var onVendorChanged = function() {
|
|
@@ -1727,13 +1766,17 @@ The output of this node is to set <code>msg.authResponse</code> accordingly, and
|
|
|
1727
1766
|
<input type="checkbox" id="node-input-beep">
|
|
1728
1767
|
</div>
|
|
1729
1768
|
<div class="form-row">
|
|
1730
|
-
<label for="node-input-
|
|
1731
|
-
<input type="checkbox" id="node-input-
|
|
1769
|
+
<label for="node-input-startConferenceOnEnter">Start on entry</label>
|
|
1770
|
+
<input type="checkbox" id="node-input-startConferenceOnEnter">
|
|
1732
1771
|
</div>
|
|
1733
1772
|
<div class="form-row">
|
|
1734
1773
|
<label for="node-input-endConferenceOnExit">End on exit</label>
|
|
1735
1774
|
<input type="checkbox" id="node-input-endConferenceOnExit">
|
|
1736
1775
|
</div>
|
|
1776
|
+
<div class="form-row">
|
|
1777
|
+
<label for="node-input-joinMuted">Join Muted</label>
|
|
1778
|
+
<input type="checkbox" id="node-input-joinMuted">
|
|
1779
|
+
</div>
|
|
1737
1780
|
<div class="form-row">
|
|
1738
1781
|
<label for="node-input-maxParticipants">Max participants</label>
|
|
1739
1782
|
<input type="text" id="node-input-maxParticipants">
|
|
@@ -3294,6 +3337,10 @@ The sip:decline verb rejects an incoming call.
|
|
|
3294
3337
|
<option value="hangup">hangup call</option>
|
|
3295
3338
|
<option value="mute">mute caller</option>
|
|
3296
3339
|
<option value="unmute">unmute caller</option>
|
|
3340
|
+
<option value="mute_conf">mute conference participants</option>
|
|
3341
|
+
<option value="unmute_conf">unmute conference participants</option>
|
|
3342
|
+
<option value="hold_conf">hold conference participant</option>
|
|
3343
|
+
<option value="unhold_conf">unhold conference participant</option>
|
|
3297
3344
|
<option value="pause">pause listen audio feed</option>
|
|
3298
3345
|
<option value="resume">resume listen audio feed</option>
|
|
3299
3346
|
<option value="redirect">redirect call</option>
|
|
@@ -3336,6 +3383,13 @@ The sip:decline verb rejects an incoming call.
|
|
|
3336
3383
|
<input type="hidden" id="node-input-callHookType">
|
|
3337
3384
|
</div>
|
|
3338
3385
|
</div>
|
|
3386
|
+
<div id="wait-options">
|
|
3387
|
+
<div class="form-row">
|
|
3388
|
+
<label for="node-input-waitHook">Wait webhook</label>
|
|
3389
|
+
<input type="text" id="node-input-waitHook" placeholder="/path">
|
|
3390
|
+
<input type="hidden" id="node-input-waitHookType">
|
|
3391
|
+
</div>
|
|
3392
|
+
</div>
|
|
3339
3393
|
</script>
|
|
3340
3394
|
|
|
3341
3395
|
<script type="text/html" data-help-name="lcc">
|