[asterisk-commits] jpeeler: branch 1.6.1 r213835 - in /branches/1.6.1: ./ apps/app_voicemail.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Aug 24 11:49:07 CDT 2009


Author: jpeeler
Date: Mon Aug 24 11:49:02 2009
New Revision: 213835

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=213835
Log:
Merged revisions 213833 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r213833 | jpeeler | 2009-08-24 11:43:57 -0500 (Mon, 24 Aug 2009) | 14 lines
  
  Fix storage of greetings when using IMAP_STORAGE
  
  The store macro was not getting called preventing storage of IMAP greetings
  at all. This has been corrected along with fixing checking if the
  imapgreetings option is turned on to store the greeting in IMAP. Lastly,
  the attachment filename was incorrectly using the full path instead of just
  the basename, which was causing problems with retrieval of the greeting.
  
  (closes issue #14950)
  Reported by: noahisaac
  
  (closes issue #15729)
  Reported by: lmadsen
........

Modified:
    branches/1.6.1/   (props changed)
    branches/1.6.1/apps/app_voicemail.c

Propchange: branches/1.6.1/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.1/apps/app_voicemail.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.1/apps/app_voicemail.c?view=diff&rev=213835&r1=213834&r2=213835
==============================================================================
--- branches/1.6.1/apps/app_voicemail.c (original)
+++ branches/1.6.1/apps/app_voicemail.c Mon Aug 24 11:49:02 2009
@@ -1744,6 +1744,11 @@
 	STRING str;
 	int ret; /* for better error checking */
 	char *imap_flags = NIL;
+
+    /* Back out early if this is a greeting and we don't want to store greetings in IMAP */
+    if (msgnum < 0 && !imapgreetings) {
+        return 0;
+    }
 
 	/* Set urgent flag for IMAP message */
 	if (!ast_strlen_zero(flag) && !strcmp(flag, "Urgent")) {
@@ -4228,13 +4233,13 @@
 	if (msgnum > -1)
 		fprintf(p, "Content-Type: %s%s; name=\"%s\"" ENDL, ctype, format, filename);
 	else
-		fprintf(p, "Content-Type: %s%s; name=\"%s.%s\"" ENDL, ctype, format, attach, format);
+		fprintf(p, "Content-Type: %s%s; name=\"%s.%s\"" ENDL, ctype, format, greeting_attachment, format);
 	fprintf(p, "Content-Transfer-Encoding: base64" ENDL);
 	fprintf(p, "Content-Description: Voicemail sound attachment." ENDL);
 	if (msgnum > -1)
 		fprintf(p, "Content-Disposition: attachment; filename=\"%s\"" ENDL ENDL, filename);
 	else
-		fprintf(p, "Content-Disposition: attachment; filename=\"%s.%s\"" ENDL ENDL, attach, format);
+		fprintf(p, "Content-Disposition: attachment; filename=\"%s.%s\"" ENDL ENDL, greeting_attachment, format);
 	snprintf(fname, sizeof(fname), "%s.%s", attach, format);
 	base_encode(fname, p);
 	if (last)
@@ -11311,11 +11316,9 @@
 					ast_filerename(tempfile, recordfile, NULL);
 				ast_stream_and_wait(chan, "vm-msgsaved", "");
 				if (!outsidecaller) {
-					/* Saves to IMAP server - but SHOULD save to filesystem ONLY if recording greetings! */
-#ifndef IMAP_STORAGE
+					/* Saves to IMAP server only if imapgreeting=yes */
 					STORE(recordfile, vmu->mailbox, vmu->context, -1, chan, vmu, fmt, *duration, vms, flag);
 					DISPOSE(recordfile, -1);
-#endif
 				}
 				cmd = 't';
 				return res;




More information about the asterisk-commits mailing list