Make filename on email follow subject message number, purely for cosmetic purposes...
authorJoshua Colp <jcolp@digium.com>
Thu, 22 Feb 2007 00:05:00 +0000 (00:05 +0000)
committerJoshua Colp <jcolp@digium.com>
Thu, 22 Feb 2007 00:05:00 +0000 (00:05 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@56005 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c

index 1b1f9fb..4c06935 100644 (file)
@@ -1970,7 +1970,7 @@ static void make_email_file(FILE *p, char *srcemail, struct ast_vm_user *vmu, in
        fprintf(p, "MIME-Version: 1.0\r\n");
        if (attach_user_voicemail) {
                /* Something unique. */
-               snprintf(bound, sizeof(bound), "voicemail_%d%s%d%d", msgnum, mailbox, getpid(), (unsigned int)ast_random());
+               snprintf(bound, sizeof(bound), "voicemail_%d%s%d%d", msgnum + 1, mailbox, getpid(), (unsigned int)ast_random());
 
                fprintf(p, "Content-Type: multipart/mixed; boundary=\"%s\"\r\n\r\n\r\n", bound);
 
@@ -2018,19 +2018,19 @@ static void make_email_file(FILE *p, char *srcemail, struct ast_vm_user *vmu, in
                                ast_log(LOG_DEBUG, "VOLGAIN: Stored at: %s.%s - Level: %.4f - Mailbox: %s\n", attach, format, vmu->volgain, mailbox);
                }
                fprintf(p, "--%s\r\n", bound);
-               fprintf(p, "Content-Type: %s%s; name=\"msg%04d.%s\"\r\n", ctype, format, msgnum, format);
+               fprintf(p, "Content-Type: %s%s; name=\"msg%04d.%s\"\r\n", ctype, format, msgnum + 1, format);
                fprintf(p, "Content-Transfer-Encoding: base64\r\n");
                fprintf(p, "Content-Description: Voicemail sound attachment.\r\n");
-               fprintf(p, "Content-Disposition: attachment; filename=\"msg%04d.%s\"\r\n\r\n", msgnum, format);
+               fprintf(p, "Content-Disposition: attachment; filename=\"msg%04d.%s\"\r\n\r\n", msgnum + 1, format);
                snprintf(fname, sizeof(fname), "%s.%s", attach, format);
                base_encode(fname, p);
                /* only attach if necessary */
                if (imap && !strcmp(format, "gsm")) {
                        fprintf(p, "--%s\r\n", bound);
-                       fprintf(p, "Content-Type: audio/x-gsm; name=\"msg%04d.%s\"\r\n", msgnum, format);
+                       fprintf(p, "Content-Type: audio/x-gsm; name=\"msg%04d.%s\"\r\n", msgnum + 1, format);
                        fprintf(p, "Content-Transfer-Encoding: base64\r\n");
                        fprintf(p, "Content-Description: Voicemail sound attachment.\r\n");
-                       fprintf(p, "Content-Disposition: attachment; filename=\"msg%04d.gsm\"\r\n\r\n", msgnum);
+                       fprintf(p, "Content-Disposition: attachment; filename=\"msg%04d.gsm\"\r\n\r\n", msgnum + 1);
                        snprintf(fname, sizeof(fname), "%s.gsm", attach);
                        base_encode(fname, p);
                }