Update server/monitor-types/sip-options.js

Co-authored-by: Frank Elsinga <frank@elsinga.de>
This commit is contained in:
Eddie Fiorentine 2026-01-04 22:22:17 -05:00 committed by GitHub
parent 032eb891ae
commit 7827033456
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -32,7 +32,16 @@ class SIPMonitorType extends MonitorType {
* @throws Will throw an error if the command execution encounters any error.
*/
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 execFile(
"sipsak",
[
"-s", `sip:${hostname}:${port}`,
"--from", `sip:sipsak@${hostname}`,
"-v",
],
{ timeout }
);
if (!stdout && stderr && stderr.toString()) {
throw new Error(`Error in output: ${stderr.toString()}`);
}