-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a environment variable JAMBONES_OUTDIAL_TRUNK_FAILOVER to disab… #108
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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') { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. instead of returning a 603 response when the JAMBONES_OUTDIAL_TRUNK_FAILOVER env variable is false. You might want to invert the if and follow the default behaviour if JAMBONES_OUTDIAL_TRUNK_FAILOVER is undefined or true. This way if the variable is set to false it will just skip the lookupOutboundCarrierForAccount method and continue to the next step which will return the 603 response. |
||
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); | ||
|
@@ -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); | ||
} | ||
if (!voip_carrier_sid) { | ||
/* no outbound carriers exist for this account/SP */ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this info log was used for debugging and can be removed