merge #2

Merged
poslop merged 4 commits from dev into main 2026-04-22 12:09:20 -05:00
Showing only changes of commit 88bd43593a - Show all commits
+10 -11
View File
@@ -125,15 +125,14 @@ echo "Wrote $out_file with " . $root->childNodes->length . " contacts\n";
/** Optional: push check-sync to re-download directory without reboot */
if ($do_notify) {
// Use the extension list we already built
$notified = 0;
foreach ($rows as $r) {
$ext = trim((string)$r['extension']);
if ($ext === '') continue;
// In FreePBX, PJSIP endpoint id is typically the extension number
$cmd = "asterisk -rx \"pjsip send notify polycom-check-cfg endpoint " . escapeshellarg($ext) . "\"";
exec($cmd, $o, $rc);
if ($rc === 0) $notified++;
}
echo "Sent check-sync to $notified endpoints\n";
asterisk_bin=/usr/sbin/asterisk
endpoints=$($asterisk_bin -rx "pjsip show endpoints" \
| sed -n 's/^[[:space:]]*Endpoint:[[:space:]]\+\([^[:space:]/]\+\).*/\1/p' \
| grep -vE '^(anonymous|system)$' \
| sort -u)
for ep in $endpoints; do
echo "Sending check-sync to $ep"
$asterisk_bin -rx "pjsip send notify polycom-check-cfg endpoint $ep"
done
}