Compare commits

..

1 Commits

Author SHA1 Message Date
Quan HL
e557b9ac3d add support for dual streams in rest:dial 2023-09-20 14:16:45 +07:00
6 changed files with 12 additions and 160 deletions

View File

@@ -1,4 +1,4 @@
# verb-specifications
# verb-specificiations
Jambonz Verb Specification Utilities
#### Running the test suite

View File

@@ -58,8 +58,7 @@ function validateVerb(name, data, logger) {
const dSpec = specData.properties[dKey];
debug(`Task:validate validating property ${dKey} with value ${JSON.stringify(dVal)}`);
if (typeof dVal === 'undefined') continue;
else if (typeof dSpec === 'string' && dSpec === 'array') {
if (typeof dSpec === 'string' && dSpec === 'array') {
if (!Array.isArray(dVal)) throw new Error(`${name}: property ${dKey} is not an array`);
}
else if (typeof dSpec === 'string' && dSpec.includes('|')) {

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@jambonz/verb-specifications",
"version": "0.0.47",
"version": "0.0.34",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@jambonz/verb-specifications",
"version": "0.0.47",
"version": "0.0.34",
"license": "MIT",
"dependencies": {
"debug": "^4.3.4",

View File

@@ -1,6 +1,6 @@
{
"name": "@jambonz/verb-specifications",
"version": "0.0.47",
"version": "0.0.34",
"description": "Jambonz Verb Specification Utilities",
"main": "index.js",
"scripts": {

View File

@@ -46,9 +46,7 @@
"amd": "#amd",
"notifyEvents": "boolean",
"reset": "string|array",
"onHoldMusic": "string",
"actionHookDelayAction": "#actionHookDelayAction",
"sipRequestWithinDialogHook": "object|string"
"onHoldMusic": "string"
},
"required": []
},
@@ -176,8 +174,7 @@
"timeout": "number",
"recognizer": "#recognizer",
"play": "#play",
"say": "#say",
"actionHookDelayAction": "#actionHookDelayAction"
"say": "#say"
},
"required": [
]
@@ -411,8 +408,7 @@
"headers": "object",
"timeout": "number",
"amd": "#amd",
"dual_streams": "boolean",
"sipRequestWithinDialogHook": "string"
"dual_streams" : "boolean"
},
"required": [
"call_hook",
@@ -460,8 +456,7 @@
"vmail": "boolean",
"tenant": "string",
"trunk": "string",
"overrideTo": "string",
"proxy": "string"
"overrideTo": "string"
},
"required": [
"type"
@@ -490,11 +485,11 @@
"vendor": "string",
"label": "string",
"language": "string",
"voice": "string|object",
"voice": "string",
"fallbackVendor": "string",
"fallbackLabel": "string",
"fallbackLanguage": "string",
"fallbackVoice": "string|object",
"fallbackVoice": "string",
"engine": {
"type": "string",
"enum": ["standard", "neural"]
@@ -586,9 +581,6 @@
"nvidiaOptions": "#nvidiaOptions",
"sonioxOptions": "#sonioxOptions",
"cobaltOptions": "#cobaltOptions",
"awsOptions": "#awsOptions",
"azureOptions": "#azureOptions",
"assemblyAiOptions": "#assemblyAiOptions",
"customOptions": "#customOptions"
},
"required": [
@@ -604,50 +596,6 @@
"required": [
]
},
"awsOptions": {
"properties": {
"accessKey": "string",
"secretKey": "string",
"securityToken": "string",
"vocabularyName": "string",
"vocabularyFilterName": "string",
"vocabularyFilterMethod": {
"type": "string",
"enum": [
"remove",
"mask",
"tag"
]
},
"languageModelName": "string",
"piiEntityTypes": {
"type": "string",
"enum": [
"ADDRESS",
"ALL",
"BANK_ACCOUNT_NUMBER",
"BANK_ROUTING",
"CREDIT_DEBIT_CVV",
"CREDIT_DEBIT_EXPIRY",
"CREDIT_DEBIT_NUMBER",
"EMAIL",
"NAME",
"PHONE",
"PIN",
"SSN"
]
}
},
"required": [
]
},
"azureOptions": {
"properties": {
"speechSegmentationSilenceTimeoutMs": "number"
},
"required": [
]
},
"cobaltOptions": {
"properties": {
"serverUri": "string",
@@ -698,7 +646,6 @@
"customModel": "string",
"version": "string",
"punctuate": "boolean",
"smartFormatting": "boolean",
"profanityFilter": "boolean",
"redact": {
"type": "string",
@@ -719,8 +666,6 @@
"replace": "array",
"keywords": "array",
"endpointing": "boolean | number",
"utteranceEndMs": "number",
"shortUtterance": "boolean",
"vadTurnoff": "number",
"tag": "string"
}
@@ -795,11 +740,6 @@
"required": [
]
},
"assemblyAiOptions": {
"properties": {
"apiKey": "string"
}
},
"resource": {
"properties": {
"externalReference": "#resourceReference",
@@ -900,14 +840,5 @@
"toneTimeoutMs": "number",
"greetingCompletionTimeoutMs": "number"
}
},
"actionHookDelayAction" : {
"properties": {
"enabled": "boolean",
"noResponseTimeout": "number",
"noResponseGiveUpTimeout": "number",
"retries": "number",
"actions": "array"
}
}
}

View File

@@ -37,41 +37,7 @@ test("validate correct verbs", async (t) => {
"input" : ["speech"],
"actionHook": "/userInput"
},
"onHoldMusic": "http://server.com/hold",
"actionHookDelayAction": {
"enabled": true,
"noResponseTimeout": 5,
"noResponseGiveUpTimeout": 10,
"retries": 3,
"actions": [
{
"verb": "say",
"text": "To speak to Sales press 1 or say Sales. To speak to customer support press 2 or say Support",
"synthesizer": {
"vendor": "google",
"language": "en-US"
}
},
{
"verb": "play",
"url": "https://example.com/example.mp3",
"timeoutSecs": 10,
"seekOffset": 8000,
"actionHook": "/play/action"
}
]
}
},
{
"verb": "config",
"recognizer": {
"vendor": "google",
"language": "de-DE",
"label": "label1",
"assemblyAiOptions": {
"apiKey": "apikey"
}
}
"onHoldMusic": "http://server.com/hold"
},
{
"verb": "config",
@@ -84,10 +50,6 @@ test("validate correct verbs", async (t) => {
}
}
},
{
"verb": "config",
"sipRequestWithinDialogHook": "https://jambonz.or/sipIndialogActionHook"
},
{
"verb": "config",
"record": {
@@ -189,24 +151,6 @@ test("validate correct verbs", async (t) => {
"fallbackLabel": "label1",
"fallbackVoice": "voice"
}
},
"say": {
"text": "To speak to Sales press 1 or say Sales. To speak to customer support press 2 or say Support",
"synthesizer": {
"vendor": "google",
"language": "en-US",
"voice": {
"reportedUsage":"REALTIME",
"model":"path/to/model",
},
"fallbackVendor": "google",
"fallbackLanguage": "en-US",
"fallbackLabel": "label1",
"fallbackVoice": {
"reportedUsage":"REALTIME",
"model":"path/to/model",
}
}
}
},
{
@@ -230,28 +174,6 @@ test("validate correct verbs", async (t) => {
"endpointing": true
}
},
"actionHookDelayAction": {
"noResponseTimeout": 5,
"noResponseGiveUpTimeout": 10,
"retries": 3,
"actions": [
{
"verb": "say",
"text": "To speak to Sales press 1 or say Sales. To speak to customer support press 2 or say Support",
"synthesizer": {
"vendor": "google",
"language": "en-US"
}
},
{
"verb": "play",
"url": "https://example.com/example.mp3",
"timeoutSecs": 10,
"seekOffset": 8000,
"actionHook": "/play/action"
}
]
}
},
{
"verb": "hangup",