[asterisk-commits] mmichelson: trunk r79907 - in /trunk: ./ apps/app_voicemail.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Aug 17 14:16:52 CDT 2007


Author: mmichelson
Date: Fri Aug 17 14:16:51 2007
New Revision: 79907

URL: http://svn.digium.com/view/asterisk?view=rev&rev=79907
Log:
Merged revisions 79906 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r79906 | mmichelson | 2007-08-17 14:14:05 -0500 (Fri, 17 Aug 2007) | 6 lines

Patch allows for more seamless transition from file storage voicemail to ODBC storage voicemail.
If a retrieval of a greeting from the database fails, but the file is found on the file system, then
we go ahead an insert the greeting into the database. The result of this is that people who
switch from file storage to ODBC storage do not need to rerecord their voicemail greetings.


........

Modified:
    trunk/   (props changed)
    trunk/apps/app_voicemail.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_voicemail.c?view=diff&rev=79907&r1=79906&r2=79907
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Fri Aug 17 14:16:51 2007
@@ -3061,10 +3061,19 @@
 
 	/* Play the beginning intro if desired */
 	if (!ast_strlen_zero(prefile)) {
-		RETRIEVE(prefile, -1, ext, context);
+#ifdef ODBC_STORAGE
+		int success = 
+#endif
+			RETRIEVE(prefile, -1);
 		if (ast_fileexists(prefile, NULL, NULL) > 0) {
 			if (ast_streamfile(chan, prefile, chan->language) > -1) 
 				res = ast_waitstream(chan, ecodes);
+#ifdef ODBC_STORAGE
+			if(success == -1) 
+				/*We couldn't retrieve the file from the database, but we found it on the file system. Let's put it in the database*/
+				ast_debug(1, "Greeting not retrieved from database, but found in file storage. Inserting into database\n");
+				store_file(prefile, vmu->mailbox, vmu->context, -1);
+#endif
 		} else {
 			ast_debug(1, "%s doesn't exist, doing what we can\n", prefile);
 			res = invent_message(chan, vmu->context, ext, ast_test_flag(options, OPT_BUSY_GREETING), ecodes);




More information about the asterisk-commits mailing list