Skip to content

Commit

Permalink
Added a environment variable JAMBONES_OUTDIAL_TRUNK_FAILOVER to disab…
Browse files Browse the repository at this point in the history
…le random trunk selection
  • Loading branch information
Megamuch committed Oct 10, 2023
1 parent f7bd1f2 commit 1a6747b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/call-session.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,14 @@ class CallSession extends Emitter {
/* was a specific carrier requested */
let voip_carrier_sid = this.req.get('X-Requested-Carrier-Sid');
const account_sid = this.req.get('X-Account-Sid');
this.logger.info(`carrier requested ${voip_carrier_sid}`);
if (!voip_carrier_sid) {
if(process.env.JAMBONES_OUTDIAL_TRUNK_FAILOVER==='false') {

Check failure on line 234 in lib/call-session.js

View workflow job for this annotation

GitHub Actions / build

Expected space(s) after "if"

Check failure on line 234 in lib/call-session.js

View workflow job for this annotation

GitHub Actions / build

Operator '===' must be spaced
this.logger.info(`no outbound carriers found for account_sid ${account_sid}`);
this.res.send(603);
return this.srf.endSession(this.req);
}
}
if (!voip_carrier_sid && account_sid) {
/* search for an LCR table for this account or service provider */
voip_carrier_sid = await this.lookupCarrierByAccountLcr(account_sid, this.req.calledNumber);
Expand All @@ -247,7 +255,7 @@ 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);
voip_carrier_sid = await this.lookupOutboundCarrierForAccount(this.account_sid);

Check failure on line 258 in lib/call-session.js

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 12 spaces but found 14
}
if (!voip_carrier_sid) {
/* no outbound carriers exist for this account/SP */
Expand Down

0 comments on commit 1a6747b

Please sign in to comment.