mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +00:00
feat pause resume transcribe (#438)
* feat pause resume transcribe * wip * fix jslint * update fsmrf
This commit is contained in:
@@ -1075,6 +1075,24 @@ ${credential.label ? `, label: ${credential.label}` : ''} is chosen`);
|
||||
listenTask.updateListen(opts.listen_status);
|
||||
}
|
||||
|
||||
/**
|
||||
* perform live call control -- change Transcribe status
|
||||
* @param {object} opts
|
||||
* @param {string} opts.transcribe_status - 'pause' or 'resume'
|
||||
*/
|
||||
async _lccTranscribeStatus(opts) {
|
||||
const task = this.currentTask;
|
||||
if (!task || ![TaskName.Dial, TaskName.Transcribe].includes(task.name)) {
|
||||
return this.logger.info(`CallSession:_lccTranscribeStatus - invalid transcribe_status in task ${task.name}`);
|
||||
}
|
||||
const transcribeTask = task.name === TaskName.Transcribe ? task : task.transcribeTask;
|
||||
if (!transcribeTask) {
|
||||
return this.logger
|
||||
.info('CallSession:_lccTranscribeStatus - invalid transcribe_status: Dial does not have a Transcribe');
|
||||
}
|
||||
transcribeTask.updateTranscribe(opts.transcribe_status);
|
||||
}
|
||||
|
||||
async _lccMuteStatus(callSid, mute) {
|
||||
// this whole thing requires us to be in a Dial or Conference verb
|
||||
const task = this.currentTask;
|
||||
@@ -1193,6 +1211,9 @@ ${credential.label ? `, label: ${credential.label}` : ''} is chosen`);
|
||||
if (opts.listen_status) {
|
||||
await this._lccListenStatus(opts);
|
||||
}
|
||||
if (opts.transcribe_status) {
|
||||
await this._lccTranscribeStatus(opts);
|
||||
}
|
||||
else if (opts.mute_status) {
|
||||
await this._lccMuteStatus(callSid, opts.mute_status === 'mute');
|
||||
}
|
||||
@@ -1369,6 +1390,10 @@ ${credential.label ? `, label: ${credential.label}` : ''} is chosen`);
|
||||
this._lccListenStatus(data);
|
||||
break;
|
||||
|
||||
case 'transcribe:status':
|
||||
this._lccTranscribeStatus(data);
|
||||
break;
|
||||
|
||||
case 'whisper':
|
||||
this._lccWhisper(data, call_sid);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user