Block 0 as well
This commit is contained in:
parent
b6cf6a4484
commit
c94b4bd41b
2
index.js
2
index.js
|
|
@ -39,7 +39,7 @@ const main = async () => {
|
||||||
// Search all forwards for any target that is between 700 and 800. If it exists, log to console and run `asterisk -x "database del CF[U/B] <ext>"` to delete it
|
// Search all forwards for any target that is between 700 and 800. If it exists, log to console and run `asterisk -x "database del CF[U/B] <ext>"` to delete it
|
||||||
for (const [key, target] of Object.entries(forwards)) {
|
for (const [key, target] of Object.entries(forwards)) {
|
||||||
const targetExt = parseInt(target, 10);
|
const targetExt = parseInt(target, 10);
|
||||||
if (targetExt >= 700 && targetExt < 800) {
|
if ((targetExt >= 700 && targetExt < 800) || targetExt === 0) { // Also block forwards to 0 (operator line)
|
||||||
console.log(`Deleting forward ${key} to target ${target}`);
|
console.log(`Deleting forward ${key} to target ${target}`);
|
||||||
await hook.send(`Fuckass with extension ${key.split('/')[1]} tried to forward to ${target}. Forward has been deleted.`);
|
await hook.send(`Fuckass with extension ${key.split('/')[1]} tried to forward to ${target}. Forward has been deleted.`);
|
||||||
const delCommand = `asterisk -x "database del ${key.replace('/', ' ')}"`;
|
const delCommand = `asterisk -x "database del ${key.replace('/', ' ')}"`;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue