Change expire["sofia_conf"] to expire["sofia"] and expire["acl_conf"] to expire["acl"]. Then add a default value to prevent nil errors when the conf.lua script has not been updated.
This commit is contained in:
parent
827c9d5a50
commit
11f4fea479
|
|
@ -225,8 +225,8 @@ class scripts {
|
|||
$tmp .= " expire.directory = \"3600\";\n";
|
||||
$tmp .= " expire.dialplan = \"3600\";\n";
|
||||
$tmp .= " expire.languages = \"3600\";\n";
|
||||
$tmp .= " expire.sofia_conf = \"3600\";\n";
|
||||
$tmp .= " expire.acl_conf = \"3600\";\n";
|
||||
$tmp .= " expire.sofia = \"3600\";\n";
|
||||
$tmp .= " expire.acl = \"3600\";\n";
|
||||
$tmp .= "\n";
|
||||
$tmp .= "--set xml_handler\n";
|
||||
$tmp .= " xml_handler = {}\n";
|
||||
|
|
|
|||
|
|
@ -312,8 +312,8 @@ include "root.php";
|
|||
$tmp .= " expire.directory = \"3600\";\n";
|
||||
$tmp .= " expire.dialplan = \"3600\";\n";
|
||||
$tmp .= " expire.languages = \"3600\";\n";
|
||||
$tmp .= " expire.sofia_conf = \"3600\";\n";
|
||||
$tmp .= " expire.acl_conf = \"3600\";\n";
|
||||
$tmp .= " expire.sofia = \"3600\";\n";
|
||||
$tmp .= " expire.acl = \"3600\";\n";
|
||||
$tmp .= "\n";
|
||||
$tmp .= "--set xml_handler\n";
|
||||
$tmp .= " xml_handler = {}\n";
|
||||
|
|
|
|||
|
|
@ -42,6 +42,11 @@
|
|||
--set the cache
|
||||
if (XML_STRING == "-ERR NOT FOUND") or (XML_STRING == "-ERR CONNECTION FAILURE") then
|
||||
|
||||
--set a default value
|
||||
if (expire["acl"] == nil) then
|
||||
expire["acl"]= "3600";
|
||||
end
|
||||
|
||||
--connect to the database
|
||||
require "resources.functions.database_handle";
|
||||
dbh = database_handle('system');
|
||||
|
|
@ -103,7 +108,7 @@
|
|||
dbh:release();
|
||||
|
||||
--set the cache
|
||||
result = trim(api:execute("memcache", "set configuration:acl.conf '"..XML_STRING:gsub("'", "'").."' "..expire["acl_conf"]));
|
||||
result = trim(api:execute("memcache", "set configuration:acl.conf '"..XML_STRING:gsub("'", "'").."' "..expire["acl"]));
|
||||
|
||||
--send the xml to the console
|
||||
if (debug["xml_string"]) then
|
||||
|
|
|
|||
|
|
@ -35,6 +35,11 @@
|
|||
--set the cache
|
||||
if (XML_STRING == "-ERR NOT FOUND") or (XML_STRING == "-ERR CONNECTION FAILURE") then
|
||||
|
||||
--set a default value
|
||||
if (expire["sofia"] == nil) then
|
||||
expire["sofia"]= "3600";
|
||||
end
|
||||
|
||||
--connect to the database
|
||||
require "resources.functions.database_handle";
|
||||
dbh = database_handle('system');
|
||||
|
|
@ -258,7 +263,7 @@
|
|||
dbh:release();
|
||||
|
||||
--set the cache
|
||||
result = trim(api:execute("memcache", "set configuration:sofia.conf:" .. hostname .." '"..XML_STRING:gsub("'", "'").."' "..expire["sofia_conf"]));
|
||||
result = trim(api:execute("memcache", "set configuration:sofia.conf:" .. hostname .." '"..XML_STRING:gsub("'", "'").."' "..expire["sofia"]));
|
||||
|
||||
--send the xml to the console
|
||||
if (debug["xml_string"]) then
|
||||
|
|
|
|||
Loading…
Reference in New Issue