bugfix: dialed numbers less than 8 digits are allowed since a voip_carrier may handle calls that are not actually routed to the PSTN (e.g. PBX)

This commit is contained in:
Dave Horton
2021-12-21 20:18:31 -05:00
parent 8da9c4ffa1
commit 607fb3d127

View File

@@ -177,8 +177,8 @@ module.exports = (srf, logger, opts) => {
return next();
}
// if the called number is digits only (after possible leading plus sign) and long enough, do lcr
if (!/^\d+$/.test(req.calledNumber.slice(1)) || req.calledNumber.length < 8) {
// if the called number is digits only (after possible leading plus sign), do lcr
if (!/^\d+$/.test(req.calledNumber.slice(1))) {
debug(`unable to route call to ${aor}; no registered user found`);
logger.info(`unable to route call to ${aor}; no registered user found`);
return res.send(404);