Add ability to store voicemail in ODBC database

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4349 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.2-netsec
Mark Spencer 21 years ago
parent 1406e38d8f
commit e95fa2a065

@ -50,14 +50,11 @@ APPS+=$(shell if [ -f /usr/local/include/zaptel.h ]; then echo "app_zapras.so ap
APPS+=$(shell if [ -f /usr/include/osp/osp.h ]; then echo "app_osplookup.so" ; fi) APPS+=$(shell if [ -f /usr/include/osp/osp.h ]; then echo "app_osplookup.so" ; fi)
CFLAGS+=-fPIC CFLAGS+=-fPIC
#
ifeq ($(USE_POSTGRES_VM_INTERFACE),1) # If you have MySQL 4.1 or later you can use ODBC
CFLAGS+=-DUSEPOSTGRESVM # storage
endif #
#CFLAGS+=-DUSE_ODBC_STORAGE
ifeq ($(USE_MYSQL_VM_INTERFACE),1)
CFLAGS+=-DUSEMYSQLVM
endif
all: $(APPS) all: $(APPS)

File diff suppressed because it is too large Load Diff

@ -588,13 +588,13 @@ static int alsa_write(struct ast_channel *chan, struct ast_frame *f)
} else { } else {
if (res == -ESTRPIPE) { if (res == -ESTRPIPE) {
ast_log(LOG_ERROR, "You've got some big problems\n"); ast_log(LOG_ERROR, "You've got some big problems\n");
} } else if (res < 0)
if (res > 0) ast_log(LOG_NOTICE, "Error %d on write\n", res);
res = 0;
} }
} }
ast_mutex_unlock(&alsalock); ast_mutex_unlock(&alsalock);
if (res > 0)
res = 0;
return res; return res;
} }

@ -30,4 +30,5 @@
;iaxfriends => odbc,asterisk ;iaxfriends => odbc,asterisk
;sipfriends => odbc,asterisk ;sipfriends => odbc,asterisk
;voicemail => odbc,asterisk ;voicemail => odbc,asterisk
;extensions => odbc,asterisk

@ -1,17 +1,17 @@
;;; odbc setup file ;;; odbc setup file
[mysql1] [asterisk]
dsn => MySQL-asterisk dsn => asterisk
username => myuser ;username => myuser
password => mypass ;password => mypass
pre-connect => yes pre-connect => yes
[mysql2] ;[mysql2]
dsn => MySQL-asterisk ;dsn => MySQL-asterisk
username => myuser ;username => myuser
password => mypass ;password => mypass
pre-connect => yes ;pre-connect => yes

@ -58,3 +58,21 @@ A Voicemail table would look more like this:
The uniqueid should be unique to each voicemail user and can be The uniqueid should be unique to each voicemail user and can be
autoincrement. It need not have any relation to the mailbox or context. autoincrement. It need not have any relation to the mailbox or context.
An extension table would look more like this:
+----------+---------+----------+-------+-----------+
| context | exten | priority | app | appdata |
+----------+---------+----------+-------+-----------+
| default | 1234 | 1 | Dial | Zap/1 |
+----------+---------+----------+-------+-----------+
In the dialplan you just use the Realtime switch:
[foo]
switch => Realtime
or:
[bar]
switch => Realtime/bar@extensions

Loading…
Cancel
Save