Merge pull request #1053 from moteus/require_config

Change. Use `require "resources.functions.config"` to load config file.
This commit is contained in:
FusionPBX
2015-08-10 11:31:35 -06:00
69 changed files with 294 additions and 507 deletions

View File

@@ -28,19 +28,11 @@ pin_number = "";
max_tries = "3";
digit_timeout = "3000";
function trim (s)
return (string.gsub(s, "^%s*(.-)%s*$", "%1"))
end
--define the trim function
require "resources.functions.trim";
function explode ( seperator, str )
local pos, arr = 0, {}
for st, sp in function() return string.find( str, seperator, pos, true ) end do -- for each divider found
table.insert( arr, string.sub( str, pos, st-1 ) ) -- attach chars left of current divider
pos = sp + 1 -- jump past current divider
end
table.insert( arr, string.sub( str, pos ) ) -- attach chars right of last divider
return arr
end
--define the explode function
require "resources.functions.explode";
if ( session:ready() ) then
session:answer();