feat(sip): make rtp_timeout_hold configurable in Web UI and default to 0 (unlimited hold)
This commit is contained in:
1 parent
767fea46b7
commit
c1805c9076
5 files changed
+30
-14
No files matched your search
@@ -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}";
|
||||
}
|
||||
|
||||
+4
-4
@@ -46,9 +46,9 @@ class Database
|
||||
@chmod(self::DB_PATH, 0660);
|
||||
} else {
|
||||
// Si la base existe déjà, éviter d'exécuter l'intégralité du DDL à chaque requête HTTP
|
||||
// ce qui sature SQLite de verrous exclusifs inutiles. On teste juste l'existence de la table principale.
|
||||
// ce qui sature SQLite de verrous exclusifs inutiles. On s'assure des colonnes requises.
|
||||
try {
|
||||
self::$instance->query("SELECT 1 FROM settings LIMIT 1");
|
||||
self::$instance->query("SELECT rtp_timeout_hold FROM settings LIMIT 1");
|
||||
} catch (\Throwable $e) {
|
||||
self::initializeSchema();
|
||||
}
|
||||
@@ -89,7 +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_timeout_hold INTEGER NOT NULL DEFAULT 0,
|
||||
rtp_keepalive INTEGER NOT NULL DEFAULT 15,
|
||||
allow_anonymous_sip INTEGER NOT NULL DEFAULT 0,
|
||||
last_applied_at DATETIME DEFAULT NULL,
|
||||
@@ -393,7 +393,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_timeout_hold' => "INTEGER NOT NULL DEFAULT 0",
|
||||
'rtp_keepalive' => "INTEGER NOT NULL DEFAULT 15",
|
||||
'allow_anonymous_sip' => "INTEGER NOT NULL DEFAULT 0",
|
||||
'system_language' => "VARCHAR(16) NOT NULL DEFAULT 'fr'",
|
||||
|
||||
Reference in new issue
Block a user