* don't try and guess carrier if LCR is set

* lint

* update dbHelpers dep
This commit is contained in:
Sam Machin
2025-09-06 19:15:16 +01:00
committed by GitHub
parent 28ff85225f
commit a05b72a420
5 changed files with 2288 additions and 3143 deletions

View File

@@ -641,7 +641,9 @@ class TaskDial extends Task {
* trunk isn't specified,
* check if number matches any existing numbers
* */
if (t.type === 'phone' && !t.trunk) {
const { lookupLcrByAccount} = srf.locals.dbHelpers;
const lcrs = await lookupLcrByAccount(cs.accountSid);
if (t.type === 'phone' && !t.trunk && lcrs.length == 0) {
const str = this.callerId || req.callingNumber || '';
const callingNumber = str.startsWith('+') ? str.substring(1) : str;
const voip_carrier_sid = await lookupCarrierByPhoneNumber(cs.accountSid, callingNumber);