fix: SIP Options monitor would always write an error to log because sipsak by default writes DEBUG to stderr

This commit is contained in:
Eddie Fiorentine 2024-11-19 19:42:45 -05:00
parent c40f8e7ba5
commit 783e228406

View file

@ -31,9 +31,6 @@ class SIPMonitorType extends MonitorType {
*/ */
async runSipSak(hostname, port, timeout) { async runSipSak(hostname, port, timeout) {
const { stdout, stderr } = await exec(`sipsak -s sip:${hostname}:${port} --from sip:sipsak@${hostname} -v`,{timeout:timeout}); const { stdout, stderr } = await exec(`sipsak -s sip:${hostname}:${port} --from sip:sipsak@${hostname} -v`,{timeout:timeout});
if (stderr){
console.error(`Error in stderr: ${stderr.toString()}`);
}
if (!stdout && stderr && stderr.toString()) { if (!stdout && stderr && stderr.toString()) {
throw new Error(`Error in output: ${stderr.toString()}`); throw new Error(`Error in output: ${stderr.toString()}`);
} }