Make the lua scripts that use config.lua to use the new config function.

This commit is contained in:
Mark Crane
2013-05-02 01:10:45 +00:00
parent 7d5f914ad1
commit e18d08659d
14 changed files with 28 additions and 15 deletions

View File

@@ -25,7 +25,8 @@
--include config.lua
scripts_dir = string.sub(debug.getinfo(1).source,2,string.len(debug.getinfo(1).source)-(string.len(argv[0])+1));
dofile(scripts_dir.."/resources/config.lua");
dofile(scripts_dir.."/resources/functions/config.lua");
dofile(config());
--get the argv values
script_name = argv[0];

View File

@@ -25,7 +25,8 @@
--include the lua script
scripts_dir = string.sub(debug.getinfo(1).source,2,string.len(debug.getinfo(1).source)-(string.len(argv[0])+1));
dofile(scripts_dir .. "/resources/config.lua");
dofile(scripts_dir.."/resources/functions/config.lua");
dofile(config());
--define general settings
tmp_file = "/usr/local/freeswitch/log/mwi.tmp";

View File

@@ -30,9 +30,9 @@
expire["sofia.conf"] = "3600";
--set the debug options
debug["params"] = true;
debug["params"] = false;
debug["sql"] = false;
debug["xml_request"] = true;
debug["xml_request"] = false;
debug["xml_string"] = false;
debug["cache"] = false;

View File

@@ -30,7 +30,8 @@
--include config.lua
scripts_dir = string.sub(debug.getinfo(1).source,2,string.len(debug.getinfo(1).source)-(string.len(argv[0])+1));
dofile(scripts_dir.."/resources/config.lua");
dofile(scripts_dir.."/resources/functions/config.lua");
dofile(config());
--connect to the database
dofile(scripts_dir.."/resources/functions/database_handle.lua");

View File

@@ -33,7 +33,8 @@
--include config.lua
scripts_dir = string.sub(debug.getinfo(1).source,2,string.len(debug.getinfo(1).source)-(string.len(argv[0])+1));
dofile(scripts_dir.."/resources/config.lua");
dofile(scripts_dir.."/resources/functions/config.lua");
dofile(config());
--general functions
dofile(scripts_dir.."/resources/functions/file_exists.lua");

View File

@@ -26,7 +26,8 @@
--include config.lua
scripts_dir = string.sub(debug.getinfo(1).source,2,string.len(debug.getinfo(1).source)-(string.len(argv[0])+1));
dofile(scripts_dir.."/resources/config.lua");
dofile(scripts_dir.."/resources/functions/config.lua");
dofile(config());
--connect to the database
dofile(scripts_dir.."/resources/functions/database_handle.lua");

View File

@@ -34,7 +34,8 @@
--include config.lua
scripts_dir = string.sub(debug.getinfo(1).source,2,string.len(debug.getinfo(1).source)-(string.len(argv[0])+1));
dofile(scripts_dir.."/resources/config.lua");
dofile(scripts_dir.."/resources/functions/config.lua");
dofile(config());
--connect to the database
dofile(scripts_dir.."/resources/functions/database_handle.lua");

View File

@@ -39,7 +39,8 @@
--include config.lua
scripts_dir = string.sub(debug.getinfo(1).source,2,string.len(debug.getinfo(1).source)-(string.len(argv[0])+1));
dofile(scripts_dir.."/resources/config.lua");
dofile(scripts_dir.."/resources/functions/config.lua");
dofile(config());
--connect to the database
dofile(scripts_dir.."/resources/functions/database_handle.lua");

View File

@@ -29,7 +29,8 @@ extension = argv[1];
--include config.lua
scripts_dir = string.sub(debug.getinfo(1).source,2,string.len(debug.getinfo(1).source)-(string.len(argv[0])+1));
dofile(scripts_dir.."/resources/config.lua");
dofile(scripts_dir.."/resources/functions/config.lua");
dofile(config());
--add the file_exists function
dofile(scripts_dir.."/resources/functions/file_exists.lua");

View File

@@ -32,7 +32,8 @@
--include config.lua
scripts_dir = string.sub(debug.getinfo(1).source,2,string.len(debug.getinfo(1).source)-(string.len(argv[0])+1));
dofile(scripts_dir.."/resources/config.lua");
dofile(scripts_dir.."/resources/functions/config.lua");
dofile(config());
--connect to the database
if (file_exists(database_dir.."/core.db") then

View File

@@ -33,7 +33,8 @@
--include config.lua
scripts_dir = string.sub(debug.getinfo(1).source,2,string.len(debug.getinfo(1).source)-(string.len(argv[0])+1));
dofile(scripts_dir.."/resources/config.lua");
dofile(scripts_dir.."/resources/functions/config.lua");
dofile(config());
--connect to the database
dofile(scripts_dir.."/resources/functions/database_handle.lua");

View File

@@ -16,7 +16,8 @@
--include config.lua
scripts_dir = string.sub(debug.getinfo(1).source,2,string.len(debug.getinfo(1).source)-(string.len(argv[0])+1));
dofile(scripts_dir.."/resources/config.lua");
dofile(scripts_dir.."/resources/functions/config.lua");
dofile(config());
--connect to the database
--dbh = freeswitch.Dbh("core:core"); -- when using sqlite

View File

@@ -30,7 +30,8 @@
--include config.lua
scripts_dir = string.sub(debug.getinfo(1).source,2,string.len(debug.getinfo(1).source)-(string.len(argv[0])+1));
dofile(scripts_dir.."/resources/config.lua");
dofile(scripts_dir.."/resources/functions/config.lua");
dofile(config());
--connect to the database
--dbh = freeswitch.Dbh("core:core"); -- when using sqlite

View File

@@ -26,7 +26,8 @@
--include config.lua
scripts_dir = string.sub(debug.getinfo(1).source,2,string.len(debug.getinfo(1).source)-(string.len(argv[0])+1));
dofile(scripts_dir.."/resources/config.lua");
dofile(scripts_dir.."/resources/functions/config.lua");
dofile(config());
--connect to the database
dofile(scripts_dir.."/resources/functions/database_handle.lua");