diff options
author | Mark Spencer <markster@digium.com> | 2003-05-26 23:29:04 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2003-05-26 23:29:04 +0000 |
commit | b27b9b09c651a39d04276f3b8577107083f81ee3 (patch) | |
tree | f775d3d886524cbf4bcb5532d13d7cf8a4ce2296 | |
parent | 8082927ba362f3ff1465679f5dfbd672e43a5b0a (diff) |
Fix attachment behavior in voicemail2
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1058 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rwxr-xr-x | apps/app_voicemail2.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/app_voicemail2.c b/apps/app_voicemail2.c index 0635525db..24ece1034 100755 --- a/apps/app_voicemail2.c +++ b/apps/app_voicemail2.c @@ -571,6 +571,7 @@ static int sendmail(char *srcemail, char *email, char *name, int msgnum, char *m struct tm tm; if (!strcmp(format, "wav49")) format = "WAV"; + ast_log(LOG_DEBUG, "Attaching file '%s', format '%s', uservm is '%d', global is %d\n", attach, format, attach_user_voicemail, attach_voicemail); p = popen(SENDMAIL, "w"); if (p) { gethostname(host, sizeof(host)); @@ -589,7 +590,7 @@ static int sendmail(char *srcemail, char *email, char *name, int msgnum, char *m fprintf(p, "Subject: [PBX]: New message %d in mailbox %s\n", msgnum, mailbox); fprintf(p, "Message-ID: <Asterisk-%d-%s-%d@%s>\n", msgnum, mailbox, getpid(), host); fprintf(p, "MIME-Version: 1.0\n"); - if ((attach_user_voicemail==-1 && attach_voicemail) || attach_user_voicemail==1) { + if (attach_user_voicemail) { // Something unique. snprintf(bound, sizeof(bound), "Boundary=%d%s%d", msgnum, mailbox, getpid()); @@ -604,7 +605,7 @@ static int sendmail(char *srcemail, char *email, char *name, int msgnum, char *m "in mailbox %s from %s, on %s so you might\n" "want to check it when you get a chance. Thanks!\n\n\t\t\t\t--Asterisk\n\n", name, dur, msgnum, mailbox, (callerid ? callerid : "an unknown caller"), date); - if ((attach_user_voicemail==-1 && attach_voicemail) || attach_user_voicemail==1) { + if (attach_user_voicemail) { fprintf(p, "--%s\n", bound); fprintf(p, "Content-Type: audio/x-wav; name=\"msg%04d.%s\"\n", msgnum, format); fprintf(p, "Content-Transfer-Encoding: BASE64\n"); @@ -2396,6 +2397,7 @@ static int append_mailbox(char *context, char *mbox, char *data) memset(vmu, 0, sizeof(struct ast_vm_user)); strncpy(vmu->context, context, sizeof(vmu->context)); strncpy(vmu->mailbox, mbox, sizeof(vmu->mailbox)); + vmu->attach = -1; stringp = tmp; if ((s = strsep(&stringp, ","))) strncpy(vmu->password, s, sizeof(vmu->password)); |