Fix the xml handler nil error for number_alias.
This commit is contained in:
+10
-8
@@ -34,12 +34,16 @@
|
|||||||
--get the action
|
--get the action
|
||||||
action = params:getHeader("action");
|
action = params:getHeader("action");
|
||||||
purpose = params:getHeader("purpose");
|
purpose = params:getHeader("purpose");
|
||||||
--sip_auth - registration
|
--sip_auth - registration
|
||||||
--group_call - call group has been called
|
--group_call - call group has been called
|
||||||
--user_call - user has been called
|
--user_call - user has been called
|
||||||
|
|
||||||
--additional information
|
--additional information
|
||||||
--event_calling_function = params:getHeader("Event-Calling-Function");
|
--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
|
--determine the correction action to perform
|
||||||
if (purpose == "gateways") then
|
if (purpose == "gateways") then
|
||||||
@@ -194,8 +198,6 @@
|
|||||||
if (string.len(row.cidr) > 0) then
|
if (string.len(row.cidr) > 0) then
|
||||||
cidr = [[ cidr="]] .. row.cidr .. [["]];
|
cidr = [[ cidr="]] .. row.cidr .. [["]];
|
||||||
end
|
end
|
||||||
number_alias = "";
|
|
||||||
number_alias_string = "";
|
|
||||||
if (string.len(row.number_alias) > 0) then
|
if (string.len(row.number_alias) > 0) then
|
||||||
number_alias = row.number_alias;
|
number_alias = row.number_alias;
|
||||||
number_alias_string = [[ number-alias="]] .. row.number_alias .. [["]];
|
number_alias_string = [[ number-alias="]] .. row.number_alias .. [["]];
|
||||||
@@ -262,8 +264,8 @@
|
|||||||
--get the voicemail from the database
|
--get the voicemail from the database
|
||||||
if (continue) then
|
if (continue) then
|
||||||
vm_enabled = "true";
|
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 .. "' ";
|
sql = "SELECT * FROM v_voicemails WHERE domain_uuid = '" .. domain_uuid .. "' and voicemail_id = '" .. number_alias .. "' ";
|
||||||
else
|
else
|
||||||
sql = "SELECT * FROM v_voicemails WHERE domain_uuid = '" .. domain_uuid .. "' and voicemail_id = '" .. user .. "' ";
|
sql = "SELECT * FROM v_voicemails WHERE domain_uuid = '" .. domain_uuid .. "' and voicemail_id = '" .. user .. "' ";
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user