Adjust the LUA database connection to accommodate native PostgreSQL support and the recent change to the database connection syntax.

This commit is contained in:
Mark Crane
2013-03-31 08:18:41 +00:00
parent 3483c7134b
commit ac203b91ed
17 changed files with 169 additions and 215 deletions

View File

@@ -28,11 +28,14 @@
--if the call has been answered
--then send presence terminate, and delete from the database
--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");
--connect to the database
--ODBC - data source name
--local dbh = freeswitch.Dbh("name","user","pass");
--FreeSWITCH core db
local dbh = freeswitch.Dbh("core:park");
--dbh = freeswitch.Dbh("core:core"); -- when using sqlite
dbh = freeswitch.Dbh("sqlite://"..database_dir.."/park.db");
--dbh = freeswitch.Dbh(database["system"]);
--get the argv values
script_name = argv[0];