Files
jambonz-feature-server/lib/tasks/hangup.js
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

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;