Block 0 as well

This commit is contained in:
Christopher Cookman 2025-10-25 10:30:19 -06:00
parent b6cf6a4484
commit c94b4bd41b

View file

@ -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
for (const [key, target] of Object.entries(forwards)) {
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}`);
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('/', ' ')}"`;