mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-21 17:17:58 +00:00
feat: lcr
This commit is contained in:
@@ -91,8 +91,13 @@ router.post('/', async(req, res) => {
|
||||
* check if from-number matches any existing numbers on Jambonz
|
||||
* */
|
||||
if (target.type === 'phone' && !target.trunk) {
|
||||
const {lookupCarrierByPhoneNumber} = dbUtils(this.logger, srf);
|
||||
const voip_carrier_sid = await lookupCarrierByPhoneNumber(req.body.account_sid, restDial.from);
|
||||
const {lookupCarrierByPhoneNumber, lookupCarrierByLcr} = dbUtils(this.logger, srf);
|
||||
// firstly LCR
|
||||
let voip_carrier_sid = await lookupCarrierByLcr(req.body.account_sid, to);
|
||||
if (!voip_carrier_sid) {
|
||||
// later by phone
|
||||
voip_carrier_sid = await lookupCarrierByPhoneNumber(req.body.account_sid, restDial.from);
|
||||
}
|
||||
logger.info(
|
||||
`createCall: selected ${voip_carrier_sid} for requested phone number: ${restDial.from || 'unspecified'})`);
|
||||
if (voip_carrier_sid) {
|
||||
|
||||
Reference in New Issue
Block a user