wip: implemented listen, transcribe, play

This commit is contained in:
Dave Horton
2020-01-17 09:15:23 -05:00
parent 1a656f3f0e
commit 0d4c1d9d8c
24 changed files with 688 additions and 108 deletions

View File

@@ -1,10 +1,12 @@
const Task = require('./task');
const {TaskName} = require('../utils/constants');
const {TaskName, TaskPreconditions} = require('../utils/constants');
class TaskHangup extends Task {
constructor(logger, opts) {
super(logger, opts);
this.headers = this.data.headers || {};
this.preconditions = TaskPreconditions.StableCall;
}
get name() { return TaskName.Hangup; }
@@ -16,7 +18,7 @@ class TaskHangup extends Task {
try {
await dlg.destroy({headers: this.headers});
} catch (err) {
this.logger.error(err, `TaskHangup:exec - Error hanging up call with sip call id ${dlg.sip.callId}`);
this.logger.error(err, 'TaskHangup:exec - Error hanging up call');
}
}
}