aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-24 16:49:58 +0000
committerjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-24 16:49:58 +0000
commitbe877a7f0ab50da5f7f72a4d4a6c4b23f5c459f0 (patch)
treef520990832d1f630193b2a09f5bebac404d22069 /apps
parentd68f2256808b12acf600c5dafb27a83412d06bca (diff)
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 ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@213836 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_voicemail.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index d7796d2d9..79b7063b2 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1871,6 +1871,11 @@ static int imap_store_file(char *dir, char *mailboxuser, char *mailboxcontext, i
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")) {
ast_debug(3, "Setting message flag \\\\FLAGGED.\n");
@@ -4356,13 +4361,13 @@ static int add_email_attachment(FILE *p, struct ast_vm_user *vmu, char *format,
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)
@@ -11442,11 +11447,9 @@ static int play_record_review(struct ast_channel *chan, char *playfile, char *re
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;