Fix that lol

This commit is contained in:
Christopher Cookman 2024-12-15 11:17:59 -07:00
parent 4ea9f473ed
commit 80be7f6723

View file

@ -532,7 +532,8 @@ app.get('/api/v1/route/:apiKey/:ani/:number', (req, res) => {
} else if (row) {
// Check if the ANI is within the block range
// If it is, return `local`
if (req.params.ani >= row.block_start && req.params.ani <= row.block_start + row.block_length) {
console.log(`New Call: ${ani} -> ${number}`);
if (ani >= row.block_start && ani <= row.block_start + row.block_length) {
res.status(200).send('local');
} else {
res.status(200).send(`IAX2/${row.auth}:${row.secret}@${row.server}:${row.port}/${number}`);
@ -562,7 +563,8 @@ app.get('/api/v1', (req, res) => { // Backwards compatibility with TandmX cause
} else if (row) {
// Check if the ANI is within the block range
// If it is, return `local`
if (req.params.ani >= row.block_start && req.params.ani <= row.block_start + row.block_length) {
console.log(`New Call: ${ani} -> ${number}`);
if (ani >= row.block_start && ani <= row.block_start + row.block_length) {
res.status(200).send('local');
} else {
res.status(200).send(`IAX2/${row.auth}:${row.secret}@${row.server}:${row.port}/${number}`);