diff -Nru asterisk.orig/apps/Makefile asterisk/apps/Makefile --- asterisk.orig/apps/Makefile 2003-12-06 16:08:23.000000000 -0600 +++ asterisk/apps/Makefile 2003-12-06 16:55:03.000000000 -0600 @@ -11,7 +11,9 @@ # the GNU General Public License # +USESQLVM=0 USE_MYSQL_VM_INTERFACE=0 +USE_ODBC_VM_INTERFACE=0 USE_POSTGRES_VM_INTERFACE=0 #APPS=app_dial.so app_playback.so app_directory.so app_intercom.so app_mp3.so @@ -42,6 +44,10 @@ CFLAGS+=-DUSEPOSTGRESVM endif +ifeq ($(USE_ODBC_VM_INTERFACE),1) +CFLAGS+=-DUSEODBCVM +endif + ifeq ($(USE_MYSQL_VM_INTERFACE),1) CFLAGS+=-DUSEMYSQLVM endif @@ -70,12 +76,18 @@ ifeq ($(USE_MYSQL_VM_INTERFACE),1) $(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -lmysqlclient -lz else +ifeq ($(USE_ODBC_VM_INTERFACE),1) + $(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -lodbc +else ifeq ($(USE_POSTGRES_VM_INTERFACE),1) $(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -lpq else +ifeq ($(USESQLVM),0) $(CC) $(SOLINK) -o $@ $(MLFLAGS) $< endif endif +endif +endif app_sql_postgres.o: app_sql_postgres.c $(CC) -pipe -I/usr/local/pgsql/include $(CFLAGS) -c -o app_sql_postgres.o app_sql_postgres.c diff -Nru asterisk.orig/apps/app_voicemail.c asterisk/apps/app_voicemail.c --- asterisk.orig/apps/app_voicemail.c 2003-12-06 16:08:23.000000000 -0600 +++ asterisk/apps/app_voicemail.c 2003-12-06 16:34:52.000000000 -0600 @@ -42,6 +42,16 @@ #define USESQLVM 1 #endif +#ifdef USEODBCVM +/* + * unixODBC routines written by Brian K. West + */ +#include +#include +#include +#define USESQLVM 1 +#endif + #ifdef USEPOSTGRESVM /* * PostgreSQL routines written by Otmar Lendl @@ -206,6 +216,10 @@ #include "mysql-vm-routines.h" #endif +#ifdef USEODBCVM +#include "odbc-vm-routines.h" +#endif + #ifdef USEPOSTGRESVM PGconn *dbhandler; @@ -2829,6 +2843,24 @@ } #endif +#ifdef USEODBCVM + if (!(s=ast_variable_retrieve(cfg, "general", "odbcusername"))) { + strcpy(odbcusername, "test"); + } else { + strcpy(odbcusername, s); + } + if (!(s=ast_variable_retrieve(cfg, "general", "odbcpassword"))) { + strcpy(odbcpassword, "test"); + } else { + strcpy(odbcpassword, s); + } + if (!(s=ast_variable_retrieve(cfg, "general", "odbcdsn"))) { + strcpy(odbcdsn, "vmdb"); + } else { + strcpy(odbcdsn, s); + } +#endif + #ifdef USEPOSTGRESVM if (!(s=ast_variable_retrieve(cfg, "general", "dboption"))) { strcpy(dboption, "dboption not-specified in voicemail.conf");