add reason property to gather action

This commit is contained in:
Dave Horton
2021-02-23 08:10:31 -05:00
parent 70e4e10a70
commit c6168ce994
3 changed files with 38 additions and 63 deletions

View File

@@ -201,10 +201,13 @@ class TaskGather extends Task {
this._clearTimer(); this._clearTimer();
if (reason.startsWith('dtmf')) { if (reason.startsWith('dtmf')) {
await this.performAction({digits: this.digitBuffer}); await this.performAction({reason: 'dtmfDetected', digits: this.digitBuffer});
} }
else if (reason.startsWith('speech')) { else if (reason.startsWith('speech')) {
await this.performAction({speech: evt}); await this.performAction({reason: 'speechDetected', speech: evt});
}
else if (reason.startsWith('timeout')) {
await this.performAction({reason: 'inputTimeout'});
} }
this.notifyTaskDone(); this.notifyTaskDone();
} }

86
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{ {
"name": "jambonz-feature-server", "name": "jambonz-feature-server",
"version": "0.2.6", "version": "0.3.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@@ -640,9 +640,9 @@
} }
}, },
"aws-sdk": { "aws-sdk": {
"version": "2.846.0", "version": "2.848.0",
"resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.846.0.tgz", "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.848.0.tgz",
"integrity": "sha512-r/VUmo7Ri4yxVonFARzb9reZgcURbddfKur5HlAG55Xd4ku3u7akMe/rZYFuhQbUTef6p6J19oUg/W+fnEY2Tw==", "integrity": "sha512-c/e5kaEFl+9aYkrYDkmu5mSZlL+EfP6DnBOMD06fH12gIsaFSMBGtbsDTHABhvSu++LxeI1dJAD148O17MuZvg==",
"requires": { "requires": {
"buffer": "4.9.2", "buffer": "4.9.2",
"events": "1.1.1", "events": "1.1.1",
@@ -1215,16 +1215,16 @@
"integrity": "sha1-ED01J/0xUo9AGIEwyEHv3XgmTlw=" "integrity": "sha1-ED01J/0xUo9AGIEwyEHv3XgmTlw="
}, },
"drachtio-fsmrf": { "drachtio-fsmrf": {
"version": "2.0.5", "version": "2.0.7",
"resolved": "https://registry.npmjs.org/drachtio-fsmrf/-/drachtio-fsmrf-2.0.5.tgz", "resolved": "https://registry.npmjs.org/drachtio-fsmrf/-/drachtio-fsmrf-2.0.7.tgz",
"integrity": "sha512-4LcNOILnvppoJFIk/CMcK1X3dPyNJuOmT1jxde701fxHd6Ybk5ohVACBpStW+RBzmRKZxkxkycEHnDUAG27MWg==", "integrity": "sha512-jI6Cfho5OZGfp2OpCtOW0aFtklf4JfG55lsqyMiJmaWcKlfIgcvH79FHhG9osQ2ur7ygxH8V2bo6Fsi02LxzHw==",
"requires": { "requires": {
"async": "^1.4.2", "async": "^1.4.2",
"debug": "^2.2.0", "debug": "^2.2.0",
"delegates": "^0.1.0", "delegates": "^0.1.0",
"drachtio-modesl": "^1.2.0", "drachtio-modesl": "^1.2.0",
"drachtio-srf": "^4.4.47", "drachtio-srf": "^4.4.47",
"lodash": "^4.17.20", "lodash": "^4.17.21",
"minimist": "^1.2.5", "minimist": "^1.2.5",
"only": "0.0.2", "only": "0.0.2",
"sdp-transform": "^2.14.0", "sdp-transform": "^2.14.0",
@@ -1244,39 +1244,10 @@
"ms": "2.0.0" "ms": "2.0.0"
} }
}, },
"drachtio-srf": { "lodash": {
"version": "4.4.47", "version": "4.17.21",
"resolved": "https://registry.npmjs.org/drachtio-srf/-/drachtio-srf-4.4.47.tgz", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-dpbutyaRWj0llqRShkd02nsaLj0dlSaKJhG6IzxeLQSiyY6h5/vtqEDaw/uft/sSqwrMWwu+6SlkutKjb5ei0A==", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
"requires": {
"async": "^1.4.2",
"debug": "^3.2.7",
"delegates": "^0.1.0",
"deprecate": "^1.1.1",
"drachtio-sip": "^0.5.2",
"node-noop": "0.0.1",
"only": "0.0.2",
"sdp-transform": "^2.14.1",
"short-uuid": "^4.1.0",
"sip-methods": "^0.3.0",
"utils-merge": "1.0.0",
"uuid": "^3.4.0"
},
"dependencies": {
"debug": {
"version": "3.2.7",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
"requires": {
"ms": "^2.1.1"
}
},
"ms": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
}
}
}, },
"ms": { "ms": {
"version": "2.0.0", "version": "2.0.0",
@@ -2437,14 +2408,14 @@
} }
}, },
"is-typed-array": { "is-typed-array": {
"version": "1.1.4", "version": "1.1.5",
"resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.4.tgz", "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.5.tgz",
"integrity": "sha512-ILaRgn4zaSrVNXNGtON6iFNotXW3hAPF3+0fB1usg2jFlWqo5fEDdmJkz0zBfoi7Dgskr8Khi2xZ8cXqZEfXNA==", "integrity": "sha512-S+GRDgJlR3PyEbsX/Fobd9cqpZBuvUS+8asRqYDMLCb2qMzt1oz5m5oxQCxOgUDxiWsOVNi4yaF+/uvdlHlYug==",
"dev": true, "dev": true,
"requires": { "requires": {
"available-typed-arrays": "^1.0.2", "available-typed-arrays": "^1.0.2",
"call-bind": "^1.0.0", "call-bind": "^1.0.2",
"es-abstract": "^1.18.0-next.1", "es-abstract": "^1.18.0-next.2",
"foreach": "^2.0.5", "foreach": "^2.0.5",
"has-symbols": "^1.0.1" "has-symbols": "^1.0.1"
} }
@@ -2713,7 +2684,8 @@
"lodash": { "lodash": {
"version": "4.17.20", "version": "4.17.20",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
"integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==",
"dev": true
}, },
"lodash.camelcase": { "lodash.camelcase": {
"version": "4.3.0", "version": "4.3.0",
@@ -3921,12 +3893,12 @@
} }
}, },
"tape": { "tape": {
"version": "5.1.1", "version": "5.2.0",
"resolved": "https://registry.npmjs.org/tape/-/tape-5.1.1.tgz", "resolved": "https://registry.npmjs.org/tape/-/tape-5.2.0.tgz",
"integrity": "sha512-ujhT+ZJPqSGY9Le02mIGBnyWo7Ks05FEGS9PnlqECr3sM3KyV4CSCXAvSBJKMN+t+aZYLKEFUEo0l4wFJMhppQ==", "integrity": "sha512-J7stlwNrBEpHlZvbvPEAFvMmqIy79kMYvXiyekl5w6O7C2HF63bFKi8su70mdUtZZvNMm7EbIzLyI+fk6U9Ntg==",
"dev": true, "dev": true,
"requires": { "requires": {
"call-bind": "^1.0.0", "call-bind": "^1.0.2",
"deep-equal": "^2.0.5", "deep-equal": "^2.0.5",
"defined": "^1.0.0", "defined": "^1.0.0",
"dotignore": "^0.1.2", "dotignore": "^0.1.2",
@@ -3934,24 +3906,24 @@
"glob": "^7.1.6", "glob": "^7.1.6",
"has": "^1.0.3", "has": "^1.0.3",
"inherits": "^2.0.4", "inherits": "^2.0.4",
"is-regex": "^1.1.1", "is-regex": "^1.1.2",
"minimist": "^1.2.5", "minimist": "^1.2.5",
"object-inspect": "^1.9.0", "object-inspect": "^1.9.0",
"object-is": "^1.1.4", "object-is": "^1.1.4",
"object.assign": "^4.1.2", "object.assign": "^4.1.2",
"resolve": "^1.19.0", "resolve": "^2.0.0-next.3",
"resumer": "^0.0.0", "resumer": "^0.0.0",
"string.prototype.trim": "^1.2.3", "string.prototype.trim": "^1.2.3",
"through": "^2.3.8" "through": "^2.3.8"
}, },
"dependencies": { "dependencies": {
"resolve": { "resolve": {
"version": "1.19.0", "version": "2.0.0-next.3",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz",
"integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==",
"dev": true, "dev": true,
"requires": { "requires": {
"is-core-module": "^2.1.0", "is-core-module": "^2.2.0",
"path-parse": "^1.0.6" "path-parse": "^1.0.6"
} }
} }

View File

@@ -1,6 +1,6 @@
{ {
"name": "jambonz-feature-server", "name": "jambonz-feature-server",
"version": "0.2.6", "version": "0.3.0",
"main": "app.js", "main": "app.js",
"engines": { "engines": {
"node": ">= 10.16.0" "node": ">= 10.16.0"
@@ -30,12 +30,12 @@
"@jambonz/mw-registrar": "^0.1.9", "@jambonz/mw-registrar": "^0.1.9",
"@jambonz/realtimedb-helpers": "^0.4.0", "@jambonz/realtimedb-helpers": "^0.4.0",
"@jambonz/stats-collector": "^0.1.5", "@jambonz/stats-collector": "^0.1.5",
"aws-sdk": "^2.846.0", "aws-sdk": "^2.848.0",
"bent": "^7.3.12", "bent": "^7.3.12",
"cidr-matcher": "^2.1.1", "cidr-matcher": "^2.1.1",
"debug": "^4.3.1", "debug": "^4.3.1",
"deepcopy": "^2.1.0", "deepcopy": "^2.1.0",
"drachtio-fsmrf": "^2.0.5", "drachtio-fsmrf": "^2.0.7",
"drachtio-srf": "^4.4.47", "drachtio-srf": "^4.4.47",
"express": "^4.17.1", "express": "^4.17.1",
"ip": "^1.1.5", "ip": "^1.1.5",
@@ -54,6 +54,6 @@
"eslint-plugin-promise": "^4.3.1", "eslint-plugin-promise": "^4.3.1",
"nyc": "^15.1.0", "nyc": "^15.1.0",
"tap-spec": "^5.0.0", "tap-spec": "^5.0.0",
"tape": "^5.1.1" "tape": "^5.2.0"
} }
} }