mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +00:00
Fix/dial unhandled rejection (#1239)
* fix bug with race condition in dial which could spike cpu due to unhandled exception * update to 0.2.12 speech-utils with azure ssml fix * minor
This commit is contained in:
@@ -271,7 +271,12 @@ class TaskDial extends Task {
|
||||
}
|
||||
this._removeDtmfDetection(cs.dlg);
|
||||
this._removeDtmfDetection(this.dlg);
|
||||
await this._killOutdials();
|
||||
try {
|
||||
await this._killOutdials();
|
||||
}
|
||||
catch (err) {
|
||||
this.logger.info({err}, 'Dial:kill - error killing outdials');
|
||||
}
|
||||
if (this.sd) {
|
||||
const byeReasonHeader = this.killReason === KillReason.MediaTimeout ? 'Media Timeout' : undefined;
|
||||
this.sd.kill(byeReasonHeader);
|
||||
@@ -281,13 +286,22 @@ class TaskDial extends Task {
|
||||
}
|
||||
if (this.callSid) sessionTracker.remove(this.callSid);
|
||||
if (this.listenTask) {
|
||||
await this.listenTask.kill(cs);
|
||||
this.listenTask.span.end();
|
||||
try {
|
||||
await this.listenTask.kill(cs);
|
||||
this.listenTask?.span?.end();
|
||||
}
|
||||
catch (err) {
|
||||
this.logger.error({err}, 'Dial:kill - error killing listen task');
|
||||
}
|
||||
this.listenTask = null;
|
||||
}
|
||||
if (this.transcribeTask) {
|
||||
await this.transcribeTask.kill(cs);
|
||||
this.transcribeTask.span.end();
|
||||
try {
|
||||
await this.transcribeTask.kill(cs);
|
||||
this.transcribeTask?.span?.end();
|
||||
} catch (err) {
|
||||
this.logger.error({err}, 'Dial:kill - error killing transcribe task');
|
||||
}
|
||||
this.transcribeTask = null;
|
||||
}
|
||||
this.notifyTaskDone();
|
||||
|
||||
Reference in New Issue
Block a user