From 2c48b5d9bfb96b6a976b822fd2da20b2b7221bf9 Mon Sep 17 00:00:00 2001
From: Bryan Boatright <ast-bugs@omega71.com>
Date: Wed, 2 Jan 2019 11:44:41 -0600
Subject: [PATCH] app_voicemail: Fix Channel variable VM_MESSAGEFILE for
 "urgent" voicemail

If a voicemail is marked "urgent" then the VM_MESSAGEFILE channel variable is
not updated correctly since urgent messages are in a different directory. The
fix is to update the channel variable when the path to the urgent message is
created.

ASTERISK-28225

Change-Id: I8efbace06e6122ea0793f7bdb073d4378e8274ca
---
 apps/app_voicemail.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index fb5ee88e56..d132e2b613 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -7091,6 +7091,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
 						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));
+						pbx_builtin_setvar_helper(chan, "VM_MESSAGEFILE", fn);
 						msgnum = x;
 					}
 #endif
-- 
GitLab