aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_voicemail.c
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-19 22:34:03 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-19 22:34:03 +0000
commit292186f8a8c9e342c1fb9379775871ab242ce5ee (patch)
tree42313a414dd421dbcdd2cb54c276b4e6849cda76 /apps/app_voicemail.c
parentc342cdeaf3a971c5df904b312539c7c3082c60f5 (diff)
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) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@124180 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_voicemail.c')
-rw-r--r--apps/app_voicemail.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 672a3e6bd..646eec316 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1233,9 +1233,9 @@ static int make_gsm_file(char *dest, size_t len, char *imapuser, char *dir, int
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/%s%04d", dir, prefix, num);
}
- return snprintf(dest, len, "%s/%smsg%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 @@ static void make_email_file(FILE *p, char *srcemail, struct ast_vm_user *vmu, in
"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);
@@ -5313,7 +5313,6 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
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
* two_part will be set to 0 if there are two parts, otherwise -1 */