major refactoring

This commit is contained in:
Dave Horton
2020-01-25 11:47:33 -05:00
parent 621ea8c0f5
commit 4a1ea4e091
25 changed files with 947 additions and 933 deletions

View File

@@ -1,6 +1,9 @@
const Task = require('./task');
const {TaskName, TaskPreconditions} = require('../utils/constants');
/**
* Rejects an incoming call with user-specified status code and reason
*/
class TaskSipDecline extends Task {
constructor(logger, opts) {
super(logger, opts);
@@ -11,10 +14,8 @@ class TaskSipDecline extends Task {
get name() { return TaskName.SipDecline; }
/**
* Reject an incoming call attempt with a provided status code and (optionally) reason
*/
async exec(cs, {res}) {
super.exec(cs);
res.send(this.data.status, this.data.reason, {
headers: this.headers
});