Add more logs
This commit is contained in:
parent
9e4f8f6f73
commit
bf6ed36211
|
|
@ -226,16 +226,20 @@ class FreepbxManager {
|
|||
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)}`);
|
||||
// console.log(`Next available extension: ${this.findNextAvailableExtension(existingExts, startExt)}`);
|
||||
}
|
||||
|
||||
let nextExt = startExt;
|
||||
for (let i = 0; i < existingExts.length; i++) {
|
||||
if (process.env.DEBUG == 'true') console.log(`Finding next, cur is ${nextExt}`)
|
||||
if (existingExts[i] !== nextExt) {
|
||||
if (process.env.DEBUG == 'true') console.log(`Found gap at ${nextExt}`)
|
||||
break;
|
||||
}
|
||||
if (process.env.DEBUG == 'true') console.log(`No gap, incrementing nextExt`)
|
||||
nextExt++;
|
||||
}
|
||||
if (process.env.DEBUG == 'true') console.log(`Next available extension is ${nextExt}`)
|
||||
return nextExt;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue