Revert "Change. Use require "resources.functions.config" to load config file."

This commit is contained in:
FusionPBX
2015-08-10 11:50:29 -06:00
parent a337e1a8ba
commit d1f3b05cf6
69 changed files with 507 additions and 294 deletions

View File

@@ -29,12 +29,14 @@
--then send presence terminate, and delete from the database
--include config.lua
require "resources.functions.config";
scripts_dir = string.sub(debug.getinfo(1).source,2,string.len(debug.getinfo(1).source)-(string.len(argv[0])+1));
dofile(scripts_dir.."/resources/functions/config.lua");
dofile(config());
--connect to the database
--dbh = freeswitch.Dbh("core:core"); -- when using sqlite
dbh = freeswitch.Dbh("sqlite://"..database_dir.."/park.db");
--require "resources.functions.database_handle";
--dofile(scripts_dir.."/resources/functions/database_handle.lua");
--get the argv values
script_name = argv[0];
@@ -48,8 +50,10 @@
--prepare the api
api = freeswitch.API();
--define the trim function
require "resources.functions.trim";
--add a trim function
function trim (s)
return (string.gsub(s, "^%s*(.-)%s*$", "%1"))
end
--monitor the parking lot if the call has hungup send a terminated event, and delete from the db
x = 0