mirror of
https://github.com/myronblair/jarvis
synced 2026-06-30 17:50:23 -05:00
netscan: store VoIP SIP registration status in kb_facts when phone probe provides it
This commit is contained in:
@@ -48,6 +48,23 @@ foreach ($devices as $d) {
|
|||||||
[$vendor, $ip]
|
[$vendor, $ip]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
// Store SIP registration status in kb_facts if provided (VoIP probe)
|
||||||
|
$sipStatus = trim($d['sip_status'] ?? '');
|
||||||
|
$extension = trim($d['extension'] ?? '');
|
||||||
|
if ($sipStatus && $extension && $extension !== 'none') {
|
||||||
|
JarvisDB::execute(
|
||||||
|
"INSERT INTO kb_facts (category, fact_key, fact_value, host)
|
||||||
|
VALUES ('voip', ?, ?, ?)
|
||||||
|
ON DUPLICATE KEY UPDATE fact_value=VALUES(fact_value), updated_at=NOW()",
|
||||||
|
["ext_{$extension}_sip", $sipStatus, $ip]
|
||||||
|
);
|
||||||
|
JarvisDB::execute(
|
||||||
|
"INSERT INTO kb_facts (category, fact_key, fact_value, host)
|
||||||
|
VALUES ('voip', ?, ?, ?)
|
||||||
|
ON DUPLICATE KEY UPDATE fact_value=VALUES(fact_value), updated_at=NOW()",
|
||||||
|
["ext_{$extension}_ip", $ip, $ip]
|
||||||
|
);
|
||||||
|
}
|
||||||
$upserted++;
|
$upserted++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user