Compare commits

..

No commits in common. "952aaced2bf57d8b3df7aecb9290ee6f7226da92" and "1a430e1b4a682b13bd586483af0e5f80b3b07458" have entirely different histories.

View file

@ -33,25 +33,10 @@ 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) {
console.log(`Deleting forward ${key} to target ${target}`);
const delCommand = `asterisk -x "database del ${key.replace('/', ' ')}"`;
const { error, stdout, stderr } = await runAsterisk(delCommand);
if (error) {
console.error(`Error executing command "${delCommand}": ${error}`);
} else {
console.log(`Successfully deleted forward ${key}`);
}
}
}
console.log("Call forwards:", forwards);
} catch (err) {
console.error(`Unexpected error: ${err}`);
}
setTimeout(main, 3000); // Run every 60 seconds
};
const startup = async () => {