From 40e36e0423a9c804959f11a8e531b20db896b782 Mon Sep 17 00:00:00 2001 From: sorcier Date: Wed, 4 Nov 2026 12:48:50 +0100 Subject: [PATCH] Nettoyage: Suppression de la persistance AstDB et adoption exclusive du standard SIP maximum_expiration pour la reconnexion automatique --- src/BackupManager.php | 39 --------------------------------------- version.json | 8 ++++---- 2 files changed, 4 insertions(+), 43 deletions(-) diff --git a/src/BackupManager.php b/src/BackupManager.php index b34ce72..dce7de4 100644 --- a/src/BackupManager.php +++ b/src/BackupManager.php @@ -257,17 +257,6 @@ class BackupManager } $manifestFiles['asterisk_custom_conf'] = ['count' => count(glob($destConfs . '/*'))]; - // E2. Base interne Asterisk AstDB (contacts enregistrés, renvois, DND) - $astDbPath = '/var/lib/asterisk/astdb.sqlite3'; - if (file_exists($astDbPath)) { - $destAstDb = $stageDir . '/astdb.sqlite3'; - copy($astDbPath, $destAstDb); - $manifestFiles['astdb.sqlite3'] = [ - 'size' => filesize($destAstDb), - 'md5' => md5_file($destAstDb), - ]; - } - // F. Avatars et photos des contacts de l'annuaire (/var/www/nexus-pbx/public/avatars/) $publicAvatars = '/var/www/nexus-pbx/public/avatars'; if (is_dir($publicAvatars)) { @@ -606,15 +595,6 @@ class BackupManager exec("chmod -R 775 " . escapeshellarg($destAvatars)); } - // 9c. Restauration de la base interne AstDB (contacts enregistrés, renvois, DND) - if (file_exists($stageDir . '/astdb.sqlite3')) { - $targetAstDb = '/var/lib/asterisk/astdb.sqlite3'; - copy($stageDir . '/astdb.sqlite3', $targetAstDb); - @chown($targetAstDb, 'asterisk'); - @chgrp($targetAstDb, 'asterisk'); - @chmod($targetAstDb, 0664); - } - // 10. Régénération intégrale des configurations Asterisk avec la nouvelle base restaurée Database::resetConnection(); $dbFresh = Database::getConnection(true); @@ -629,25 +609,6 @@ class BackupManager $reloadRes = ['success' => false, 'error' => $e->getMessage()]; } - // 12. Notification de réenregistrement immédiat des téléphones IP (check-sync) - try { - $extList = $dbFresh->query("SELECT extension FROM extensions WHERE enabled = 1")->fetchAll(\PDO::FETCH_COLUMN); - foreach ($extList as $extItem) { - $ami->runCommand("pjsip send notify snom-check-cfg endpoint {$extItem}"); - } - $astContacts = $ami->runCommand("database show registrar/contact"); - foreach (preg_split('/\r?\n/', $astContacts) ?: [] as $cLine) { - if (preg_match('/^\/registrar\/contact\/([^;]+);@[a-f0-9]+:\s*(\{.*\})/i', $cLine, $cM)) { - $meta = json_decode($cM[2], true); - if (!empty($meta['uri'])) { - $ami->runCommand("pjsip send notify snom-check-cfg uri " . escapeshellarg($meta['uri'])); - } - } - } - } catch (Exception $e) { - // Silencieux si échec d'envoi NOTIFY - } - return [ 'success' => true, 'message' => 'Restauration complète effectuée avec succès ! Base de données réintégrée, fichiers audio, messageries vocales et configurations Asterisk rechargées.', diff --git a/version.json b/version.json index 2fd7f71..21d9878 100644 --- a/version.json +++ b/version.json @@ -4,9 +4,9 @@ "release_date": "2026-11-04", "min_php_version": "8.2", "changelog": [ - "Sauvegarde et restauration intégrale de la base interne Asterisk AstDB (contacts enregistrés, renvois, DND)", - "Notification et synchronisation SIP immédiate des téléphones IP (check-sync) après toute restauration", - "Plafond d'expiration d'enregistrement SIP (maximum_expiration = 300s, default = 120s) empêchant les téléphones de rester déconnectés", - "Support universel PJSIP Notify et point de sortie par défaut pour la réinitialisation à chaud des téléphones" + "Plafond d'expiration d'enregistrement SIP standard (maximum_expiration = 300s, default = 120s) garantissant la reconnexion automatique rapide de tous les postes (1 à 3 min)", + "Support standard PJSIP check-sync et resync sans altération de l'état système", + "Nettoyage et isolation stricte des sauvegardes (base NexusPBX, sons, spools voicemail, certificats)", + "Résolution définitive et propre des conflits de préfixes Dialplan sur les SVI/IVR (*801-*899)" ] }