summaryrefslogtreecommitdiff
path: root/misc/freeswitch/scripts/common
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-10 21:59:10 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-10 21:59:10 +0100
commit48accca73c9564bd2ee8bd296d47eb5c27dbcd51 (patch)
tree9b3a41fa814fdc1746f70a6c6c196331134f2e99 /misc/freeswitch/scripts/common
parent878412b12dd34004d37b8b79945786e506f8fa08 (diff)
parent213eccb7678e74a5c06e6f9ff5ba3bad2dd90b3c (diff)
Merge branch 'develop' of github.com:amooma/GS5 into develop
Diffstat (limited to 'misc/freeswitch/scripts/common')
-rw-r--r--misc/freeswitch/scripts/common/configuration_table.lua19
1 files changed, 11 insertions, 8 deletions
diff --git a/misc/freeswitch/scripts/common/configuration_table.lua b/misc/freeswitch/scripts/common/configuration_table.lua
index 731bf2f..85bc014 100644
--- a/misc/freeswitch/scripts/common/configuration_table.lua
+++ b/misc/freeswitch/scripts/common/configuration_table.lua
@@ -21,17 +21,20 @@ function get(database, entity, section)
local parameter_class = '';
database:query(sql_query, function(parameters)
- if not root[parameters.section] then
- root[parameters.section] = {};
+ local p_section = common.str.strip(parameters.section):lower();
+ local p_class_type = common.str.strip(parameters.class_type):lower();
+ local p_name = common.str.strip(parameters.name);
+
+ if not root[p_section] then
+ root[p_section] = {};
end
- parameter_class = tostring(parameters.class_type):lower();
- if parameter_class == 'boolean' then
- root[parameters.section][parameters.name] = common.str.to_b(parameters.value);
- elseif parameter_class == 'integer' then
- root[parameters.section][parameters.name] = common.str.to_i(parameters.value);
+ if p_class_type == 'boolean' then
+ root[p_section][p_name] = common.str.to_b(parameters.value);
+ elseif p_class_type == 'integer' then
+ root[p_section][p_name] = common.str.to_i(parameters.value);
else
- root[parameters.section][parameters.name] = tostring(parameters.value);
+ root[p_section][p_name] = tostring(parameters.value);
end
end)