diff --git a/index.js b/index.js index 562c05d..7148e84 100644 --- a/index.js +++ b/index.js @@ -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}`);