From 1bb19bec4b229943466d2834f70a002584f50d82 Mon Sep 17 00:00:00 2001
From: Mark Spencer <markster@digium.com>
Date: Thu, 4 Nov 2004 03:41:26 +0000
Subject: [PATCH] Fix VMAuthenticate application (bug #2775)

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

diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index cdfc57ebf7..058feaebfd 100755
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -3412,10 +3412,11 @@ static int vm_execmain(struct ast_channel *chan, void *data)
 			skipuser++;
 		else
 			valid = 0;
-
 	}
 
-	res = vm_authenticate(chan, vms.username, sizeof(vms.username), &vmus, context, prefixstr, skipuser, maxlogins);
+	if (!valid) {
+		res = vm_authenticate(chan, vms.username, sizeof(vms.username), &vmus, context, prefixstr, skipuser, maxlogins);
+	}
 
 	if (!res) {
 		valid = 1;
-- 
GitLab