From c1c6eab03c226bfe7c6102ce1e4bb36fc2f31e5c Mon Sep 17 00:00:00 2001 From: sorcier Date: Fri, 6 Nov 2026 00:29:19 +0100 Subject: [PATCH] feat(pjsip): set default hold timeout to 600s (10 min) and add rtp_timeout_hold to settings schema --- src/ConfigGenerator.php | 4 ++-- src/Database.php | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ConfigGenerator.php b/src/ConfigGenerator.php index 0f407b7..291a8df 100644 --- a/src/ConfigGenerator.php +++ b/src/ConfigGenerator.php @@ -224,7 +224,7 @@ class ConfigGenerator // Détection automatique et purge des flux RTP fantômes / morts (ex: basculement HA, coupure réseau) $rtpTimeout = max(5, (int)($settings['rtp_timeout'] ?? 30)); - $rtpHoldTimeout = max(30, $rtpTimeout * 2); + $rtpHoldTimeout = max(60, (int)($settings['rtp_timeout_hold'] ?? 600)); // Par défaut 600s = 10 minutes d'attente max $rtpKeepalive = max(0, (int)($settings['rtp_keepalive'] ?? 15)); $lines[] = "rtp_timeout = {$rtpTimeout}"; $lines[] = "rtp_timeout_hold = {$rtpHoldTimeout}"; @@ -388,7 +388,7 @@ class ConfigGenerator $lines[] = "trust_id_outbound = {$trustOutbound}"; $lines[] = "timers = {$timers}"; $rtpTimeout = max(5, (int)($settings['rtp_timeout'] ?? 30)); - $rtpHoldTimeout = max(30, $rtpTimeout * 2); + $rtpHoldTimeout = max(60, (int)($settings['rtp_timeout_hold'] ?? 600)); // Par défaut 600s = 10 minutes d'attente max $lines[] = "rtp_timeout = {$rtpTimeout}"; $lines[] = "rtp_timeout_hold = {$rtpHoldTimeout}"; if ($rtpKeepalive > 0) { diff --git a/src/Database.php b/src/Database.php index 0bef49e..fbff0ab 100644 --- a/src/Database.php +++ b/src/Database.php @@ -89,6 +89,7 @@ class Database rtp_checksums INTEGER NOT NULL DEFAULT 1, rtp_strict INTEGER NOT NULL DEFAULT 1, rtp_timeout INTEGER NOT NULL DEFAULT 30, + rtp_timeout_hold INTEGER NOT NULL DEFAULT 600, rtp_keepalive INTEGER NOT NULL DEFAULT 15, allow_anonymous_sip INTEGER NOT NULL DEFAULT 0, last_applied_at DATETIME DEFAULT NULL, @@ -391,6 +392,7 @@ class Database 'rtp_checksums' => "INTEGER NOT NULL DEFAULT 1", 'rtp_strict' => "INTEGER NOT NULL DEFAULT 1", 'rtp_timeout' => "INTEGER NOT NULL DEFAULT 30", + 'rtp_timeout_hold' => "INTEGER NOT NULL DEFAULT 600", 'rtp_keepalive' => "INTEGER NOT NULL DEFAULT 15", 'allow_anonymous_sip' => "INTEGER NOT NULL DEFAULT 0", 'system_language' => "VARCHAR(16) NOT NULL DEFAULT 'fr'",