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 0e9c9c5753
commit 4930d592e1
17 changed files with 169 additions and 215 deletions
@@ -30,14 +30,7 @@
digit_timeout = 5000;
--connect to the database
--ODBC - data source name
if (dsn_name) then
dbh = freeswitch.Dbh(dsn_name,dsn_username,dsn_password);
end
--FreeSWITCH core db handler
if (db_type == "sqlite") then
dbh = freeswitch.Dbh("sqlite://"..db_path.."/"..db_name);
end
dbh = freeswitch.Dbh(database["system"]);
--prepare the api object
api = freeswitch.API();
@@ -151,14 +144,7 @@
end_epoch = os.time();
--connect to the database
--ODBC - data source name
if (dsn_name) then
dbh = freeswitch.Dbh(dsn_name,dsn_username,dsn_password);
end
--FreeSWITCH core db handler
if (db_type == "sqlite") then
dbh = freeswitch.Dbh("sqlite://"..db_path.."/"..db_name);
end
dbh = freeswitch.Dbh(database["system"]);
--get the conference sessions
sql = [[SELECT count(*) as num_rows
@@ -613,6 +599,9 @@
end
end
--close the database connection
dbh:release();
--send the call to the conference
profile = "default";
cmd = meeting_uuid.."-"..domain_name.."@"..profile.."+flags{".. flags .."}";
@@ -49,14 +49,7 @@
password_tries = 0;
--connect to the database
--ODBC - data source name
if (dsn_name) then
dbh = freeswitch.Dbh(dsn_name,dsn_username,dsn_password);
end
--FreeSWITCH core db handler
if (db_type == "sqlite") then
dbh = freeswitch.Dbh("sqlite://"..db_path.."/"..db_name);
end
dbh = freeswitch.Dbh(database["system"]);
--set the api
api = freeswitch.API();
@@ -282,7 +275,7 @@
end
--close the database connection
--dbh:release();
dbh:release();
--notes
--record the video