mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-19 04:17:44 +00:00
* fixes from testing * modify Task#exec to take resources as an object rather than argument list * pass 2 endpoints to Transcribe when invoked in a SipRec call session * logging * change siprec invite to sendrecv just so freeswitch does not try to reinvite (TODO: block outgoing media at rtpengine) * Config: when enabling recording, block until siprec dialog is established * missed play verb in commit 031c79d * linting * bugfix: get final transcript in siprec call
27 lines
558 B
JavaScript
27 lines
558 B
JavaScript
const Task = require('./task');
|
|
const {TaskName} = require('../utils/constants');
|
|
|
|
class TaskPause extends Task {
|
|
constructor(logger, opts, parentTask) {
|
|
super(logger, opts);
|
|
|
|
this.length = this.data.length;
|
|
}
|
|
|
|
get name() { return TaskName.Pause; }
|
|
|
|
async exec(cs) {
|
|
await super.exec(cs);
|
|
this.timer = setTimeout(this.notifyTaskDone.bind(this), this.length * 1000);
|
|
await this.awaitTaskDone();
|
|
}
|
|
|
|
async kill(cs) {
|
|
super.kill(cs);
|
|
clearTimeout(this.timer);
|
|
this.notifyTaskDone();
|
|
}
|
|
}
|
|
|
|
module.exports = TaskPause;
|