mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-19 04:17:44 +00:00
Fix/1345 (#1349)
* don't try and guess carrier if LCR is set * lint * update dbHelpers dep
This commit is contained in:
@@ -147,7 +147,7 @@ router.post('/',
|
||||
|
||||
// find handling sbc sip for called user
|
||||
if (JAMBONES_DIAL_SBC_FOR_REGISTERED_USER && target.type === 'user') {
|
||||
const { registrar } = srf.locals.dbHelpers;
|
||||
const { registrar} = srf.locals.dbHelpers;
|
||||
const reg = await registrar.query(target.name);
|
||||
if (reg) {
|
||||
sbcAddress = selectHostPort(logger, reg.sbcAddress, 'tcp')[1];
|
||||
@@ -159,7 +159,9 @@ router.post('/',
|
||||
* trunk isn't specified,
|
||||
* check if from-number matches any existing numbers on Jambonz
|
||||
* */
|
||||
if (target.type === 'phone' && !target.trunk) {
|
||||
const { lookupLcrByAccount} = srf.locals.dbHelpers;
|
||||
const lcrs = await lookupLcrByAccount(req.body.account_sid);
|
||||
if (target.type === 'phone' && !target.trunk && lcrs.length == 0) {
|
||||
const str = restDial.from || '';
|
||||
const callingNumber = str.startsWith('+') ? str.substring(1) : str;
|
||||
const voip_carrier_sid = await lookupCarrierByPhoneNumber(req.body.account_sid, callingNumber);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -173,7 +173,8 @@ function installSrfLocals(srf, logger, {
|
||||
lookupAccountCapacitiesBySid,
|
||||
lookupSmppGateways,
|
||||
lookupClientByAccountAndUsername,
|
||||
lookupSystemInformation
|
||||
lookupSystemInformation,
|
||||
lookupLcrByAccount
|
||||
} = require('@jambonz/db-helpers')({
|
||||
host: JAMBONES_MYSQL_HOST,
|
||||
user: JAMBONES_MYSQL_USER,
|
||||
@@ -279,7 +280,8 @@ function installSrfLocals(srf, logger, {
|
||||
retrieveByPatternSortedSet,
|
||||
sortedSetLength,
|
||||
sortedSetPositionByPattern,
|
||||
getVerbioAccessToken
|
||||
getVerbioAccessToken,
|
||||
lookupLcrByAccount
|
||||
},
|
||||
parentLogger: logger,
|
||||
getSBC,
|
||||
|
||||
Reference in New Issue
Block a user