add tag task and varioius cleanup

This commit is contained in:
Dave Horton
2020-01-29 15:27:20 -05:00
parent bed4fa1f42
commit 92acd50595
17 changed files with 278 additions and 111 deletions

View File

@@ -1,6 +1,5 @@
const CallSession = require('./call-session');
const {CallDirection, CallStatus} = require('../utils/constants');
const hooks = require('../utils/notifiers');
const {CallStatus} = require('../utils/constants');
const moment = require('moment');
const assert = require('assert');
@@ -10,17 +9,11 @@ class InboundCallSession extends CallSession {
logger: req.locals.logger,
srf: req.srf,
application: req.locals.application,
callSid: req.locals.callInfo.callSid,
callInfo: req.locals.callInfo,
tasks: req.locals.application.tasks
});
this.req = req;
this.res = res;
this.srf = req.srf;
this.logger = req.locals.logger;
this.callInfo = req.locals.callInfo;
this.direction = CallDirection.Inbound;
const {notifyHook} = hooks(this.logger, this.callInfo);
this.notifyHook = notifyHook;
req.on('cancel', this._callReleased.bind(this));