From 5152e1989f6c3a9c20a68341106ab3b55edb6c3e Mon Sep 17 00:00:00 2001
From: Tilghman Lesher <tilghman@meg.abyt.es>
Date: Thu, 8 Dec 2005 23:46:21 +0000
Subject: [PATCH] Bug 5960

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7407 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 apps/app_voicemail.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 03ddc7bb20..dec07f918c 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -536,10 +536,10 @@ static struct ast_vm_user *find_user_realtime(struct ast_vm_user *ivm, const cha
 		if (mailbox) 
 			ast_copy_string(retval->mailbox, mailbox, sizeof(retval->mailbox));
 		populate_defaults(retval);
-		if (ast_test_flag((&globalflags), VM_SEARCH))
+		if (!context && ast_test_flag((&globalflags), VM_SEARCH))
 			var = ast_load_realtime("voicemail", "mailbox", mailbox, NULL);
 		else
-			var = ast_load_realtime("voicemail", "mailbox", mailbox, "context", retval->context, NULL);
+			var = ast_load_realtime("voicemail", "mailbox", mailbox, "context", context, NULL);
 		if (var) {
 			tmp = var;
 			while(tmp) {
-- 
GitLab