mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +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
28 lines
616 B
JavaScript
28 lines
616 B
JavaScript
const Task = require('./task');
|
|
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; }
|
|
|
|
/**
|
|
* Hangup the call
|
|
*/
|
|
async exec(cs, {dlg}) {
|
|
await super.exec(cs);
|
|
try {
|
|
await dlg.destroy({headers: this.headers});
|
|
} catch (err) {
|
|
this.logger.error(err, 'TaskHangup:exec - Error hanging up call');
|
|
}
|
|
}
|
|
}
|
|
|
|
module.exports = TaskHangup;
|