Default behavior before call forward on busy was if busy go to voicemail. I just re-established that default for any company wanting to simply hangup on calls when the destination is busy then set system -> variables or domain -> variables to send_to_voicemail=false. This is a better default as it would require those wanting to simply hangup to set the value to false allowing the default behavior is preserved.

This commit is contained in:
Mark Crane 2014-11-18 10:29:03 +00:00
parent 44c517173c
commit 320659ffad
2 changed files with 8 additions and 5 deletions

View File

@ -65,8 +65,7 @@
end
end
if (originate_disposition ~= nil) then
send_to_voicemail = session:getVariable("send_to_voicemail");
if (originate_disposition == 'USER_BUSY' and send_to_voicemail ~= "true") then
if (originate_disposition == 'USER_BUSY') then
freeswitch.consoleLog("notice", "[app] forward on busy: ".. scripts_dir .. "/app/forward_on_busy/index.lua" .. arguments .."\n");
forward_on_busy = loadfile(scripts_dir .. "/app/forward_on_busy/index.lua")(argv);
freeswitch.consoleLog("notice", "[app] forward on busy: ".. tostring(forward_on_busy) .. "\n");

View File

@ -43,6 +43,10 @@
context = session:getVariable("context");
domain_name = session:getVariable("domain_name");
uuid = session:getVariable("uuid");
send_to_voicemail = session:getVariable("send_to_voicemail");
if (send_to_voicemail == nil) then
send_to_voicemail = "true";
end
--get the domain_uuid
domain_uuid = session:getVariable("domain_uuid");
@ -85,15 +89,15 @@
if ( debug["info"] ) then
freeswitch.consoleLog("notice", "[forward_on_busy] forward_busy_destination: " .. forward_busy_destination .. "\n");
end
session:transfer(forward_busy_destination, "XML", context);
forward = true;
else
if ( debug["info"] ) then
freeswitch.consoleLog("notice", "[forward_on_busy] forward on busy disabled or destination unset - HANGUP WITH USER BUSY \n");
end
session:hangup("USER_BUSY");
if (send_to_voicemail == "false") then
session:hangup("USER_BUSY");
end
forward = false;
end
end