@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.
- package/package.json +5 -5
- package/resources/editor.js +5 -3
- package/resources/icons/mustache.svg +1 -0
- package/src/nodes/{template.js → _template.js} +1 -1
- package/src/nodes/conference.html +11 -4
- package/src/nodes/conference.js +5 -7
- package/src/nodes/config.html +17 -17
- package/src/nodes/config.js +18 -18
- package/src/nodes/create_call.html +11 -4
- package/src/nodes/create_call.js +5 -5
- package/src/nodes/create_sms.html +11 -4
- package/src/nodes/create_sms.js +5 -5
- package/src/nodes/dequeue.html +11 -5
- package/src/nodes/dequeue.js +6 -6
- package/src/nodes/dial.html +25 -20
- package/src/nodes/dial.js +18 -19
- package/src/nodes/dialogflow.html +16 -10
- package/src/nodes/dialogflow.js +10 -11
- package/src/nodes/dtmf.html +8 -2
- package/src/nodes/dtmf.js +3 -3
- package/src/nodes/enqueue.html +10 -4
- package/src/nodes/enqueue.js +5 -7
- package/src/nodes/gather.html +17 -5
- package/src/nodes/gather.js +8 -8
- package/src/nodes/get_alerts.html +9 -3
- package/src/nodes/get_alerts.js +4 -4
- package/src/nodes/get_calls.html +10 -4
- package/src/nodes/get_calls.js +5 -10
- package/src/nodes/get_recent_calls.html +12 -5
- package/src/nodes/get_recent_calls.js +6 -6
- package/src/nodes/lcc.html +12 -5
- package/src/nodes/lcc.js +6 -6
- package/src/nodes/lex.html +25 -10
- package/src/nodes/lex.js +10 -11
- package/src/nodes/libs.js +36 -0
- package/src/nodes/listen.html +14 -7
- package/src/nodes/listen.js +12 -12
- package/src/nodes/message.html +10 -4
- package/src/nodes/message.js +5 -10
- package/src/nodes/pause.html +8 -1
- package/src/nodes/pause.js +2 -3
- package/src/nodes/play.html +9 -1
- package/src/nodes/play.js +2 -2
- package/src/nodes/rasa.html +10 -4
- package/src/nodes/rasa.js +5 -5
- package/src/nodes/redirect.html +7 -1
- package/src/nodes/redirect.js +2 -2
- package/src/nodes/say.html +1 -1
- package/src/nodes/say.js +2 -2
- package/src/nodes/sip-decline.html +8 -2
- package/src/nodes/sip-decline.js +3 -3
- package/src/nodes/sip-refer.html +11 -5
- package/src/nodes/sip-refer.js +6 -6
- package/src/nodes/sip-request.html +9 -3
- package/src/nodes/sip-request.js +4 -4
- package/src/nodes/tag.html +7 -1
- package/src/nodes/tag.js +2 -2
- package/src/nodes/userauth.html +11 -5
- package/src/nodes/userauth.js +6 -6
- /package/src/nodes/{template.html → _template.html} +0 -0
package/src/nodes/sip-refer.html
CHANGED
|
@@ -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
|
}
|
package/src/nodes/sip-refer.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 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
|
}
|
package/src/nodes/sip-request.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
|
/** 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
|
});
|
package/src/nodes/tag.html
CHANGED
|
@@ -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,
|
|
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 =
|
|
8
|
+
var data = new_resolve(RED, config.data, config.dataType, node, msg);
|
|
9
9
|
appendVerb(msg, {
|
|
10
10
|
verb: 'tag',
|
|
11
11
|
data
|
package/src/nodes/userauth.html
CHANGED
|
@@ -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
|
}
|
package/src/nodes/userauth.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var {createHash} = require('crypto');
|
|
2
|
-
var {
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
60
|
-
const callStatusHook =
|
|
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
|