feat(system): add RTP Timeout and RTP Hold Timeout directly in System Settings form
This commit is contained in:
1 parent
c1805c9076
commit
fa8af27e46
3 files changed
+32
No files matched your search
@@ -1717,6 +1717,8 @@ try {
|
||||
$local_net = trim((string)($payload['local_net'] ?? '192.168.1.0/24'));
|
||||
$udp_port = max(1024, min(65535, (int)($payload['udp_port'] ?? 5060)));
|
||||
$tls_port = max(1024, min(65535, (int)($payload['tls_port'] ?? 5061)));
|
||||
$rtpTimeout = max(5, (int)($payload['rtp_timeout'] ?? 30));
|
||||
$rtpHoldTimeout = max(0, (int)($payload['rtp_timeout_hold'] ?? 0));
|
||||
$letsencrypt_domain = trim((string)($payload['letsencrypt_domain'] ?? ''));
|
||||
$ami_host = trim((string)($payload['ami_host'] ?? '127.0.0.1'));
|
||||
$ami_port = max(1, min(65535, (int)($payload['ami_port'] ?? 5038)));
|
||||
@@ -1738,6 +1740,8 @@ try {
|
||||
local_net = :local_net,
|
||||
udp_port = :udp_port,
|
||||
tls_port = :tls_port,
|
||||
rtp_timeout = :rtp_timeout,
|
||||
rtp_timeout_hold = :rtp_timeout_hold,
|
||||
letsencrypt_domain = :le_domain,
|
||||
ami_host = :ami_host,
|
||||
ami_port = :ami_port,
|
||||
@@ -1756,6 +1760,8 @@ try {
|
||||
':local_net' => $local_net,
|
||||
':udp_port' => $udp_port,
|
||||
':tls_port' => $tls_port,
|
||||
':rtp_timeout' => $rtpTimeout,
|
||||
':rtp_timeout_hold' => $rtpHoldTimeout,
|
||||
':le_domain' => $letsencrypt_domain,
|
||||
':ami_host' => $ami_host,
|
||||
':ami_port' => $ami_port,
|
||||
@@ -1767,6 +1773,14 @@ try {
|
||||
]);
|
||||
|
||||
SystemChecker::ensureAsteriskIncludes();
|
||||
$generator->writeAllConfigs();
|
||||
try {
|
||||
$ami = AmiClient::fromDatabase($db);
|
||||
$ami->reloadModule('res_pjsip.so');
|
||||
$ami->reloadModule('res_rtp_asterisk.so');
|
||||
} catch (\Throwable $e) {
|
||||
// Ignore reload error if Asterisk is not running
|
||||
}
|
||||
|
||||
if (!empty($payload['new_admin_password'])) {
|
||||
$newPass = (string)$payload['new_admin_password'];
|
||||
|
||||
Reference in new issue
Block a user