[Asterisk-cvs] asterisk/apps Makefile,1.14,1.15 app_voicemail2.c,1.45,1.46

markster at lists.digium.com markster at lists.digium.com
Wed Sep 3 23:19:34 CDT 2003


Update of /usr/cvsroot/asterisk/apps
In directory mongoose.digium.com:/tmp/cvs-serv5953/apps

Modified Files:
	Makefile app_voicemail2.c 
Log Message:
More mysql patches


Index: Makefile
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/Makefile,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** Makefile	28 Aug 2003 16:42:15 -0000	1.14
--- Makefile	4 Sep 2003 04:20:43 -0000	1.15
***************
*** 12,19 ****
  #
  
! USE_MYSQL_VM_INTERFACE=0
  
  MLFLAGS=
  ifeq ($(USE_MYSQL_VM_INTERFACE),1)
  CFLAGS+=$(shell if [ -d /usr/local/mysql/include ]; then echo "-I/usr/local/mysql/include"; fi)
  CFLAGS+=$(shell if [ -d /usr/include/mysql ]; then echo "-I/usr/include/mysql"; fi)
--- 12,20 ----
  #
  
! USE_MYSQL_VM_INTERFACE=1
  
  MLFLAGS=
  ifeq ($(USE_MYSQL_VM_INTERFACE),1)
+ CFLAGS+=-DUSEMYSQLVM
  CFLAGS+=$(shell if [ -d /usr/local/mysql/include ]; then echo "-I/usr/local/mysql/include"; fi)
  CFLAGS+=$(shell if [ -d /usr/include/mysql ]; then echo "-I/usr/include/mysql"; fi)
***************
*** 66,70 ****
--- 67,75 ----
  
  app_voicemail2.so : app_voicemail2.o
+ ifeq ($(USE_MYSQL_VM_INTERFACE),1)
+ 	$(CC) -shared -Xlinker -x -o $@ $(MLFLAGS) $< -lmysqlclient -lz
+ else
  	$(CC) -shared -Xlinker -x -o $@ $(MLFLAGS) $<
+ endif
  
  app_sql_postgres.o: app_sql_postgres.c

Index: app_voicemail2.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_voicemail2.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -d -r1.45 -r1.46
*** app_voicemail2.c	4 Sep 2003 04:13:21 -0000	1.45
--- app_voicemail2.c	4 Sep 2003 04:20:43 -0000	1.46
***************
*** 36,40 ****
  #include <time.h>
  #ifdef USEMYSQLVM
! #include <mysql/mysql.h>
  #endif
  
--- 36,40 ----
  #include <time.h>
  #ifdef USEMYSQLVM
! #include <mysql.h>
  #endif
  
***************
*** 187,190 ****
--- 187,191 ----
  char dbuser[80];
  char dbpass[80];
+ char dbhost[80];
  char dbname[80];
  
***************
*** 194,202 ****
  
  	dbhandler=mysql_init(NULL);
! 	if (!mysql_real_connect(dbhandler, NULL, dbuser, dbpass, dbname, 0, NULL, 0)) {
  		ast_log(LOG_WARNING, "Error Logging into database\n");
  		return(-1);
  	}
! 	ast_mutex_init(&mysqllock, NULL);
  	return(0);
  }
--- 195,203 ----
  
  	dbhandler=mysql_init(NULL);
! 	if (!mysql_real_connect(dbhandler, dbhost[0] ? dbhost : NULL, dbuser, dbpass, dbname, 0, NULL, 0)) {
  		ast_log(LOG_WARNING, "Error Logging into database\n");
  		return(-1);
  	}
! 	ast_mutex_init(&mysqllock);
  	return(0);
  }
***************
*** 2968,2971 ****
--- 2969,2977 ----
  		} else {
  			strcpy(dbpass, s);
+ 		}
+ 		if (!(s=ast_variable_retrieve(cfg, "general", "dbhost"))) {
+ 			strcpy(dbhost, "");
+ 		} else {
+ 			strcpy(dbhost, s);
  		}
  		if (!(s=ast_variable_retrieve(cfg, "general", "dbname"))) {




More information about the svn-commits mailing list