mirror of
https://github.com/jambonz/verb-specifications.git
synced 2026-03-26 05:47:53 +00:00
Compare commits
267 Commits
0.0.2
...
feat/fs_20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b3ee9b5a99 | ||
|
|
228f8773d3 | ||
|
|
c9cd50c559 | ||
|
|
fe095be5c8 | ||
|
|
71caf6bb53 | ||
|
|
887320fd5d | ||
|
|
f0ffdee9c6 | ||
|
|
1013db46d3 | ||
|
|
8771e3f22f | ||
|
|
ff757d3177 | ||
|
|
5745cc9a29 | ||
|
|
2b81fe20f0 | ||
|
|
60a33e11eb | ||
|
|
9717ce6d58 | ||
|
|
49ffe5f526 | ||
|
|
61590b66cc | ||
|
|
d8cf684bf6 | ||
|
|
e039261eb5 | ||
|
|
23e726ed3f | ||
|
|
e1bc5adc55 | ||
|
|
76e2486535 | ||
|
|
dfcf1de210 | ||
|
|
7d19707dec | ||
|
|
b4856e9d05 | ||
|
|
577191ed0d | ||
|
|
ee2ffff20d | ||
|
|
4c5b795498 | ||
|
|
7ecd46393c | ||
|
|
8fffe39195 | ||
|
|
23cb499244 | ||
|
|
fb94dc94cb | ||
|
|
30677b6cd1 | ||
|
|
4ea9cda0f8 | ||
|
|
a0b9f963c2 | ||
|
|
841a471faa | ||
|
|
44112f67b3 | ||
|
|
1f7c98c0ce | ||
|
|
276a55e672 | ||
|
|
840db61042 | ||
|
|
85e1b64ee4 | ||
|
|
8ed54e2d51 | ||
|
|
c24fb7996c | ||
|
|
6c24ad1145 | ||
|
|
af3955cb35 | ||
|
|
1ee29749c3 | ||
|
|
dea57e0910 | ||
|
|
f444a57bcd | ||
|
|
a9a2339821 | ||
|
|
95f3a06625 | ||
|
|
985476e8b1 | ||
|
|
1782db362e | ||
|
|
e654ee9e10 | ||
|
|
38d1d04c4a | ||
|
|
5cbd3886d1 | ||
|
|
de8dfc9202 | ||
|
|
637431468d | ||
|
|
4a817c97b2 | ||
|
|
ce44bf41d4 | ||
|
|
ab84583eff | ||
|
|
13901713b8 | ||
|
|
85fd68af16 | ||
|
|
5a5a397a68 | ||
|
|
b85c7ac743 | ||
|
|
82c6952f70 | ||
|
|
fc95fa3d02 | ||
|
|
6b3ee83d08 | ||
|
|
3700ba6607 | ||
|
|
09a76f44cb | ||
|
|
aa445c1edb | ||
|
|
57887a660c | ||
|
|
e9dace6495 | ||
|
|
762a9639bd | ||
|
|
2740eb9848 | ||
|
|
1a525e7a3e | ||
|
|
f16b49cc23 | ||
|
|
1cc7dae926 | ||
|
|
8c50bf8764 | ||
|
|
e2bffbe0a8 | ||
|
|
4b79b1408b | ||
|
|
900d517b8a | ||
|
|
104ca00a3d | ||
|
|
7b3dd92c18 | ||
|
|
43a2805ea8 | ||
|
|
f9e6755d8d | ||
|
|
264640bbc7 | ||
|
|
71d31952d6 | ||
|
|
6a80506a81 | ||
|
|
85b1c3a2f9 | ||
|
|
f59137ebad | ||
|
|
7b80ba6fd5 | ||
|
|
216e6954af | ||
|
|
027cce284d | ||
|
|
9a8194b360 | ||
|
|
0bcfa783b7 | ||
|
|
9a3fb68fe7 | ||
|
|
f2ea3f3913 | ||
|
|
6a75a8b98a | ||
|
|
2af0fd4415 | ||
|
|
46688934bc | ||
|
|
afce20a206 | ||
|
|
e80679fd07 | ||
|
|
aa86d0b3e6 | ||
|
|
60f4bcd97a | ||
|
|
cb8b51da4a | ||
|
|
d9fd63850b | ||
|
|
e57c81aeed | ||
|
|
610b14736a | ||
|
|
4a8517cab5 | ||
|
|
21bb3c2b73 | ||
|
|
e044621bbc | ||
|
|
6d8ffc9d80 | ||
|
|
941ba6aa8c | ||
|
|
1d8cf321a7 | ||
|
|
0d8b9de099 | ||
|
|
08e01efa7f | ||
|
|
1fdda56c39 | ||
|
|
8db0a91521 | ||
|
|
6432d9e64b | ||
|
|
c029a18c3e | ||
|
|
27b1a06944 | ||
|
|
0f9c096988 | ||
|
|
569b994356 | ||
|
|
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 | ||
|
|
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 | ||
|
|
5548a67412 | ||
|
|
8f89bac676 | ||
|
|
146f691890 | ||
|
|
283512e765 | ||
|
|
d7219b990b | ||
|
|
68b3c7de01 | ||
|
|
dff94d3ac5 | ||
|
|
70f7c5ab96 | ||
|
|
403766cd4d | ||
|
|
10c7f60bad | ||
|
|
32f63759db | ||
|
|
825130348b | ||
|
|
f99b94a405 | ||
|
|
6c40dda566 | ||
|
|
899f55a272 | ||
|
|
22a6b30aa3 | ||
|
|
430a702752 | ||
|
|
8dbbe13c5f |
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2023 jambonz
|
||||
Copyright (c) 2023 Drachtio Communications Services, LLC.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# verb-specificiations
|
||||
# verb-specifications
|
||||
Jambonz Verb Specification Utilities
|
||||
|
||||
#### Running the test suite
|
||||
|
||||
4
index.js
4
index.js
@@ -0,0 +1,4 @@
|
||||
module.exports = {
|
||||
...require('./jambonz-app-json-validation'),
|
||||
specs: require('./specs')
|
||||
};
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
const assert = require('assert');
|
||||
const debug = require('debug')('jambonz:app-json-validation');
|
||||
const _specData = require('./specs');
|
||||
const specs = new Map();
|
||||
for (const key in _specData) { specs.set(key, _specData[key]); }
|
||||
@@ -30,7 +31,7 @@ function normalizeJambones(logger, obj) {
|
||||
throw new Error('malformed jambonz payload: missing verb property');
|
||||
}
|
||||
}
|
||||
logger.debug({ document }, `normalizeJambones: returning document with ${document.length} tasks`);
|
||||
debug({ document }, `normalizeJambones: returning document with ${document.length} tasks`);
|
||||
return document;
|
||||
}
|
||||
|
||||
@@ -44,7 +45,7 @@ function validate(logger, obj) {
|
||||
}
|
||||
|
||||
function validateVerb(name, data, logger) {
|
||||
logger.debug(`validating ${name} with data ${JSON.stringify(data)}`);
|
||||
debug(`validating ${name} with data ${JSON.stringify(data)}`);
|
||||
// validate the instruction is supported
|
||||
if (!specs.has(name)) throw new Error(`invalid instruction: ${name}`);
|
||||
|
||||
@@ -55,9 +56,10 @@ function validateVerb(name, data, logger) {
|
||||
if (dKey in specData.properties) {
|
||||
const dVal = data[dKey];
|
||||
const dSpec = specData.properties[dKey];
|
||||
logger.debug(`Task:validate validating property ${dKey} with value ${JSON.stringify(dVal)}`);
|
||||
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('|')) {
|
||||
|
||||
2633
package-lock.json
generated
2633
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,12 +1,11 @@
|
||||
{
|
||||
"name": "verb-specifications",
|
||||
"version": "0.0.2",
|
||||
"name": "@jambonz/verb-specifications",
|
||||
"version": "0.0.127",
|
||||
"description": "Jambonz Verb Specification Utilities",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "node test/",
|
||||
"jslint": "eslint index.js"
|
||||
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -21,9 +20,10 @@
|
||||
"devDependencies": {
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-plugin-promise": "^4.3.1",
|
||||
"tape": "^5.6.1"
|
||||
"tape": "^5.7.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"debug": "^4.3.4",
|
||||
"pino": "^8.8.0"
|
||||
}
|
||||
}
|
||||
|
||||
756
specs.json
756
specs.json
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
const test = require('tape');
|
||||
const logger = require('pino')({level: process.env.JAMBONES_LOGLEVEL || 'error'});
|
||||
const { validate } = require('../jambonz-app-json-validation');
|
||||
const { validate } = require('..');
|
||||
|
||||
test("validate correct verbs", async (t) => {
|
||||
|
||||
@@ -24,30 +24,128 @@ 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",
|
||||
"notifySttLatency": true,
|
||||
"recognizer": {
|
||||
"vendor": "google",
|
||||
"language": "de-DE",
|
||||
"label": "label1",
|
||||
"assemblyAiOptions": {
|
||||
"apiKey": "apikey",
|
||||
"serviceVersion": "v3",
|
||||
"formatTurns": true,
|
||||
"endOfTurnConfidenceThreshold": 0.5,
|
||||
"minEndOfTurnSilenceWhenConfident": 500,
|
||||
"maxTurnSilence": 2000
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"verb": "config",
|
||||
"referHook": "https://referhook.com"
|
||||
},
|
||||
{
|
||||
"verb": "config",
|
||||
"referHook": {
|
||||
"url": "https://referhook.com"
|
||||
}
|
||||
},
|
||||
{
|
||||
"verb": "config",
|
||||
"recognizer": {
|
||||
"vendor": "google",
|
||||
"language": "de-DE",
|
||||
"label": "label1",
|
||||
"azureOptions": {
|
||||
"languageIdMode": "Continuous"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"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,
|
||||
"dtmfCapture": ["*2", "*3"],
|
||||
"timeLimit": 10,
|
||||
"dtmfHook": {
|
||||
"url": "/dtmf",
|
||||
"method": "GET"
|
||||
@@ -94,7 +192,8 @@ test("validate correct verbs", async (t) => {
|
||||
"verb": "enqueue",
|
||||
"name": "support",
|
||||
"actionHook": "/queue-action",
|
||||
"waitHook": "/queue-wait"
|
||||
"waitHook": "/queue-wait",
|
||||
"priority": 50
|
||||
},
|
||||
{
|
||||
"verb": "gather",
|
||||
@@ -109,14 +208,183 @@ test("validate correct verbs", async (t) => {
|
||||
"vendor": "google",
|
||||
"language": "en-US",
|
||||
"hints": ["sales", "support"],
|
||||
"hintsBoost": 10
|
||||
"hintsBoost": 10,
|
||||
"fastRecognitionTimeout": 2000,
|
||||
"deepgramOptions": {
|
||||
"endpointing": 500,
|
||||
"noDelay": true,
|
||||
"eotThreshold": 500,
|
||||
"eotTimeoutMs": 5000,
|
||||
"eagerEotThreshold": 200,
|
||||
"mipOptOut": true
|
||||
}
|
||||
},
|
||||
"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",
|
||||
"instructions": "Voice: High-energy, upbeat, and encouraging, projecting enthusiasm and motivation."
|
||||
},
|
||||
"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": "verbio",
|
||||
"language": "en-US",
|
||||
"verbioOptions": {
|
||||
"enable_formatting": true,
|
||||
"enable_diarization": true,
|
||||
"topic": 0,
|
||||
"inline_grammar": "this is inline grammar",
|
||||
"grammar_uri": "https://grammar_uri.com",
|
||||
"label": "label",
|
||||
"recognition_timeout": 500,
|
||||
"speech_complete_timeout": 500,
|
||||
"speech_incomplete_timeout": 500,
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
"verb": "gather",
|
||||
"actionHook": "http://example.com/collect",
|
||||
"input": ["digits", "speech"],
|
||||
"bargein": true,
|
||||
"dtmfBargein": true,
|
||||
"finishOnKey": "#",
|
||||
"numDigits": 5,
|
||||
"timeout": 8,
|
||||
"recognizer": {
|
||||
"vendor": "houndify",
|
||||
"language": "en-US",
|
||||
"houndifyOptions": {
|
||||
"requestInfo": {
|
||||
"Latitude": 30.6,
|
||||
"Longitude": 30.6,
|
||||
"City": "Huston"
|
||||
},
|
||||
"sampleRate": 16000,
|
||||
"latitude": 30.6,
|
||||
"longitude": 30.6,
|
||||
"city": "Huston",
|
||||
"state": "CA",
|
||||
"country": "US",
|
||||
"timeZone": "GMT",
|
||||
"domain": "Voice",
|
||||
"audioEndpoint": "https://api.houndify.com/v1/audio",
|
||||
"maxSilenceSeconds": 5,
|
||||
"maxSilenceAfterFullQuerySeconds": 3,
|
||||
"maxSilenceAfterPartialQuerySeconds": 2,
|
||||
"vadSensitivity": 0.5,
|
||||
"vadTimeout": 1000,
|
||||
"vadMode": "auto",
|
||||
"vadVoiceMs": 250,
|
||||
"vadSilenceMs": 500,
|
||||
"vadDebug": true,
|
||||
"audioFormat": "PCM16",
|
||||
"enableNoiseReduction": true,
|
||||
"enableProfanityFilter": false,
|
||||
"enablePunctuation": true,
|
||||
"enableCapitalization": true,
|
||||
"confidenceThreshold": 0.7,
|
||||
"enableDisfluencyFilter": true,
|
||||
"maxResults": 5,
|
||||
"enableWordTimestamps": true,
|
||||
"maxAlternatives": 3,
|
||||
"partialTranscriptInterval": 100,
|
||||
"sessionTimeout": 30000,
|
||||
"connectionTimeout": 5000,
|
||||
"customVocabulary": ["jambonz", "telephony", "voip"],
|
||||
"languageModel": "enhanced",
|
||||
"audioQueryAbsoluteTimeout": 5
|
||||
},
|
||||
"gladiaOptions": {
|
||||
"post_processing": {
|
||||
"summarization": false,
|
||||
"summarization_config": {
|
||||
"type": "general"
|
||||
},
|
||||
"chapterization": false
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
"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"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -161,6 +429,64 @@ 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": "config",
|
||||
"autoStreamTts": true
|
||||
},
|
||||
{
|
||||
"verb": "config",
|
||||
"vad": {
|
||||
"enable": true,
|
||||
"voiceMs": 250,
|
||||
"silenceMs": 150,
|
||||
"strategy": "one-shot",
|
||||
"mode": 2,
|
||||
"vendor": "webrtc",
|
||||
"threshold": 0.5,
|
||||
"speechPadMs": 1000
|
||||
}
|
||||
},
|
||||
{
|
||||
"verb": "config",
|
||||
"noiseIsolation": {
|
||||
"enable": true,
|
||||
"vendor": "krisp",
|
||||
"level": 3,
|
||||
"model": "custom-model"
|
||||
}
|
||||
},
|
||||
{
|
||||
"verb": "config",
|
||||
"turnTaking": {
|
||||
"enable": true,
|
||||
"vendor": "krisp",
|
||||
"threshold": 0.5,
|
||||
"model": "turn-taking-model"
|
||||
}
|
||||
},
|
||||
{
|
||||
"verb": "message",
|
||||
"to": "15083084809",
|
||||
@@ -219,6 +545,12 @@ test("validate correct verbs", async (t) => {
|
||||
"referTo": "+15083084809",
|
||||
"actionHook": "/action"
|
||||
},
|
||||
{
|
||||
"verb": "sip:refer",
|
||||
"referTo": "+15083084809",
|
||||
"referredByDisplayName": "Alice",
|
||||
"actionHook": "/action"
|
||||
},
|
||||
{
|
||||
"verb": "tag",
|
||||
"data": {
|
||||
@@ -231,10 +563,124 @@ test("validate correct verbs", async (t) => {
|
||||
"verb": "transcribe",
|
||||
"transcriptionHook": "http://example.com/transcribe",
|
||||
"recognizer": {
|
||||
"vendor": "google",
|
||||
"vendor": "nvidia",
|
||||
"language" : "en-US",
|
||||
"interim": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"verb": "transcribe",
|
||||
"transcriptionHook": "http://example.com/transcribe",
|
||||
"recognizer": {
|
||||
"vendor": "nvidia",
|
||||
"language" : "en-US",
|
||||
"interim": true,
|
||||
"elevenlabsOptions": {
|
||||
"includeTimestamps": true,
|
||||
"commitStrategy": "vad",
|
||||
"vadSilenceThresholdSecs": 0.8,
|
||||
"vadThreshold": 0.5,
|
||||
"minSpeechDurationMs": 300,
|
||||
"minSilenceDurationMs": 500,
|
||||
"enableLogging": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"verb": "transcribe",
|
||||
"transcriptionHook": "http://example.com/transcribe",
|
||||
"recognizer": {
|
||||
"vendor": "nvidia",
|
||||
"language" : "en-US",
|
||||
"customOptions": {
|
||||
"sampleRate": 16000
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"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",
|
||||
"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,
|
||||
"timeLimit" : 10
|
||||
},
|
||||
{
|
||||
"verb": "llm",
|
||||
"vendor": 'ultravox',
|
||||
"model": 'fixie-ai/ultravox',
|
||||
"auth": {
|
||||
"apiKey": "sk-1234567890abcdefg"
|
||||
},
|
||||
"llmOptions": {
|
||||
"firstSpeaker": 'FIRST_SPEAKER_AGENT',
|
||||
},
|
||||
"mcpServers": [
|
||||
{
|
||||
"url": 'https://mcp.example.com',
|
||||
"auth": {
|
||||
"username": 'username',
|
||||
"password": 'password'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"verb": "transcribe",
|
||||
"transcriptionHook": "http://example.com/transcribe",
|
||||
"recognizer": {
|
||||
"vendor": "speechmatics",
|
||||
"language": "en",
|
||||
"speechmaticsOptions": {
|
||||
"transcription_config": {
|
||||
"language": "en",
|
||||
"enable_partials": true,
|
||||
"max_delay": 2,
|
||||
"conversation_config": {
|
||||
"end_of_utterance_silence_trigger": 0.5
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
];
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user