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

+6 -3
View File
@@ -2017,6 +2017,7 @@ try {
$rtpChecksums = !empty($payload['rtp_checksums']) ? 1 : 0;
$rtpStrict = !empty($payload['rtp_strict']) ? 1 : 0;
$rtpTimeout = max(5, (int)($payload['rtp_timeout'] ?? 30));
$rtpHoldTimeout = max(0, (int)($payload['rtp_timeout_hold'] ?? 0));
$rtpKeepalive = max(0, (int)($payload['rtp_keepalive'] ?? 15));
$allowAnonymousSip = !empty($payload['allow_anonymous_sip']) ? 1 : 0;
@@ -2051,6 +2052,7 @@ try {
rtp_checksums = :rtp_checksums,
rtp_strict = :rtp_strict,
rtp_timeout = :rtp_timeout,
rtp_timeout_hold = :rtp_timeout_hold,
rtp_keepalive = :rtp_keepalive,
allow_anonymous_sip = :anon,
updated_at = CURRENT_TIMESTAMP
@@ -2068,9 +2070,10 @@ try {
':rtp_start' => $rtpStart,
':rtp_end' => $rtpEnd,
':rtp_checksums' => $rtpChecksums,
':rtp_strict' => $rtpStrict,
':rtp_timeout' => $rtpTimeout,
':rtp_keepalive' => $rtpKeepalive,
':rtp_strict' => $rtpStrict,
':rtp_timeout' => $rtpTimeout,
':rtp_timeout_hold' => $rtpHoldTimeout,
':rtp_keepalive' => $rtpKeepalive,
':anon' => $allowAnonymousSip,
]);
+6
View File
@@ -4152,6 +4152,7 @@ document.addEventListener('DOMContentLoaded', () => {
rtp_checksums: Number(document.getElementById('sip-rtp-checksums')?.value || 1),
rtp_keepalive: Number(document.getElementById('sip-rtp-keepalive')?.value || 15),
rtp_timeout: Number(document.getElementById('sip-rtp-timeout')?.value || 30),
rtp_timeout_hold: Number(document.getElementById('sip-rtp-timeout-hold')?.value || 0),
allow_anonymous_sip: Number(document.getElementById('sip-allow-anonymous')?.value || 0),
local_networks: localNets
};
@@ -4613,6 +4614,11 @@ function renderSipSettings() {
rtpTimeoutEl.value = (s.rtp_timeout !== undefined && s.rtp_timeout !== null) ? s.rtp_timeout : 30;
}
const rtpHoldTimeoutEl = document.getElementById('sip-rtp-timeout-hold');
if (rtpHoldTimeoutEl && document.activeElement !== rtpHoldTimeoutEl) {
rtpHoldTimeoutEl.value = (s.rtp_timeout_hold !== undefined && s.rtp_timeout_hold !== null) ? s.rtp_timeout_hold : 0;
}
const allowAnonEl = document.getElementById('sip-allow-anonymous');
if (allowAnonEl) {
allowAnonEl.value = (s.allow_anonymous_sip !== undefined && s.allow_anonymous_sip !== null) ? String(s.allow_anonymous_sip) : '0';
+7 -1
View File
@@ -2554,7 +2554,7 @@ $isDevEnv = file_exists(__DIR__ . '/../.dev')
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 pt-2">
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 pt-2">
<div>
<label class="block text-xs font-semibold text-slate-200 mb-1">RTP Keepalive (secondes)</label>
<input type="number" id="sip-rtp-keepalive" name="rtp_keepalive" value="15" min="0" max="120"
@@ -2567,6 +2567,12 @@ $isDevEnv = file_exists(__DIR__ . '/../.dev')
class="w-full px-3 py-2 rounded-xl bg-anthracite-950 border border-anthracite-700 text-xs text-white font-mono focus:ring-2 focus:ring-emerald-500 focus:outline-none">
<p class="text-[11px] text-slate-400 mt-1">Durée avant coupure si aucun flux voix n'est reçu (raccroché distant brutal).</p>
</div>
<div>
<label class="block text-xs font-semibold text-slate-200 mb-1">RTP Timeout Mise en attente</label>
<input type="number" id="sip-rtp-timeout-hold" name="rtp_timeout_hold" value="0" min="0" max="3600"
class="w-full px-3 py-2 rounded-xl bg-anthracite-950 border border-anthracite-700 text-xs text-white font-mono focus:ring-2 focus:ring-emerald-500 focus:outline-none">
<p class="text-[11px] text-slate-400 mt-1">Délai max d'un appel en attente sans flux RTP (0 = illimité / désactivé).</p>
</div>
</div>
</div>