mirror of
https://github.com/jambonz/verb-specifications.git
synced 2026-03-24 04:27:54 +00:00
Compare commits
81 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b639a9591 | ||
|
|
6242514b6e | ||
|
|
6f5884f7be | ||
|
|
d5bc910907 | ||
|
|
2f6696bbf8 | ||
|
|
2c19b34922 | ||
|
|
c5d977da50 | ||
|
|
a6f64710c1 | ||
|
|
3463528127 | ||
|
|
030eb5f847 | ||
|
|
f8d07d340a | ||
|
|
8a96b05f23 | ||
|
|
a6a942c1c6 | ||
|
|
85fa4714fb | ||
|
|
d047892fff | ||
|
|
11bb83f703 | ||
|
|
c5a263ee68 | ||
|
|
47f8a593f5 | ||
|
|
c9d2c9aa4d | ||
|
|
1ce577c8c9 | ||
|
|
dc0abfad02 | ||
|
|
1e9285b9d9 | ||
|
|
f3f048d94f | ||
|
|
a737d8bcbb | ||
|
|
c3d69e614e | ||
|
|
9277e053a6 | ||
|
|
954f9479c9 | ||
|
|
58385e791b | ||
|
|
85aaab5856 | ||
|
|
d70324485b | ||
|
|
2cf2c15586 | ||
|
|
f6ad050a32 | ||
|
|
ba02161f74 | ||
|
|
fabf9255ea | ||
|
|
3f1e7cbd3b | ||
|
|
ff6bea3168 | ||
|
|
4ea66245d4 | ||
|
|
faa99cdce3 | ||
|
|
d017e739b1 | ||
|
|
764383cf43 | ||
|
|
3f19ce4a24 | ||
|
|
1e6b24181c | ||
|
|
63aa94a9ec | ||
|
|
d4614c2ad1 | ||
|
|
7da6165b93 | ||
|
|
ad76081fa7 | ||
|
|
ce94e943d2 | ||
|
|
436fb557dc | ||
|
|
203b8600a8 | ||
|
|
b877ca52d0 | ||
|
|
cdb671d25d | ||
|
|
6ae0aff8b1 | ||
|
|
9a2a22dd88 | ||
|
|
369583d536 | ||
|
|
77d203ca80 | ||
|
|
9cb550f49e | ||
|
|
de88976293 | ||
|
|
60efb4b9af | ||
|
|
49ac048477 | ||
|
|
e653a62c49 | ||
|
|
f41aae81c6 | ||
|
|
5707f7d4d4 | ||
|
|
f75871dc46 | ||
|
|
98fa56bd3d | ||
|
|
e1b9abef9e | ||
|
|
22b118534b | ||
|
|
733a4760fe | ||
|
|
3deb8759db | ||
|
|
79cdfc73d4 | ||
|
|
9b7358d6b4 | ||
|
|
4bb25941bf | ||
|
|
42ff6170b6 | ||
|
|
873d8dc0c8 | ||
|
|
992a5fe897 | ||
|
|
6803a3e49d | ||
|
|
2d2145917e | ||
|
|
4fa8d46fd8 | ||
|
|
9690e14f64 | ||
|
|
49752d16ea | ||
|
|
9e141cba6a | ||
|
|
82e2bc5239 |
@@ -1,4 +1,4 @@
|
||||
# verb-specificiations
|
||||
# verb-specifications
|
||||
Jambonz Verb Specification Utilities
|
||||
|
||||
#### Running the test suite
|
||||
|
||||
@@ -58,7 +58,8 @@ function validateVerb(name, data, logger) {
|
||||
const dSpec = specData.properties[dKey];
|
||||
debug(`Task:validate validating property ${dKey} with value ${JSON.stringify(dVal)}`);
|
||||
|
||||
if (typeof dSpec === 'string' && dSpec === 'array') {
|
||||
if (typeof dVal === 'undefined') continue;
|
||||
else 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
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@jambonz/verb-specifications",
|
||||
"version": "0.0.30",
|
||||
"version": "0.0.70",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@jambonz/verb-specifications",
|
||||
"version": "0.0.30",
|
||||
"version": "0.0.70",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "^4.3.4",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@jambonz/verb-specifications",
|
||||
"version": "0.0.30",
|
||||
"version": "0.0.70",
|
||||
"description": "Jambonz Verb Specification Utilities",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
186
specs.json
186
specs.json
@@ -1,4 +1,11 @@
|
||||
{
|
||||
"answer": {
|
||||
"properties": {
|
||||
"id": "string"
|
||||
},
|
||||
"required": [
|
||||
]
|
||||
},
|
||||
"sip:decline": {
|
||||
"properties": {
|
||||
"id": "string",
|
||||
@@ -43,13 +50,28 @@
|
||||
"bargeIn": "#bargeIn",
|
||||
"record": "#recordOptions",
|
||||
"listen": "#listenOptions",
|
||||
"transcribe": "#transcribeOptions",
|
||||
"amd": "#amd",
|
||||
"fillerNoise": "#fillerNoise",
|
||||
"notifyEvents": "boolean",
|
||||
"reset": "string|array",
|
||||
"onHoldMusic": "string"
|
||||
"onHoldMusic": "string",
|
||||
"actionHookDelayAction": "#actionHookDelayAction",
|
||||
"sipRequestWithinDialogHook": "object|string",
|
||||
"boostAudioSignal": "number|string"
|
||||
},
|
||||
"required": []
|
||||
},
|
||||
"fillerNoise": {
|
||||
"properties": {
|
||||
"enable": "boolean",
|
||||
"url": "string",
|
||||
"startDelaySecs": "number"
|
||||
},
|
||||
"required": [
|
||||
"enable"
|
||||
]
|
||||
},
|
||||
"listenOptions": {
|
||||
"properties": {
|
||||
"enable": "boolean",
|
||||
@@ -60,7 +82,13 @@
|
||||
"type": "string",
|
||||
"enum": ["mono", "stereo", "mixed"]
|
||||
},
|
||||
"metadata": "object"
|
||||
"metadata": "object",
|
||||
"maxLength": "number",
|
||||
"passDtmf": "boolean",
|
||||
"playBeep": "boolean",
|
||||
"disableBidirectionalAudio": "boolean",
|
||||
"bidirectionalAudio": "#bidirectionalAudio",
|
||||
"timeout": "number"
|
||||
},
|
||||
"required": [
|
||||
"enable"
|
||||
@@ -71,6 +99,7 @@
|
||||
"enable": "boolean",
|
||||
"sticky": "boolean",
|
||||
"actionHook": "object|string",
|
||||
"partialResultHook": "object|string",
|
||||
"input": "array",
|
||||
"finishOnKey": "string",
|
||||
"numDigits": "number",
|
||||
@@ -84,6 +113,34 @@
|
||||
"enable"
|
||||
]
|
||||
},
|
||||
"transcribeOptions": {
|
||||
"properties": {
|
||||
"enable": "boolean",
|
||||
"transcriptionHook": "string",
|
||||
"recognizer": "#recognizer"
|
||||
},
|
||||
"required": [
|
||||
"enable"
|
||||
]
|
||||
},
|
||||
"dub": {
|
||||
"properties": {
|
||||
"id": "string",
|
||||
"action": {
|
||||
"type": "string",
|
||||
"enum": ["addTrack", "removeTrack", "silenceTrack", "playOnTrack", "sayOnTrack"]
|
||||
},
|
||||
"track": "string",
|
||||
"play": "string",
|
||||
"say": "string|object",
|
||||
"loop": "boolean",
|
||||
"gain": "number|string"
|
||||
},
|
||||
"required": [
|
||||
"action",
|
||||
"track"
|
||||
]
|
||||
},
|
||||
"dequeue": {
|
||||
"properties": {
|
||||
"id": "string",
|
||||
@@ -169,7 +226,9 @@
|
||||
"timeout": "number",
|
||||
"recognizer": "#recognizer",
|
||||
"play": "#play",
|
||||
"say": "#say"
|
||||
"say": "#say",
|
||||
"fillerNoise": "#fillerNoise",
|
||||
"actionHookDelayAction": "#actionHookDelayAction"
|
||||
},
|
||||
"required": [
|
||||
]
|
||||
@@ -179,6 +238,8 @@
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"beep": "boolean",
|
||||
"memberTag": "string",
|
||||
"speakOnlyTo": "string",
|
||||
"startConferenceOnEnter": "boolean",
|
||||
"endConferenceOnExit": "boolean",
|
||||
"endConferenceDuration": "number",
|
||||
@@ -210,13 +271,16 @@
|
||||
"dtmfHook": "object|string",
|
||||
"headers": "object",
|
||||
"anchorMedia": "boolean",
|
||||
"boostAudioSignal": "number|string",
|
||||
"listen": "#listen",
|
||||
"target": ["#target"],
|
||||
"timeLimit": "number",
|
||||
"timeout": "number",
|
||||
"proxy": "string",
|
||||
"transcribe": "#transcribe",
|
||||
"amd": "#amd"
|
||||
"amd": "#amd",
|
||||
"dub": ["#dub"],
|
||||
"tag": "object"
|
||||
},
|
||||
"required": [
|
||||
"target"
|
||||
@@ -301,6 +365,7 @@
|
||||
"passDtmf": "boolean",
|
||||
"playBeep": "boolean",
|
||||
"disableBidirectionalAudio": "boolean",
|
||||
"bidirectionalAudio": "#bidirectionalAudio",
|
||||
"sampleRate": "number",
|
||||
"timeout": "number",
|
||||
"transcribe": "#transcribe",
|
||||
@@ -402,7 +467,9 @@
|
||||
"to": "#target",
|
||||
"headers": "object",
|
||||
"timeout": "number",
|
||||
"amd": "#amd"
|
||||
"amd": "#amd",
|
||||
"dual_streams": "boolean",
|
||||
"sipRequestWithinDialogHook": "string"
|
||||
},
|
||||
"required": [
|
||||
"call_hook",
|
||||
@@ -424,7 +491,8 @@
|
||||
"id": "string",
|
||||
"transcriptionHook": "string",
|
||||
"recognizer": "#recognizer",
|
||||
"earlyMedia": "boolean"
|
||||
"earlyMedia": "boolean",
|
||||
"channel": "number"
|
||||
},
|
||||
"required": [
|
||||
"transcriptionHook"
|
||||
@@ -450,7 +518,8 @@
|
||||
"vmail": "boolean",
|
||||
"tenant": "string",
|
||||
"trunk": "string",
|
||||
"overrideTo": "string"
|
||||
"overrideTo": "string",
|
||||
"proxy": "string"
|
||||
},
|
||||
"required": [
|
||||
"type"
|
||||
@@ -479,11 +548,11 @@
|
||||
"vendor": "string",
|
||||
"label": "string",
|
||||
"language": "string",
|
||||
"voice": "string",
|
||||
"voice": "string|object",
|
||||
"fallbackVendor": "string",
|
||||
"fallbackLabel": "string",
|
||||
"fallbackLanguage": "string",
|
||||
"fallbackVoice": "string",
|
||||
"fallbackVoice": "string|object",
|
||||
"engine": {
|
||||
"type": "string",
|
||||
"enum": ["standard", "neural"]
|
||||
@@ -568,11 +637,17 @@
|
||||
"azureSttEndpointId": "string",
|
||||
"asrDtmfTerminationDigit": "string",
|
||||
"asrTimeout": "number",
|
||||
"fastRecognitionTimeout": "number",
|
||||
"nuanceOptions": "#nuanceOptions",
|
||||
"deepgramOptions": "#deepgramOptions",
|
||||
"ibmOptions": "#ibmOptions",
|
||||
"nvidiaOptions": "#nvidiaOptions",
|
||||
"sonioxOptions": "#sonioxOptions",
|
||||
"cobaltOptions": "#cobaltOptions",
|
||||
"awsOptions": "#awsOptions",
|
||||
"azureOptions": "#azureOptions",
|
||||
"assemblyAiOptions": "#assemblyAiOptions",
|
||||
"googleOptions": "#googleOptions",
|
||||
"customOptions": "#customOptions"
|
||||
},
|
||||
"required": [
|
||||
@@ -588,6 +663,71 @@
|
||||
"required": [
|
||||
]
|
||||
},
|
||||
"awsOptions": {
|
||||
"properties": {
|
||||
"accessKey": "string",
|
||||
"secretKey": "string",
|
||||
"securityToken": "string",
|
||||
"region": "string",
|
||||
"vocabularyName": "string",
|
||||
"vocabularyFilterName": "string",
|
||||
"vocabularyFilterMethod": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"remove",
|
||||
"mask",
|
||||
"tag"
|
||||
]
|
||||
},
|
||||
"languageModelName": "string",
|
||||
"piiEntityTypes": "array",
|
||||
"piiIdentifyEntities": "boolean"
|
||||
},
|
||||
"required": [
|
||||
]
|
||||
},
|
||||
"azureOptions": {
|
||||
"properties": {
|
||||
"speechSegmentationSilenceTimeoutMs": "number",
|
||||
"languageIdMode": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"AtStart",
|
||||
"Continuous"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
]
|
||||
},
|
||||
"googleOptions" : {
|
||||
"properties": {
|
||||
"serviceVersion": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"v1",
|
||||
"v2"
|
||||
]
|
||||
},
|
||||
"recognizerId": "string",
|
||||
"speechStartTimeoutMs": "number",
|
||||
"speechEndTimeoutMs": "number",
|
||||
"enableVoiceActivityEvents": "boolean",
|
||||
"transcriptNormalization": "array"
|
||||
}
|
||||
},
|
||||
"cobaltOptions": {
|
||||
"properties": {
|
||||
"serverUri": "string",
|
||||
"enableConfusionNetwork": "boolean",
|
||||
"metadata": "string",
|
||||
"compiledContextData": "string",
|
||||
"wordTimeOffsets": "boolean",
|
||||
"contextToken": "string"
|
||||
},
|
||||
"required": [
|
||||
]
|
||||
},
|
||||
"nvidiaOptions": {
|
||||
"properties": {
|
||||
"rivaUri": "string",
|
||||
@@ -620,12 +760,15 @@
|
||||
},
|
||||
"deepgramOptions": {
|
||||
"properties": {
|
||||
"deepgramSttUri": "string",
|
||||
"deepgramSttUseTls": "boolean",
|
||||
"apiKey": "string",
|
||||
"tier": "string",
|
||||
"model": "string",
|
||||
"customModel": "string",
|
||||
"version": "string",
|
||||
"punctuate": "boolean",
|
||||
"smartFormatting": "boolean",
|
||||
"profanityFilter": "boolean",
|
||||
"redact": {
|
||||
"type": "string",
|
||||
@@ -646,6 +789,8 @@
|
||||
"replace": "array",
|
||||
"keywords": "array",
|
||||
"endpointing": "boolean | number",
|
||||
"utteranceEndMs": "number",
|
||||
"shortUtterance": "boolean",
|
||||
"vadTurnoff": "number",
|
||||
"tag": "string"
|
||||
}
|
||||
@@ -720,6 +865,11 @@
|
||||
"required": [
|
||||
]
|
||||
},
|
||||
"assemblyAiOptions": {
|
||||
"properties": {
|
||||
"apiKey": "string"
|
||||
}
|
||||
},
|
||||
"resource": {
|
||||
"properties": {
|
||||
"externalReference": "#resourceReference",
|
||||
@@ -820,5 +970,21 @@
|
||||
"toneTimeoutMs": "number",
|
||||
"greetingCompletionTimeoutMs": "number"
|
||||
}
|
||||
},
|
||||
"actionHookDelayAction" : {
|
||||
"properties": {
|
||||
"enabled": "boolean",
|
||||
"noResponseTimeout": "number",
|
||||
"noResponseGiveUpTimeout": "number",
|
||||
"retries": "number",
|
||||
"actions": "array"
|
||||
}
|
||||
},
|
||||
"bidirectionalAudio" : {
|
||||
"properties": {
|
||||
"enabled": "boolean",
|
||||
"streaming": "boolean",
|
||||
"sampleRate": "number"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,60 @@ test("validate correct verbs", async (t) => {
|
||||
"input" : ["speech"],
|
||||
"actionHook": "/userInput"
|
||||
},
|
||||
"onHoldMusic": "http://server.com/hold"
|
||||
"transcribe": {
|
||||
"enable": true,
|
||||
"transcriptionHook": "http://server.com/hook",
|
||||
"recognizer": {
|
||||
"vendor": "google",
|
||||
"language": "de-DE",
|
||||
}
|
||||
},
|
||||
"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"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"verb": "config",
|
||||
"recognizer": {
|
||||
"vendor": "google",
|
||||
"language": "de-DE",
|
||||
"label": "label1",
|
||||
"azureOptions": {
|
||||
"languageIdMode": "Continuous"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"verb": "config",
|
||||
@@ -50,6 +103,10 @@ test("validate correct verbs", async (t) => {
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"verb": "config",
|
||||
"sipRequestWithinDialogHook": "https://jambonz.or/sipIndialogActionHook"
|
||||
},
|
||||
{
|
||||
"verb": "config",
|
||||
"record": {
|
||||
@@ -135,6 +192,7 @@ test("validate correct verbs", async (t) => {
|
||||
"language": "en-US",
|
||||
"hints": ["sales", "support"],
|
||||
"hintsBoost": 10,
|
||||
"fastRecognitionTimeout": 2000,
|
||||
"deepgramOptions": {
|
||||
"endpointing": 500
|
||||
}
|
||||
@@ -150,6 +208,24 @@ 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",
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -173,6 +249,28 @@ 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",
|
||||
@@ -216,6 +314,29 @@ test("validate correct verbs", async (t) => {
|
||||
"url": "wss://myrecorder.example.com/calls",
|
||||
"mixType" : "stereo"
|
||||
},
|
||||
{
|
||||
"verb": "listen",
|
||||
"url": "wss://myrecorder.example.com/calls",
|
||||
"mixType" : "stereo",
|
||||
"bidirectionalAudio": {
|
||||
enabled: true,
|
||||
streaming: true,
|
||||
sampleRate: 8000
|
||||
}
|
||||
},
|
||||
{
|
||||
"verb": "config",
|
||||
"listen": {
|
||||
"enable": true,
|
||||
"url": "wss://myrecorder.example.com/calls",
|
||||
"mixType" : "stereo",
|
||||
"bidirectionalAudio": {
|
||||
enabled: true,
|
||||
streaming: true,
|
||||
sampleRate: 8000
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"verb": "message",
|
||||
"to": "15083084809",
|
||||
@@ -291,6 +412,28 @@ test("validate correct verbs", async (t) => {
|
||||
"interim": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"verb": "transcribe",
|
||||
"transcriptionHook": "http://example.com/transcribe",
|
||||
"recognizer": {
|
||||
"vendor": "nvidia",
|
||||
"language" : "en-US",
|
||||
"interim": true,
|
||||
"googleOptions": {
|
||||
"serviceVersion": "v2",
|
||||
"speechStartTimeoutMs": 500,
|
||||
"speechEndTimeoutMs": 1000,
|
||||
"enableVoiceActivityEvents": true,
|
||||
"transcriptNormalization" : [
|
||||
{
|
||||
"search": "dog",
|
||||
"replace": "cat",
|
||||
"case_sensitive": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"verb": "rest:dial",
|
||||
"account_sid": "1291964182631236912836123912",
|
||||
@@ -312,7 +455,8 @@ test("validate correct verbs", async (t) => {
|
||||
"amd": {
|
||||
"actionHook": "/answeringMachineDetection",
|
||||
|
||||
}
|
||||
},
|
||||
"dual_streams": true
|
||||
}
|
||||
];
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user