[svn-commits] mmichelson: trunk r124180 - /trunk/apps/app_voicemail.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jun 19 17:34:03 CDT 2008


Author: mmichelson
Date: Thu Jun 19 17:34:03 2008
New Revision: 124180

URL: http://svn.digium.com/view/asterisk?view=rev&rev=124180
Log:
Fix attachment behavior when using IMAP storage for voicemails
1. Filenames had an extra "msg" in the attachment name
2. The attachment was being saved twice

(closes issue #12894)
Reported by: jaroth
Patches:
      imap_attach.patch uploaded by jaroth (license 50)


Modified:
    trunk/apps/app_voicemail.c

Modified: trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_voicemail.c?view=diff&rev=124180&r1=124179&r2=124180
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Thu Jun 19 17:34:03 2008
@@ -1233,9 +1233,9 @@
 	int res;
 	if ((res = ast_mkdir(dir, 01777))) {
 		ast_log(AST_LOG_WARNING, "ast_mkdir '%s' failed: %s\n", dir, strerror(res));
-		return snprintf(dest, len, "%s/%smsg%04d", dir, prefix, num);
-	}
-	return snprintf(dest, len, "%s/%smsg%04d", dir, prefix, num);
+		return snprintf(dest, len, "%s/%s%04d", dir, prefix, num);
+	}
+	return snprintf(dest, len, "%s/%s%04d", dir, prefix, num);
 }
 
 static void vm_imap_delete(int msgnum, struct vm_state *vms)
@@ -2539,7 +2539,7 @@
 				"Please do not delete this message, lest your greeting vanish with it." ENDL ENDL, date);
 	}
 
-	if (attach_user_voicemail) {
+	if (imap || attach_user_voicemail) {
 		if (!ast_strlen_zero(attach2)) {
 			snprintf(filename, sizeof(filename), "msgintro%04d.%s", msgnum, format);
 			ast_debug(5, "creating attachment filename %s\n", filename);
@@ -5312,7 +5312,6 @@
 				ast_debug(3, "Before mail_fetchstructure, message number is %ld, filename is:%s\n", vms->msgArray[vms->curmsg], vms->fn);
 				mail_fetchstructure(vms->mailstream, vms->msgArray[vms->curmsg], &body);
 				/* should not assume "fmt" here! */
-				save_body(body, vms, "2", fmt, vms->fn);
 				save_body(body, vms, "2", fmt, vms->fn);
   
 				/* second attachment would be body if intro, otherwise null




More information about the svn-commits mailing list