mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 18:55:19 +00:00 
			
		
		
		
	Add ability to store voicemail in ODBC database
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4349 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		| @@ -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) | ||||
|  | ||||
| CFLAGS+=-fPIC | ||||
|  | ||||
| ifeq ($(USE_POSTGRES_VM_INTERFACE),1) | ||||
| CFLAGS+=-DUSEPOSTGRESVM | ||||
| endif | ||||
|  | ||||
| ifeq ($(USE_MYSQL_VM_INTERFACE),1) | ||||
| CFLAGS+=-DUSEMYSQLVM | ||||
| endif | ||||
| # | ||||
| # If you have MySQL 4.1 or later you can use ODBC | ||||
| # storage | ||||
| # | ||||
| #CFLAGS+=-DUSE_ODBC_STORAGE | ||||
|  | ||||
| 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 { | ||||
| 			if (res == -ESTRPIPE) { | ||||
| 				ast_log(LOG_ERROR, "You've got some big problems\n"); | ||||
| 			} | ||||
| 			if (res > 0) | ||||
| 				res = 0; | ||||
| 			} else if (res < 0) | ||||
| 				ast_log(LOG_NOTICE, "Error %d on write\n", res); | ||||
| 		} | ||||
| 	} | ||||
| 	ast_mutex_unlock(&alsalock); | ||||
|  | ||||
| 	if (res > 0) | ||||
| 		res = 0; | ||||
| 	return res; | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -30,4 +30,5 @@ | ||||
| ;iaxfriends => odbc,asterisk | ||||
| ;sipfriends => odbc,asterisk | ||||
| ;voicemail => odbc,asterisk | ||||
| ;extensions => odbc,asterisk | ||||
|  | ||||
|   | ||||
| @@ -1,17 +1,17 @@ | ||||
| ;;; odbc setup file  | ||||
|  | ||||
| [mysql1] | ||||
| dsn => MySQL-asterisk | ||||
| username => myuser | ||||
| password => mypass | ||||
| [asterisk] | ||||
| dsn => asterisk | ||||
| ;username => myuser | ||||
| ;password => mypass | ||||
| pre-connect => yes | ||||
|  | ||||
|  | ||||
| [mysql2] | ||||
| dsn => MySQL-asterisk | ||||
| username => myuser | ||||
| password => mypass | ||||
| pre-connect => yes | ||||
| ;[mysql2] | ||||
| ;dsn => MySQL-asterisk | ||||
| ;username => myuser | ||||
| ;password => mypass | ||||
| ;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  | ||||
| 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 | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user