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 */ /** Optional: push check-sync to re-download directory without reboot */
if ($do_notify) { if ($do_notify) {
// Use the extension list we already built asterisk_bin=/usr/sbin/asterisk
$notified = 0; endpoints=$($asterisk_bin -rx "pjsip show endpoints" \
foreach ($rows as $r) { | sed -n 's/^[[:space:]]*Endpoint:[[:space:]]\+\([^[:space:]/]\+\).*/\1/p' \
$ext = trim((string)$r['extension']); | grep -vE '^(anonymous|system)$' \
if ($ext === '') continue; | sort -u)
// In FreePBX, PJSIP endpoint id is typically the extension number
$cmd = "asterisk -rx \"pjsip send notify polycom-check-cfg endpoint " . escapeshellarg($ext) . "\""; for ep in $endpoints; do
exec($cmd, $o, $rc); echo "Sending check-sync to $ep"
if ($rc === 0) $notified++; $asterisk_bin -rx "pjsip send notify polycom-check-cfg endpoint $ep"
} done
echo "Sent check-sync to $notified endpoints\n";
} }