Fix call timeout for ring strategy enterprise

Call timeout ignored with enterprise adjust the destinaton_timeout to honor the call timeout
This commit is contained in:
FusionPBX 2025-03-14 20:31:06 -06:00 committed by GitHub
parent 89eeeb84ae
commit 8a1421eb97
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 20 additions and 0 deletions

View File

@ -932,6 +932,25 @@ log = require "resources.functions.log".ring_group
end
row.record_session = record_session
--call timeout ignored with enterprise adjust the destinaton_timeout to honor the call timeout
if (ring_group_strategy == "enterprise") then
delay = tonumber(destination_delay)
if (delay >= 1000) then
delay = delay / 1000;
end
timeout = tonumber(destination_timeout);
call_timeout = tonumber(ring_group_call_timeout);
if (delay == 0 and call_timeout < timeout) then
destination_timeout = call_timeout;
end
if (delay > 0 and call_timeout < delay + timeout) then
destination_timeout = (delay + timeout) - call_timeout;
if (delay >= call_timeout) then
goto continue
end
end
end
--process according to user_exists, sip_uri, external number
if (user_exists == "true") then
--get the extension_uuid
@ -1045,6 +1064,7 @@ log = require "resources.functions.log".ring_group
--increment the value of x
x = x + 1;
end
::continue::
end
--release dbh before bridge