initial checkin

This commit is contained in:
Dave Horton
2020-01-07 10:34:03 -05:00
commit 523e2a308b
61 changed files with 7876 additions and 0 deletions

26
lib/tasks/dial.js Normal file
View File

@@ -0,0 +1,26 @@
const Task = require('./task');
const name = 'dial';
class TaskDial extends Task {
constructor(logger, opts) {
super(logger, opts);
this.name = name;
this.headers = this.data.headers || {};
}
static get name() { return name; }
/**
* Reject an incoming call attempt with a provided status code and (optionally) reason
*/
async exec(cs) {
if (!cs.res.finalResponseSent) {
cs.res.send(this.data.status, this.data.reason, {
headers: this.headers
});
}
return false;
}
}
module.exports = TaskDial;