mirror of
https://github.com/jambonz/jambonz-node.git
synced 2025-12-19 05:17:49 +00:00
add support for rasa verb, and support for providing multiple webhook secrets
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"sip_decline": {
|
||||
"sip:decline": {
|
||||
"properties": {
|
||||
"status": "number",
|
||||
"reason": "string",
|
||||
@@ -124,6 +124,10 @@
|
||||
"credentials": "object|string",
|
||||
"project": "string",
|
||||
"environment": "string",
|
||||
"region": {
|
||||
"type": "string",
|
||||
"enum": ["europe-west1", "europe-west2", "australia-southeast1", "asia-northeast1"]
|
||||
},
|
||||
"lang": "string",
|
||||
"actionHook": "object|string",
|
||||
"eventHook": "object|string",
|
||||
@@ -166,17 +170,14 @@
|
||||
"passDtmf": "boolean",
|
||||
"actionHook": "object|string",
|
||||
"eventHook": "object|string",
|
||||
"prompt": {
|
||||
"type": "string",
|
||||
"enum": ["lex", "tts"]
|
||||
},
|
||||
"noInputTimeout": "number",
|
||||
"tts": "#synthesizer"
|
||||
},
|
||||
"required": [
|
||||
"botId",
|
||||
"botAlias",
|
||||
"region"
|
||||
"region",
|
||||
"credentials"
|
||||
]
|
||||
},
|
||||
"listen": {
|
||||
@@ -205,7 +206,9 @@
|
||||
},
|
||||
"message": {
|
||||
"properties": {
|
||||
"provider": "string",
|
||||
"carrier": "string",
|
||||
"account_sid": "string",
|
||||
"message_sid": "string",
|
||||
"to": "string",
|
||||
"from": "string",
|
||||
"text": "string",
|
||||
@@ -225,6 +228,19 @@
|
||||
"length"
|
||||
]
|
||||
},
|
||||
"rasa": {
|
||||
"properties": {
|
||||
"url": "string",
|
||||
"recognizer": "#recognizer",
|
||||
"tts": "#synthesizer",
|
||||
"prompt": "string",
|
||||
"actionHook": "object|string",
|
||||
"eventHook": "object|string"
|
||||
},
|
||||
"required": [
|
||||
"url"
|
||||
]
|
||||
},
|
||||
"redirect": {
|
||||
"properties": {
|
||||
"actionHook": "object|string"
|
||||
@@ -233,7 +249,7 @@
|
||||
"actionHook"
|
||||
]
|
||||
},
|
||||
"rest_dial": {
|
||||
"rest:dial": {
|
||||
"properties": {
|
||||
"account_sid": "string",
|
||||
"application_sid": "string",
|
||||
|
||||
@@ -99,10 +99,15 @@ class WebhookResponse {
|
||||
if (!details.signatures.length) {
|
||||
throw new Error('no signatures found');
|
||||
}
|
||||
const expectedSignature = computeSignature(req.body, details.timestamp, secret);
|
||||
const signatureFound = details.signatures.filter(
|
||||
secureCompare.bind(null, expectedSignature)
|
||||
).length > 0;
|
||||
const secrets = Array.isArray(secret) ? secret : [secret];
|
||||
let signatureFound = false;
|
||||
for (const secret of secrets) {
|
||||
const expectedSignature = computeSignature(req.body, details.timestamp, secret);
|
||||
signatureFound = details.signatures.filter(
|
||||
secureCompare.bind(null, expectedSignature)
|
||||
).length > 0;
|
||||
if (signatureFound) break;
|
||||
}
|
||||
if (!signatureFound) {
|
||||
throw new Error('No matching signatures found');
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@jambonz/node-client",
|
||||
"version": "0.2.4",
|
||||
"version": "0.2.5",
|
||||
"description": "",
|
||||
"main": "lib/index.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user