mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
remove config in favor of env vars, other major changes
This commit is contained in:
@@ -5,7 +5,6 @@ const assert = require('assert');
|
||||
const placeCall = require('../utils/place-outdial');
|
||||
const sessionTracker = require('../session/session-tracker');
|
||||
const DtmfCollector = require('../utils/dtmf-collector');
|
||||
const config = require('config');
|
||||
const debug = require('debug')('jambonz:feature-server');
|
||||
|
||||
function parseDtmfOptions(logger, dtmfCapture) {
|
||||
@@ -129,11 +128,11 @@ class TaskDial extends Task {
|
||||
this._installDtmfDetection(cs, this.epOther, this.parentDtmfCollector);
|
||||
await this._attemptCalls(cs);
|
||||
await this.awaitTaskDone();
|
||||
await cs.requestor.request(this.actionHook, Object.assign({}, cs.callInfo, this.results));
|
||||
await this.performAction(Object.assign({}, cs.callInfo, this.results));
|
||||
this._removeDtmfDetection(cs, this.epOther);
|
||||
this._removeDtmfDetection(cs, this.ep);
|
||||
} catch (err) {
|
||||
this.logger.error(`TaskDial:exec terminating with error ${err.message}`);
|
||||
this.logger.error({err}, 'TaskDial:exec terminating with error');
|
||||
this.kill();
|
||||
}
|
||||
}
|
||||
@@ -147,7 +146,7 @@ class TaskDial extends Task {
|
||||
this.sd.kill();
|
||||
this.sd = null;
|
||||
}
|
||||
sessionTracker.remove(this.callSid);
|
||||
if (this.callSid) sessionTracker.remove(this.callSid);
|
||||
if (this.listenTask) await this.listenTask.kill();
|
||||
if (this.transcribeTask) await this.transcribeTask.kill();
|
||||
if (this.timerMaxCallDuration) clearTimeout(this.timerMaxCallDuration);
|
||||
@@ -242,7 +241,7 @@ class TaskDial extends Task {
|
||||
|
||||
const sbcAddress = cs.direction === CallDirection.Inbound ?
|
||||
`${req.source_address}:${req.source_port}` :
|
||||
config.get('outdials.sbc');
|
||||
srf.locals.sbcs[0];
|
||||
const opts = {
|
||||
headers: req && req.has('X-CID') ? Object.assign(this.headers, {'X-CID': req.get('X-CID')}) : this.headers,
|
||||
proxy: `sip:${sbcAddress}`,
|
||||
|
||||
Reference in New Issue
Block a user