One has to create the path and filename in order to copy a file there. (issue #8278...
authorJoshua Colp <jcolp@digium.com>
Fri, 3 Nov 2006 19:15:07 +0000 (19:15 +0000)
committerJoshua Colp <jcolp@digium.com>
Fri, 3 Nov 2006 19:15:07 +0000 (19:15 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47146 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c

index a9c7537..e6efb09 100644 (file)
@@ -2544,12 +2544,14 @@ static int copy_message(struct ast_channel *chan, struct ast_vm_user *vmu, int i
 
        make_dir(fromdir, sizeof(fromdir), vmu->context, vmu->mailbox, frombox);
        make_file(frompath, sizeof(frompath), fromdir, msgnum);
 
        make_dir(fromdir, sizeof(fromdir), vmu->context, vmu->mailbox, frombox);
        make_file(frompath, sizeof(frompath), fromdir, msgnum);
+       make_dir(todir, sizeof(todir), recip->context, recip->mailbox, frombox);
 
        if (vm_lock_path(todir))
                return ERROR_LOCK_PATH;
 
        recipmsgnum = last_message_index(recip, todir) + 1;
        if (recipmsgnum < recip->maxmsg) {
 
        if (vm_lock_path(todir))
                return ERROR_LOCK_PATH;
 
        recipmsgnum = last_message_index(recip, todir) + 1;
        if (recipmsgnum < recip->maxmsg) {
+               make_file(topath, sizeof(topath), todir, recipmsgnum);
                COPY(fromdir, msgnum, todir, recipmsgnum, recip->mailbox, recip->context, frompath, topath);
        } else {
                ast_log(LOG_ERROR, "Recipient mailbox %s@%s is full\n", recip->mailbox, recip->context);
                COPY(fromdir, msgnum, todir, recipmsgnum, recip->mailbox, recip->context, frompath, topath);
        } else {
                ast_log(LOG_ERROR, "Recipient mailbox %s@%s is full\n", recip->mailbox, recip->context);