Add debug

This commit is contained in:
Christopher Cookman 2026-07-03 14:07:02 -06:00
parent 7cb2bcad3a
commit 7d9d26c14d

View file

@ -223,6 +223,12 @@ class FreepbxManager {
const existingExtsSet = new Set(exts.map(ext => parseInt(ext.user.extension, 10)));
const existingExts = Array.from(existingExtsSet).sort((a, b) => a - b);
if (process.env.DEBUG == true) {
console.log(`Existing extensions: ${existingExts.join(', ')}`);
console.log(`Starting extension: ${startExt}`);
console.log(`Next available extension: ${this.findNextAvailableExtension(existingExts, startExt)}`);
}
let nextExt = startExt;
for (let i = 0; i < existingExts.length; i++) {
if (existingExts[i] !== nextExt) {