fix(cluster): mirror voicemails and custom sounds using rsync --delete to propagate deletions

This commit is contained in:
sorcier committed 2026-11-07 02:00:38 +01:00
1 parent 4bd0f8b095
commit c79faadd99
1 file changed
+9 -6
+9 -6
View File
@@ -733,14 +733,17 @@ class ClusterManager
throw new RuntimeException("Échec de vérification d'intégrité après synchronisation ({$postCheck}). Restauration préventive effectuée."); throw new RuntimeException("Échec de vérification d'intégrité après synchronisation ({$postCheck}). Restauration préventive effectuée.");
} }
// Extraction des sons personnalisés si présents // Synchronisation miroir des sons personnalisés (avec suppression des sons effacés)
if (is_dir('/var/lib/asterisk/sounds')) { $extractedCustom = $tmpExtractDir . '/custom';
shell_exec("tar -xzf " . escapeshellarg($tmpArchive) . " -C /var/lib/asterisk/sounds custom 2>/dev/null || true"); if (is_dir($extractedCustom) && is_dir('/var/lib/asterisk/sounds')) {
shell_exec("rsync -a --delete " . escapeshellarg($extractedCustom . '/') . " /var/lib/asterisk/sounds/custom/ 2>/dev/null || true");
shell_exec("chown -R asterisk:asterisk /var/lib/asterisk/sounds/custom 2>/dev/null || true");
} }
// Extraction de la messagerie vocale (fichiers audio, messages reçus INBOX, annonces d'accueil) // Synchronisation miroir de la messagerie vocale (avec suppression des messages effacés)
if (is_dir('/var/spool/asterisk')) { $extractedVm = $tmpExtractDir . '/voicemail';
shell_exec("tar -xzf " . escapeshellarg($tmpArchive) . " -C /var/spool/asterisk voicemail 2>/dev/null || true"); if (is_dir($extractedVm) && is_dir('/var/spool/asterisk/voicemail')) {
shell_exec("rsync -a --delete " . escapeshellarg($extractedVm . '/') . " /var/spool/asterisk/voicemail/ 2>/dev/null || true");
shell_exec("chown -R asterisk:asterisk /var/spool/asterisk/voicemail 2>/dev/null || true"); shell_exec("chown -R asterisk:asterisk /var/spool/asterisk/voicemail 2>/dev/null || true");
} }