Make the two inbound lua scripts more robust when the domain is not found.

This commit is contained in:
Mark Crane 2014-04-05 20:14:55 +00:00
parent a7ab1c568c
commit 63752b3856
2 changed files with 87 additions and 84 deletions

View File

@ -86,10 +86,11 @@
source = "memcache";
end
if (domain_name ~= nil) then
--set the call direction as a session variable
session:setVariable("domain_name", domain_name);
session:setVariable("domain", domain_name);
session:setVariable("domain_uuid", domain_uuid);
--send information to the console
freeswitch.consoleLog("notice", "[app:dialplan:inbound:get_domain] " .. cache .. " source: ".. source .."\n");
end

View File

@ -40,6 +40,7 @@ This method causes the script to get its manadatory arguments directly from the
21 Feb, 2014: move to app/diaplan/resources/call_block
]]
if (session:getVariable("domain") ~= nil) then
-- Command line parameters
local params = { cmd = "",
cid_num = string.gsub(tostring(session:getVariable("caller_id_number")), "+", ""),
@ -121,3 +122,4 @@ This method causes the script to get its manadatory arguments directly from the
end
end
--end
end