]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Enable mod_lua to use native pgsql dbh support
authorWilliam King <william.king@quentustech.com>
Thu, 8 Nov 2012 01:47:39 +0000 (17:47 -0800)
committerWilliam King <william.king@quentustech.com>
Thu, 8 Nov 2012 01:47:46 +0000 (17:47 -0800)
src/mod/languages/mod_lua/freeswitch_lua.cpp

index 679c9fbee40c9e27ada852a63de4cf8193aab496..32c01225bdc97d3da2f28296cf115ed9a44661d1 100644 (file)
@@ -342,6 +342,12 @@ Dbh::Dbh(char *dsn, char *user, char *pass)
     if (switch_cache_db_get_db_handle(&dbh, SCDB_TYPE_CORE_DB, &options) == SWITCH_STATUS_SUCCESS) {
       m_connected = true;
     }
+  } else if (!strncasecmp(dsn, "pgsql://", 8)) {
+    type = SCDB_TYPE_PGSQL;
+    options.pgsql_options.dsn = (char *)(dsn + 8);
+    if (switch_cache_db_get_db_handle(&dbh, SCDB_TYPE_PGSQL, &options) == SWITCH_STATUS_SUCCESS) {
+      m_connected = true;
+    }
   } else {
     options.odbc_options.dsn = dsn;
     options.odbc_options.user = user;