diff --git a/lib/call-session.js b/lib/call-session.js index 2bd859e..2b04adc 100644 --- a/lib/call-session.js +++ b/lib/call-session.js @@ -246,8 +246,14 @@ class CallSession extends Emitter { } } if (!voip_carrier_sid) { - /* no LCR/ inbound carrier for this account/SP - at this point its a random shuffle of outbound carriers */ - voip_carrier_sid = await this.lookupOutboundCarrierForAccount(this.account_sid); + if(process.env.JAMBONES_OUTDIAL_TRUNK_FAILOVER==='false') { + this.logger.info(`no outbound carriers found for account_sid ${account_sid}`); + this.res.send(603); + return this.srf.endSession(this.req); + } else { + /* no LCR/ inbound carrier for this account/SP - at this point its a random shuffle of outbound carriers */ + voip_carrier_sid = await this.lookupOutboundCarrierForAccount(this.account_sid); + } } if (!voip_carrier_sid) { /* no outbound carriers exist for this account/SP */