send error notification over websocket if tts fails

This commit is contained in:
Dave Horton
2022-04-21 14:33:49 -04:00
parent 698d12a95f
commit 13ea559cb1
3 changed files with 12 additions and 0 deletions

View File

@@ -137,6 +137,12 @@ class Task extends Emitter {
return this.callSession.normalizeUrl(url, method, auth);
}
notifyError(errMsg) {
const params = {error: errMsg, ...this.cs.callInfo.toJSON()};
this.cs.requestor.request('jambonz:error', '/error', params)
.catch((err) => this.logger.info({err}, 'Task:notifyError error sending error'));
}
async performAction(results, expectResponse = true) {
if (this.actionHook) {
const params = results ? Object.assign(results, this.cs.callInfo.toJSON()) : this.cs.callInfo.toJSON();