mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2026-03-21 18:57:53 +00:00
Update gather.js (#1526)
This commit is contained in:
@@ -1424,7 +1424,26 @@ class TaskGather extends SttTask {
|
||||
returnedVerbs = await this.performAction({speech:evt, reason: 'stt-low-confidence', ...latencies});
|
||||
}
|
||||
}
|
||||
} catch (err) { /*already logged error*/ }
|
||||
} catch (err) {
|
||||
this.logger.info({err}, 'TaskGather:_resolve - error performing action');
|
||||
this.notifyError({msg: 'invalid actionHook response', details: err.message});
|
||||
const {writeAlerts, AlertType} = this.cs.srf.locals;
|
||||
writeAlerts({
|
||||
account_sid: this.cs.accountSid,
|
||||
alert_type: AlertType.INVALID_APP_PAYLOAD,
|
||||
target_sid: this.cs.callSid,
|
||||
message: `actionHook returned invalid verb syntax: ${err.message}`
|
||||
}).catch((err) => this.logger.info({err}, 'TaskGather:_resolve - error generating alert'));
|
||||
try {
|
||||
const obj = Object.assign({}, this.cs.callInfo.toJSON(), {
|
||||
error: 'invalid actionHook response',
|
||||
reason: err.message
|
||||
});
|
||||
await this.cs.notifier.request('call:status', this.cs.call_status_hook, obj);
|
||||
} catch (statusErr) {
|
||||
this.logger.info({statusErr}, 'TaskGather:_resolve - error sending statusHook');
|
||||
}
|
||||
}
|
||||
|
||||
// Gather got response from hook, cancel actionHookDelay processing
|
||||
if (this.cs.actionHookDelayProcessor) {
|
||||
|
||||
Reference in New Issue
Block a user