Fix ring group delay timing

Use sofia_contact instead of user bridge alias. Added a useful note from @greenbea describing why there was a problem with follow me delay timing.

When you originate user/ext@domain, switch_ivr_originate will call the user endpoint. The user endpoint isn't a real endpoint. It is a shortcut to get the real dialstring from the user's XML and calls again switch_ivr_originate, so essentially, what happens is switch_ivr_originate reads twice originate_delay_start variable and waits double the time.

Your patch fixes the case when the endpoint is the user/ endpoint but will make the delay half the time if called with other endpoints like sofia.

The ultimate solution would be freeswitch to handle this in the user endpoint function. I would suggest that fusion manually get the user's dial string from the XML and call originate on it and not rely on the user (shortcut) endpoint for ring group and follow me.
This commit is contained in:
FusionPBX
2023-09-22 16:23:14 -06:00
committed by GitHub
parent 6030843ca8
commit b0a2f3340a

View File

@@ -163,7 +163,8 @@
context = session:getVariable("context");
call_direction = session:getVariable("call_direction");
accountcode = session:getVariable("accountcode");
local_ip_v4 = session:getVariable("local_ip_v4")
local_ip_v4 = session:getVariable("local_ip_v4");
verto_enabled = session:getVariable("verto_enabled") or '';
end
--set caller id
@@ -834,8 +835,19 @@
end
--send to user
local dial_string_to_user = "[sip_invite_domain="..domain_name..",domain_name="..domain_name..",call_direction="..call_direction..","..group_confirm..""..timeout_name.."="..destination_timeout..","..delay_name.."="..destination_delay..",dialed_extension=" .. row.destination_number .. ",extension_uuid=".. extension_uuid .. row.record_session .. hold_music .."]user/" .. row.destination_number .. "@" .. domain_name;
dial_string = dial_string_to_user;
local dial_string_user = "[sip_invite_domain="..domain_name..",call_direction="..call_direction..",";
dial_string_user = dial_string_user .. group_confirm..","..timeout_name.."="..destination_timeout..",";
dial_string_user = dial_string_user .. delay_name.."="..destination_delay..",";
dial_string_user = dial_string_user .. "dialed_extension=" .. row.destination_number .. ",";
dial_string_user = dial_string_user .. "presence_id=" .. row.destination_number .. "@"..domain_name..",";
dial_string_user = dial_string_user .. "extension_uuid="..extension_uuid..record_session.."]";
user_contact = api:executeString("sofia_contact */".. row.destination_number .."@" ..domain_name);
if (user_contact ~= "error/user_not_registered") then
dial_string = dial_string_user .. user_contact;
end
if (verto_enabled == 'true') then
dial_string = dial_string .. ","..api:executeString("verto_contact ".. row.destination_number .."@" ..domain_name);
end
elseif (tonumber(destination_number) == nil) then
--sip uri
dial_string = "[sip_invite_domain="..domain_name..",domain_name="..domain_name..",call_direction="..call_direction..","..group_confirm..""..timeout_name.."="..destination_timeout..","..delay_name.."="..destination_delay.."]" .. row.destination_number;