[Freeswitch-svn] [commit] r2803 - freeswitch/branches/voctel/src/mod/applications/mod_phonecard

Freeswitch SVN voctel at freeswitch.org
Sat Sep 23 02:23:40 EDT 2006


Author: voctel
Date: Sat Sep 23 02:23:39 2006
New Revision: 2803

Modified:
   freeswitch/branches/voctel/src/mod/applications/mod_phonecard/mod_phonecard.c

Log:
more compile fixes

Modified: freeswitch/branches/voctel/src/mod/applications/mod_phonecard/mod_phonecard.c
==============================================================================
--- freeswitch/branches/voctel/src/mod/applications/mod_phonecard/mod_phonecard.c	(original)
+++ freeswitch/branches/voctel/src/mod/applications/mod_phonecard/mod_phonecard.c	Sat Sep 23 02:23:39 2006
@@ -31,7 +31,6 @@
  *
  */
 #include <switch.h>
-#include <mod_phonecard.h>
 
 //-- PostgreSQL 
 #include <libpq-fe.h>
@@ -55,19 +54,24 @@
 
 switch_mutex_t *db_lock;
 
+//-- Function Prototypes
+static int phonecard_dbconnected(void);
+static void phonecard_main(switch_core_session_t *session, char *data)
+
+
 //-- function used to connect/verify database connection
-int db_connected(void) {
+static int phonecard_dbconnected(void) {
     PGresult *result;
 
 	//-- check to see if we are already connected
-	if (dbconnected) {
+	if (db_connected) {
         result = PQexec(DBConn,"SELECT 1");
 
         PQclear(result);
 
         //-- check for connectivity
         if (PQstatus(DBConn)!= CONNECTION_OK) {
-            dbconnected = 0;
+            db_connected = 0;
 
             PQreset(DBConn);
 
@@ -80,7 +84,7 @@
 	}
 	else {
 		//-- we are not connected - so make the initial connection
-        DBConn = PQsetdbLogin(dbhost, dbport, NULL, NULL, dbname, dbuser, dbpass);
+        DBConn = PQsetdbLogin(db_hostname, db_port, NULL, NULL, db_name, db_username, db_password);
         if (PQstatus(DBConn) != CONNECTION_OK) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "FATAL - Couldn't connect to database server '%s'. \n", db_hostname);
 			db_connected = 0;



More information about the Freeswitch-svn mailing list