feat(sip): make rtp_timeout_hold configurable in Web UI and default to 0 (unlimited hold)

This commit is contained in:
sorcier committed 2026-11-06 01:40:31 +01:00
1 parent 767fea46b7
commit c1805c9076
5 files changed
+30 -14

No files matched your search

+7 -6
View File
@@ -237,7 +237,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(60, (int)($settings['rtp_timeout_hold'] ?? 600)); // Par défaut 600s = 10 minutes d'attente max
$rtpHoldTimeout = max(0, (int)($settings['rtp_timeout_hold'] ?? 0));
$rtpKeepalive = max(0, (int)($settings['rtp_keepalive'] ?? 15));
$lines[] = "rtp_timeout = {$rtpTimeout}";
$lines[] = "rtp_timeout_hold = {$rtpHoldTimeout}";
@@ -401,7 +401,7 @@ class ConfigGenerator
$lines[] = "trust_id_outbound = {$trustOutbound}";
$lines[] = "timers = {$timers}";
$rtpTimeout = max(5, (int)($settings['rtp_timeout'] ?? 30));
$rtpHoldTimeout = max(60, (int)($settings['rtp_timeout_hold'] ?? 600)); // Par défaut 600s = 10 minutes d'attente max
$rtpHoldTimeout = max(0, (int)($settings['rtp_timeout_hold'] ?? 0));
$lines[] = "rtp_timeout = {$rtpTimeout}";
$lines[] = "rtp_timeout_hold = {$rtpHoldTimeout}";
if ($rtpKeepalive > 0) {
@@ -1779,9 +1779,10 @@ class ConfigGenerator
$rtpEnd = max($rtpStart + 4, min(65535, (int)($settings['rtp_end'] ?? 20000)));
$checksums = !empty($settings['rtp_checksums']) ? 'yes' : 'no';
$strict = !empty($settings['rtp_strict']) ? 'yes' : 'no';
$timeout = max(5, (int)($settings['rtp_timeout'] ?? 30));
$keepalive = max(0, (int)($settings['rtp_keepalive'] ?? 15));
$date = date('Y-m-d H:i:s');
$timeout = max(5, (int)($settings['rtp_timeout'] ?? 30));
$holdTimeout = max(0, (int)($settings['rtp_timeout_hold'] ?? 0));
$keepalive = max(0, (int)($settings['rtp_keepalive'] ?? 15));
$date = date('Y-m-d H:i:s');
$lines = [];
$lines[] = "; ===========================================================================";
@@ -1794,7 +1795,7 @@ class ConfigGenerator
$lines[] = "rtpchecksums = {$checksums}";
$lines[] = "strictrtp = {$strict}";
$lines[] = "rtptimeout = {$timeout}";
$lines[] = "rtpholdtimeout = 300";
$lines[] = "rtpholdtimeout = {$holdTimeout}";
if ($keepalive > 0) {
$lines[] = "rtpkeepalive = {$keepalive}";
}