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