feat: lcr

This commit is contained in:
Quan HL
2023-04-24 21:40:19 +07:00
parent 6dc019e836
commit 2e3d783dee
3 changed files with 41 additions and 6 deletions

View File

@@ -399,7 +399,7 @@ class TaskDial extends Task {
const {req, srf} = cs;
const {getSBC} = srf.locals;
const {lookupTeamsByAccount, lookupAccountBySid} = srf.locals.dbHelpers;
const {lookupCarrier, lookupCarrierByPhoneNumber} = dbUtils(this.logger, cs.srf);
const {lookupCarrier, lookupCarrierByPhoneNumber, lookupCarrierByLcr} = dbUtils(this.logger, cs.srf);
const sbcAddress = this.proxy || getSBC();
const teamsInfo = {};
let fqdn;
@@ -467,10 +467,10 @@ class TaskDial extends Task {
/**
* trunk isn't specified,
* check if number matches any existing numbers
* check if number matches any LCR routes
* */
if (t.type === 'phone' && !t.trunk) {
const voip_carrier_sid = await lookupCarrierByPhoneNumber(req.body.account_sid, t.number);
const voip_carrier_sid = lookupCarrierByLcr(req.body.account_sid, t.number);
this.logger.info(
`Dial:_attemptCalls: selected ${voip_carrier_sid} for requested phone number: ${t.number})`);
if (voip_carrier_sid) {