[asterisk-commits] anthonyl: branch anthonyl/oldvoicemail-fwd
r50534 - /team/anthonyl/oldvoicema...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Thu Jan 11 15:36:24 MST 2007
Author: anthonyl
Date: Thu Jan 11 16:36:23 2007
New Revision: 50534
URL: http://svn.digium.com/view/asterisk?view=rev&rev=50534
Log:
working fix for the issue, i think i may want to make some implimentation changes as it generates a warning on compile
Modified:
team/anthonyl/oldvoicemail-fwd/apps/app_voicemail.c
Modified: team/anthonyl/oldvoicemail-fwd/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/oldvoicemail-fwd/apps/app_voicemail.c?view=diff&rev=50534&r1=50533&r2=50534
==============================================================================
--- team/anthonyl/oldvoicemail-fwd/apps/app_voicemail.c (original)
+++ team/anthonyl/oldvoicemail-fwd/apps/app_voicemail.c Thu Jan 11 16:36:23 2007
@@ -2646,7 +2646,7 @@
#endif
#ifndef IMAP_STORAGE
/* copy message only used by file storage */
-static int copy_message(struct ast_channel *chan, struct ast_vm_user *vmu, int imbox, int msgnum, long duration, struct ast_vm_user *recip, char *fmt)
+static int copy_message(struct ast_channel *chan, struct ast_vm_user *vmu, int imbox, int msgnum, long duration, struct ast_vm_user *recip, char *fmt, char *dir)
{
char fromdir[PATH_MAX], todir[PATH_MAX], frompath[PATH_MAX], topath[PATH_MAX];
const char *frombox = mbox(imbox);
@@ -2655,10 +2655,13 @@
ast_log(LOG_NOTICE, "Copying message from %s@%s to %s@%s\n", vmu->mailbox, vmu->context, recip->mailbox, recip->context);
create_dirpath(todir, sizeof(todir), recip->context, recip->mailbox, "INBOX");
-
- make_dir(fromdir, sizeof(fromdir), vmu->context, vmu->mailbox, frombox);
+
+ if (!dir)
+ make_dir(fromdir, sizeof(fromdir), vmu->context, vmu->mailbox, frombox);
+ else
+ ast_copy_string(&fromdir, dir, sizeof(fromdir));
+
make_file(frompath, sizeof(frompath), fromdir, msgnum);
-
if (vm_lock_path(todir))
return ERROR_LOCK_PATH;
@@ -3162,7 +3165,7 @@
context++;
}
if ((recip = find_user(&recipu, context, exten))) {
- copy_message(chan, vmu, 0, msgnum, duration, recip, fmt);
+ copy_message(chan, vmu, 0, msgnum, duration, recip, fmt, NULL);
free_user(recip);
}
}
@@ -4162,7 +4165,7 @@
/* NULL category for IMAP storage */
sendmail(myserveremail, vmtmp, todircount, vmtmp->context, vmtmp->mailbox, S_OR(chan->cid.cid_num, NULL), S_OR(chan->cid.cid_name, NULL), vms->fn, fmt, duration, attach_user_voicemail, chan, NULL);
#else
- copy_message(chan, sender, 0, curmsg, duration, vmtmp, fmt);
+ copy_message(chan, sender, 0, curmsg, duration, vmtmp, fmt, dir);
#endif
saved_messages++;
AST_LIST_REMOVE_CURRENT(&extensions, list);
More information about the asterisk-commits
mailing list