Simplify logs
This commit is contained in:
parent
1f8f345963
commit
12478759ad
6
index.js
6
index.js
|
|
@ -8,6 +8,7 @@ const main = async () => {
|
|||
);
|
||||
|
||||
try {
|
||||
var forwards = {};
|
||||
const commands = [
|
||||
'asterisk -x "database show CF"',
|
||||
'asterisk -x "database show CFB"',
|
||||
|
|
@ -19,7 +20,6 @@ const main = async () => {
|
|||
console.error(`Error executing command "${command}": ${error}`);
|
||||
continue;
|
||||
}
|
||||
console.log(`Output for command "${command}":\n${stdout}`);
|
||||
|
||||
const lines = stdout.split('\n');
|
||||
for (const line of lines) {
|
||||
|
|
@ -28,10 +28,12 @@ const main = async () => {
|
|||
const type = match[1];
|
||||
const extension = match[2];
|
||||
const target = match[3];
|
||||
console.log(`Parsed - Type: ${type}, Extension: ${extension}, Target: ${target}`);
|
||||
|
||||
forwards[`${type}/${extension}`] = target;
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log("Call forwards:", forwards);
|
||||
} catch (err) {
|
||||
console.error(`Unexpected error: ${err}`);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue