mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
work on say and gather
This commit is contained in:
24
lib/tasks/hangup.js
Normal file
24
lib/tasks/hangup.js
Normal file
@@ -0,0 +1,24 @@
|
||||
const Task = require('./task');
|
||||
const {TaskName} = require('../utils/constants');
|
||||
|
||||
class TaskHangup extends Task {
|
||||
constructor(logger, opts) {
|
||||
super(logger, opts);
|
||||
this.headers = this.data.headers || {};
|
||||
}
|
||||
|
||||
get name() { return TaskName.Hangup; }
|
||||
|
||||
/**
|
||||
* Hangup the call
|
||||
*/
|
||||
async exec(cs, dlg) {
|
||||
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}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = TaskHangup;
|
||||
Reference in New Issue
Block a user