Fix that lol
This commit is contained in:
parent
4ea9f473ed
commit
80be7f6723
6
index.js
6
index.js
|
@ -532,7 +532,8 @@ app.get('/api/v1/route/:apiKey/:ani/:number', (req, res) => {
|
||||||
} else if (row) {
|
} else if (row) {
|
||||||
// Check if the ANI is within the block range
|
// Check if the ANI is within the block range
|
||||||
// If it is, return `local`
|
// 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');
|
res.status(200).send('local');
|
||||||
} else {
|
} else {
|
||||||
res.status(200).send(`IAX2/${row.auth}:${row.secret}@${row.server}:${row.port}/${number}`);
|
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) {
|
} else if (row) {
|
||||||
// Check if the ANI is within the block range
|
// Check if the ANI is within the block range
|
||||||
// If it is, return `local`
|
// 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');
|
res.status(200).send('local');
|
||||||
} else {
|
} else {
|
||||||
res.status(200).send(`IAX2/${row.auth}:${row.secret}@${row.server}:${row.port}/${number}`);
|
res.status(200).send(`IAX2/${row.auth}:${row.secret}@${row.server}:${row.port}/${number}`);
|
||||||
|
|
Loading…
Reference in a new issue