From d473031bdcd27bd7f04413fbf9158cda0e937dd1 Mon Sep 17 00:00:00 2001 From: Quan HL Date: Wed, 2 Oct 2024 14:33:29 +0700 Subject: [PATCH] wip --- lib/session/call-session.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/lib/session/call-session.js b/lib/session/call-session.js index 168d9d8e..18cf7f51 100644 --- a/lib/session/call-session.js +++ b/lib/session/call-session.js @@ -1338,9 +1338,9 @@ class CallSession extends Emitter { listenTask.updateListen(opts.listen_status); } - // Jambonz only update transcribe task when receive RE-INVITE: - // 1. Pause transcribe task if it's running and hold RE-INVITE is received - // 2. Resume transcribe task if it was paused by jambonz due to hold and unhold RE-INVITE is received + // Jambonz only update transcribe task when it's received RE-INVITE: + // 1. Pause transcribe task if the task is running and hold RE-INVITE is received + // 2. Resume transcribe task if the task was paused by jambonz due to hold and unhold RE-INVITE is received async pauseOrResumeTranscribeTaskByReInvite(req) { const task = this.currentTask; const transcribeTasks = []; @@ -2278,12 +2278,7 @@ Duration=${duration} ` res.send(488); } - // if there - const opts = { - transcribe_status: isOnhold(req.body) ? TranscribeStatus.Pause : TranscribeStatus.Resume - }; - this.logger.info('Transcribe is'); - this._lccTranscribeStatus(opts); + await this.pauseOrResumeTranscribeTaskByReInvite(req); } catch (err) { this.logger.error(err, 'Error handling reinvite'); }