Index: apps/app_voicemail.c =================================================================== --- apps/app_voicemail.c (revision 211714) +++ apps/app_voicemail.c (working copy) @@ -5323,11 +5323,14 @@ int x; /* It's easier just to try to make it than to check for its existence */ create_dirpath(urgdir, sizeof(urgdir), vmu->context, ext, "Urgent"); - ast_debug(5, "Created an Urgent message, moving file from %s to %s.\n",sfn,dfn); x = last_message_index(vmu, urgdir) + 1; make_file(sfn, sizeof(sfn), dir, msgnum); make_file(dfn, sizeof(dfn), urgdir, x); + ast_debug(5, "Created an Urgent message, moving file from %s to %s.\n",sfn,dfn); RENAME(dir, msgnum, vmu->mailbox, vmu->context, urgdir, x, sfn, dfn); + /* Notification must happen for this new message in Urgent folder, not INBOX */ + ast_copy_string(fn, dfn, sizeof(fn)); + msgnum = x; } #endif /* Notification needs to happen after the copy, though. */ @@ -6207,7 +6210,12 @@ } ast_channel_unlock(chan); - make_dir(todir, sizeof(todir), vmu->context, vmu->mailbox, "INBOX"); + if (!ast_strlen_zero(flag) && !strcmp(flag, "Urgent")) { + make_dir(todir, sizeof(todir), vmu->context, vmu->mailbox, "Urgent"); + } + else { + make_dir(todir, sizeof(todir), vmu->context, vmu->mailbox, "INBOX"); + } make_file(fn, sizeof(fn), todir, msgnum); snprintf(ext_context, sizeof(ext_context), "%s@%s", vmu->mailbox, vmu->context);