mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2026-02-13 09:49:30 +00:00
bugfix: gather catch errors when webhook fails
This commit is contained in:
@@ -462,27 +462,29 @@ class TaskGather extends Task {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reason.startsWith('dtmf')) {
|
try {
|
||||||
if (this.parentTask) this.parentTask.emit('dtmf', evt);
|
if (reason.startsWith('dtmf')) {
|
||||||
else {
|
if (this.parentTask) this.parentTask.emit('dtmf', evt);
|
||||||
this.emit('dtmf', evt);
|
else {
|
||||||
await this.performAction({digits: this.digitBuffer, reason: 'dtmfDetected'});
|
this.emit('dtmf', evt);
|
||||||
|
await this.performAction({digits: this.digitBuffer, reason: 'dtmfDetected'});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
else if (reason.startsWith('speech')) {
|
||||||
else if (reason.startsWith('speech')) {
|
if (this.parentTask) this.parentTask.emit('transcription', evt);
|
||||||
if (this.parentTask) this.parentTask.emit('transcription', evt);
|
else {
|
||||||
else {
|
this.emit('transcription', evt);
|
||||||
this.emit('transcription', evt);
|
await this.performAction({speech: evt, reason: 'speechDetected'});
|
||||||
await this.performAction({speech: evt, reason: 'speechDetected'});
|
}
|
||||||
}
|
}
|
||||||
}
|
else if (reason.startsWith('timeout')) {
|
||||||
else if (reason.startsWith('timeout')) {
|
if (this.parentTask) this.parentTask.emit('timeout', evt);
|
||||||
if (this.parentTask) this.parentTask.emit('timeout', evt);
|
else {
|
||||||
else {
|
this.emit('timeout', evt);
|
||||||
this.emit('timeout', evt);
|
await this.performAction({reason: 'timeout'});
|
||||||
await this.performAction({reason: 'timeout'});
|
}
|
||||||
}
|
}
|
||||||
}
|
} catch (err) { /*already logged error*/ }
|
||||||
this.notifyTaskDone();
|
this.notifyTaskDone();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user