mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +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);
|
||||
|
||||
Reference in New Issue
Block a user