summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorMatthew Fredrickson <creslin@digium.com>2005-05-10 19:05:50 +0000
committerMatthew Fredrickson <creslin@digium.com>2005-05-10 19:05:50 +0000
commit2bdce17b5a39ce2fd78bd1278b92768a046ddcb3 (patch)
treef630647bb28746502107ddc9c9651607c6b8000b /apps
parente70d3db697df1d370fa173d7015c6195db278663 (diff)
Fix to bug 4118
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps')
-rwxr-xr-xapps/app_voicemail.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index c087e7de3..43c906130 100755
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -4409,6 +4409,14 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
}
if (useadsi)
adsi_password(chan);
+
+ if (prefix && !ast_strlen_zero(prefix)) {
+ char fullusername[80] = "";
+ strncpy(fullusername, prefix, sizeof(fullusername) - 1);
+ strncat(fullusername, mailbox, sizeof(fullusername) - 1 - strlen(fullusername));
+ strncpy(mailbox, fullusername, mailbox_size - 1);
+ }
+
vmu = find_user(&vmus, context, mailbox);
if (vmu && (vmu->password[0] == '\0' || (vmu->password[0] == '-' && vmu->password[1] == '\0'))) {
/* saved password is blank, so don't bother asking */
@@ -4423,12 +4431,7 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
return -1;
}
}
- if (prefix && !ast_strlen_zero(prefix)) {
- char fullusername[80] = "";
- strncpy(fullusername, prefix, sizeof(fullusername) - 1);
- strncat(fullusername, mailbox, sizeof(fullusername) - 1 - strlen(fullusername));
- strncpy(mailbox, fullusername, mailbox_size - 1);
- }
+
if (vmu) {
passptr = vmu->password;
if (passptr[0] == '-') passptr++;