allow proxy in dial verb

This commit is contained in:
Dave Horton
2020-07-24 15:33:06 -04:00
parent 3624b05eb6
commit 884e63e0ef
3 changed files with 10 additions and 3 deletions

View File

@@ -83,6 +83,7 @@ class TaskDial extends Task {
this.confirmHook = this.data.confirmHook;
this.confirmMethod = this.data.confirmMethod;
this.dtmfHook = this.data.dtmfHook;
this.proxy = this.data.proxy;
if (this.dtmfHook) {
const {parentDtmfCollector, childDtmfCollector} = parseDtmfOptions(logger, this.data.dtmfCapture || {});
@@ -245,7 +246,7 @@ class TaskDial extends Task {
const {req, srf} = cs;
const {getSBC} = srf.locals;
const {lookupTeamsByAccount} = srf.locals.dbHelpers;
const sbcAddress = getSBC();
const sbcAddress = this.proxy || getSBC();
const teamsInfo = {};
if (!sbcAddress) throw new Error('no SBC found for outbound call');