Fix the xml handler nil error for number_alias.

This commit is contained in:
Mark Crane 2014-10-15 17:32:02 +00:00
parent 2226f442d0
commit a190165f02
1 changed files with 10 additions and 8 deletions

View File

@ -41,6 +41,10 @@
--additional information
--event_calling_function = params:getHeader("Event-Calling-Function");
--set the variables as a string to prevent nil errors
number_alias = "";
number_alias_string = "";
--determine the correction action to perform
if (purpose == "gateways") then
dofile(scripts_dir.."/app/xml_handler/resources/scripts/directory/action/domains.lua");
@ -194,8 +198,6 @@
if (string.len(row.cidr) > 0) then
cidr = [[ cidr="]] .. row.cidr .. [["]];
end
number_alias = "";
number_alias_string = "";
if (string.len(row.number_alias) > 0) then
number_alias = row.number_alias;
number_alias_string = [[ number-alias="]] .. row.number_alias .. [["]];
@ -262,7 +264,7 @@
--get the voicemail from the database
if (continue) then
vm_enabled = "true";
if (tonumber(user) == nil) then
if tonumber(user) == nil then
sql = "SELECT * FROM v_voicemails WHERE domain_uuid = '" .. domain_uuid .. "' and voicemail_id = '" .. number_alias .. "' ";
else
sql = "SELECT * FROM v_voicemails WHERE domain_uuid = '" .. domain_uuid .. "' and voicemail_id = '" .. user .. "' ";