mirror of
https://github.com/jambonz/verb-specifications.git
synced 2026-03-24 12:39:08 +00:00
Compare commits
91 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
3a5b053248 | ||
|
|
d74364b1c2 | ||
|
|
213d7596d2 | ||
|
|
3d4df422e1 | ||
|
|
3531711991 | ||
|
|
f860074a24 | ||
|
|
65de44012a | ||
|
|
067a49bd2c | ||
|
|
4967efa745 | ||
|
|
61669e5574 | ||
|
|
e25ef7349e | ||
|
|
26f5609996 | ||
|
|
1a1436b612 | ||
|
|
ba9a9f9b60 | ||
|
|
93c368e894 | ||
|
|
185e4df06e | ||
|
|
c22e8c9cf0 | ||
|
|
1c3d86c807 | ||
|
|
7e986acc17 | ||
|
|
d5c535c02c | ||
|
|
6e819279d1 | ||
|
|
24e73a4dc6 | ||
|
|
cfd367f185 | ||
|
|
f472de9638 | ||
|
|
45a2a039cd | ||
|
|
4a345633a3 | ||
|
|
f14ff2e319 | ||
|
|
c85cb7e67e | ||
|
|
8ccb13f962 | ||
|
|
044ce2d4bb | ||
|
|
b483e04611 | ||
|
|
c1032638b2 | ||
|
|
72225385ae | ||
|
|
6ad9d2bce0 | ||
|
|
045df8a9fe | ||
|
|
f3ede17b80 | ||
|
|
2551dbe18e | ||
|
|
f4a887a67a | ||
|
|
874abac5e3 | ||
|
|
827ddcebf0 | ||
|
|
98043693be | ||
|
|
436c8e1861 | ||
|
|
21214eb2ce | ||
|
|
017b8cd0c3 | ||
|
|
8ae7419b7a | ||
|
|
11c34aa6fc |
@@ -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.15",
|
||||
"version": "0.0.52",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@jambonz/verb-specifications",
|
||||
"version": "0.0.15",
|
||||
"version": "0.0.52",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "^4.3.4",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@jambonz/verb-specifications",
|
||||
"version": "0.0.15",
|
||||
"version": "0.0.52",
|
||||
"description": "Jambonz Verb Specification Utilities",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
136
specs.json
136
specs.json
@@ -43,8 +43,13 @@
|
||||
"bargeIn": "#bargeIn",
|
||||
"record": "#recordOptions",
|
||||
"listen": "#listenOptions",
|
||||
"transcribe": "#transcribeOptions",
|
||||
"amd": "#amd",
|
||||
"notifyEvents": "boolean"
|
||||
"notifyEvents": "boolean",
|
||||
"reset": "string|array",
|
||||
"onHoldMusic": "string",
|
||||
"actionHookDelayAction": "#actionHookDelayAction",
|
||||
"sipRequestWithinDialogHook": "object|string"
|
||||
},
|
||||
"required": []
|
||||
},
|
||||
@@ -58,7 +63,12 @@
|
||||
"type": "string",
|
||||
"enum": ["mono", "stereo", "mixed"]
|
||||
},
|
||||
"metadata": "object"
|
||||
"metadata": "object",
|
||||
"maxLength": "number",
|
||||
"passDtmf": "boolean",
|
||||
"playBeep": "boolean",
|
||||
"disableBidirectionalAudio": "boolean",
|
||||
"timeout": "number"
|
||||
},
|
||||
"required": [
|
||||
"enable"
|
||||
@@ -82,13 +92,24 @@
|
||||
"enable"
|
||||
]
|
||||
},
|
||||
"transcribeOptions": {
|
||||
"properties": {
|
||||
"enable": "boolean",
|
||||
"transcriptionHook": "string",
|
||||
"recognizer": "#recognizer"
|
||||
},
|
||||
"required": [
|
||||
"enable"
|
||||
]
|
||||
},
|
||||
"dequeue": {
|
||||
"properties": {
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"actionHook": "object|string",
|
||||
"timeout": "number",
|
||||
"beep": "boolean"
|
||||
"beep": "boolean",
|
||||
"callSid": "string"
|
||||
},
|
||||
"required": [
|
||||
"name"
|
||||
@@ -100,6 +121,7 @@
|
||||
"name": "string",
|
||||
"actionHook": "object|string",
|
||||
"waitHook": "object|string",
|
||||
"priority": "number",
|
||||
"_": "object"
|
||||
},
|
||||
"required": [
|
||||
@@ -165,7 +187,8 @@
|
||||
"timeout": "number",
|
||||
"recognizer": "#recognizer",
|
||||
"play": "#play",
|
||||
"say": "#say"
|
||||
"say": "#say",
|
||||
"actionHookDelayAction": "#actionHookDelayAction"
|
||||
},
|
||||
"required": [
|
||||
]
|
||||
@@ -177,6 +200,7 @@
|
||||
"beep": "boolean",
|
||||
"startConferenceOnEnter": "boolean",
|
||||
"endConferenceOnExit": "boolean",
|
||||
"endConferenceDuration": "number",
|
||||
"maxParticipants": "number",
|
||||
"joinMuted": "boolean",
|
||||
"actionHook": "object|string",
|
||||
@@ -194,6 +218,7 @@
|
||||
"properties": {
|
||||
"id": "string",
|
||||
"actionHook": "object|string",
|
||||
"onHoldHook": "object|string",
|
||||
"answerOnBridge": "boolean",
|
||||
"callerId": "string",
|
||||
"callerName": "string",
|
||||
@@ -361,7 +386,8 @@
|
||||
"enum": ["startCallRecording", "stopCallRecording", "pauseCallRecording", "resumeCallRecording"]
|
||||
},
|
||||
"recordingID": "string",
|
||||
"siprecServerURL": "string"
|
||||
"siprecServerURL": "string|array",
|
||||
"headers": "object"
|
||||
},
|
||||
"required": [
|
||||
"action"
|
||||
@@ -394,7 +420,10 @@
|
||||
"tag": "object",
|
||||
"to": "#target",
|
||||
"headers": "object",
|
||||
"timeout": "number"
|
||||
"timeout": "number",
|
||||
"amd": "#amd",
|
||||
"dual_streams": "boolean",
|
||||
"sipRequestWithinDialogHook": "string"
|
||||
},
|
||||
"required": [
|
||||
"call_hook",
|
||||
@@ -419,7 +448,7 @@
|
||||
"earlyMedia": "boolean"
|
||||
},
|
||||
"required": [
|
||||
"recognizer"
|
||||
"transcriptionHook"
|
||||
]
|
||||
},
|
||||
"target": {
|
||||
@@ -442,7 +471,8 @@
|
||||
"vmail": "boolean",
|
||||
"tenant": "string",
|
||||
"trunk": "string",
|
||||
"overrideTo": "string"
|
||||
"overrideTo": "string",
|
||||
"proxy": "string"
|
||||
},
|
||||
"required": [
|
||||
"type"
|
||||
@@ -469,8 +499,13 @@
|
||||
"synthesizer": {
|
||||
"properties": {
|
||||
"vendor": "string",
|
||||
"label": "string",
|
||||
"language": "string",
|
||||
"voice": "string",
|
||||
"voice": "string|object",
|
||||
"fallbackVendor": "string",
|
||||
"fallbackLabel": "string",
|
||||
"fallbackLanguage": "string",
|
||||
"fallbackVoice": "string|object",
|
||||
"engine": {
|
||||
"type": "string",
|
||||
"enum": ["standard", "neural"]
|
||||
@@ -478,7 +513,8 @@
|
||||
"gender": {
|
||||
"type": "string",
|
||||
"enum": ["MALE", "FEMALE", "NEUTRAL"]
|
||||
}
|
||||
},
|
||||
"options": "object"
|
||||
},
|
||||
"required": [
|
||||
"vendor"
|
||||
@@ -487,7 +523,11 @@
|
||||
"recognizer": {
|
||||
"properties": {
|
||||
"vendor": "string",
|
||||
"label": "string",
|
||||
"language": "string",
|
||||
"fallbackVendor": "string",
|
||||
"fallbackLabel": "string",
|
||||
"fallbackLanguage": "string",
|
||||
"vad": "#vad",
|
||||
"hints": "array",
|
||||
"hintsBoost": "number",
|
||||
@@ -550,11 +590,16 @@
|
||||
"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",
|
||||
"customOptions": "#customOptions"
|
||||
},
|
||||
"required": [
|
||||
@@ -570,6 +615,48 @@
|
||||
"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"
|
||||
},
|
||||
"required": [
|
||||
]
|
||||
},
|
||||
"cobaltOptions": {
|
||||
"properties": {
|
||||
"serverUri": "string",
|
||||
"enableConfusionNetwork": "boolean",
|
||||
"metadata": "string",
|
||||
"compiledContextData": "string",
|
||||
"wordTimeOffsets": "boolean",
|
||||
"contextToken": "string"
|
||||
},
|
||||
"required": [
|
||||
]
|
||||
},
|
||||
"nvidiaOptions": {
|
||||
"properties": {
|
||||
"rivaUri": "string",
|
||||
@@ -602,18 +689,15 @@
|
||||
},
|
||||
"deepgramOptions": {
|
||||
"properties": {
|
||||
"deepgramSttUri": "string",
|
||||
"deepgramSttUseTls": "boolean",
|
||||
"apiKey": "string",
|
||||
"tier": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"enhanced",
|
||||
"base"
|
||||
]
|
||||
},
|
||||
"tier": "string",
|
||||
"model": "string",
|
||||
"customModel": "string",
|
||||
"version": "string",
|
||||
"punctuate": "boolean",
|
||||
"smartFormatting": "boolean",
|
||||
"profanityFilter": "boolean",
|
||||
"redact": {
|
||||
"type": "string",
|
||||
@@ -633,7 +717,9 @@
|
||||
"search": "array",
|
||||
"replace": "array",
|
||||
"keywords": "array",
|
||||
"endpointing": "boolean",
|
||||
"endpointing": "boolean | number",
|
||||
"utteranceEndMs": "number",
|
||||
"shortUtterance": "boolean",
|
||||
"vadTurnoff": "number",
|
||||
"tag": "string"
|
||||
}
|
||||
@@ -708,6 +794,11 @@
|
||||
"required": [
|
||||
]
|
||||
},
|
||||
"assemblyAiOptions": {
|
||||
"properties": {
|
||||
"apiKey": "string"
|
||||
}
|
||||
},
|
||||
"resource": {
|
||||
"properties": {
|
||||
"externalReference": "#resourceReference",
|
||||
@@ -808,5 +899,14 @@
|
||||
"toneTimeoutMs": "number",
|
||||
"greetingCompletionTimeoutMs": "number"
|
||||
}
|
||||
},
|
||||
"actionHookDelayAction" : {
|
||||
"properties": {
|
||||
"enabled": "boolean",
|
||||
"noResponseTimeout": "number",
|
||||
"noResponseGiveUpTimeout": "number",
|
||||
"retries": "number",
|
||||
"actions": "array"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,27 +24,96 @@ test("validate correct verbs", async (t) => {
|
||||
"verb": "config",
|
||||
"synthesizer": {
|
||||
"voice": "Jenny",
|
||||
"vendor": "google"
|
||||
"vendor": "google",
|
||||
"label": "label1"
|
||||
},
|
||||
"recognizer": {
|
||||
"vendor": "google",
|
||||
"language": "de-DE"
|
||||
"language": "de-DE",
|
||||
"label": "label1"
|
||||
},
|
||||
"bargeIn": {
|
||||
"enable": true,
|
||||
"input" : ["speech"],
|
||||
"actionHook": "/userInput"
|
||||
},
|
||||
"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",
|
||||
"record": {
|
||||
"action": "startCallRecording",
|
||||
"siprecServerURL": ["sip:srs@recording.example.com","sip:srs@recording.example.com"],
|
||||
"headers" : {
|
||||
"X-Header1": "Value1",
|
||||
"X-Header2": "Value2"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"verb": "config",
|
||||
"sipRequestWithinDialogHook": "https://jambonz.or/sipIndialogActionHook"
|
||||
},
|
||||
{
|
||||
"verb": "config",
|
||||
"record": {
|
||||
"action": "startCallRecording",
|
||||
"siprecServerURL": "sip:srs@recording.example.com"
|
||||
}
|
||||
},
|
||||
{
|
||||
"verb": "dequeue",
|
||||
"name": "support",
|
||||
"beep": true,
|
||||
"timeout": 60
|
||||
"timeout": 60,
|
||||
"callSid": "call_sid1234"
|
||||
},
|
||||
{
|
||||
"verb": "dial",
|
||||
"actionHook": "/outdial",
|
||||
"onHoldHook": "/onHoldHook",
|
||||
"callerId": "+16173331212",
|
||||
"callerName": "Tom",
|
||||
"answerOnBridge": true,
|
||||
@@ -95,7 +164,8 @@ test("validate correct verbs", async (t) => {
|
||||
"verb": "enqueue",
|
||||
"name": "support",
|
||||
"actionHook": "/queue-action",
|
||||
"waitHook": "/queue-wait"
|
||||
"waitHook": "/queue-wait",
|
||||
"priority": 50
|
||||
},
|
||||
{
|
||||
"verb": "gather",
|
||||
@@ -110,14 +180,85 @@ test("validate correct verbs", async (t) => {
|
||||
"vendor": "google",
|
||||
"language": "en-US",
|
||||
"hints": ["sales", "support"],
|
||||
"hintsBoost": 10
|
||||
"hintsBoost": 10,
|
||||
"fastRecognitionTimeout": 2000,
|
||||
"deepgramOptions": {
|
||||
"endpointing": 500
|
||||
}
|
||||
},
|
||||
"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"
|
||||
"language": "en-US",
|
||||
"label": "label1",
|
||||
"fallbackVendor": "google",
|
||||
"fallbackLanguage": "en-US",
|
||||
"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",
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"verb": "gather",
|
||||
"actionHook": "http://example.com/collect",
|
||||
"input": ["digits", "speech"],
|
||||
"bargein": true,
|
||||
"dtmfBargein": true,
|
||||
"finishOnKey": "#",
|
||||
"numDigits": 5,
|
||||
"timeout": 8,
|
||||
"recognizer": {
|
||||
"vendor": "google",
|
||||
"language": "en-US",
|
||||
"fallbackVendor": "google",
|
||||
"fallbackLanguage": "en-US",
|
||||
"fallbackLabel": "label1",
|
||||
"hints": ["sales", "support"],
|
||||
"hintsBoost": 10,
|
||||
"deepgramOptions": {
|
||||
"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"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -236,6 +377,30 @@ test("validate correct verbs", async (t) => {
|
||||
"language" : "en-US",
|
||||
"interim": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"verb": "rest:dial",
|
||||
"account_sid": "1291964182631236912836123912",
|
||||
"call_hook": {
|
||||
"url": "http://127.0.0.1:3100/",
|
||||
"method": "POST",
|
||||
"username": "username",
|
||||
"password": "password",
|
||||
},
|
||||
"from": "15583084810",
|
||||
"to": {
|
||||
"type": "phone",
|
||||
"number": "15583084809",
|
||||
},
|
||||
"tag": {
|
||||
"customer": "acme",
|
||||
"referenceId": "deadbeef",
|
||||
},
|
||||
"amd": {
|
||||
"actionHook": "/answeringMachineDetection",
|
||||
|
||||
},
|
||||
"dual_streams": true
|
||||
}
|
||||
];
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user