Files
Dave Horton 3298918322 Feature/siprec server (#143)
* 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
2022-08-09 15:23:55 +02:00

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;