summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins2 <jenkins2@gerrit.asterisk.org>2017-07-26 06:49:41 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-07-26 06:49:41 -0500
commit8c6dcbcc6e99078f55e077cc3493c44416e31552 (patch)
tree05235c2a75913cb822207a818300e6743b806056
parent51ef6a8b6c74f8cc0ceb7324b43f766fb9dd88df (diff)
parent922930753cf82044394935c739527bb868cb9efc (diff)
Merge "app_voicemail.c: Allow mailbox entry on authentication retry prompt."
-rw-r--r--apps/app_voicemail.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 956b951fd..0a07cc103 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -11064,7 +11064,7 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
int skipuser, int max_logins, int silent)
{
int useadsi = 0, valid = 0, logretries = 0;
- char password[AST_MAX_EXTENSION]="", *passptr;
+ char password[AST_MAX_EXTENSION], *passptr;
struct ast_vm_user vmus, *vmu = NULL;
/* If ADSI is supported, setup login screen */
@@ -11106,7 +11106,8 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
adsi_password(chan);
if (!ast_strlen_zero(prefix)) {
- char fullusername[80] = "";
+ char fullusername[80];
+
ast_copy_string(fullusername, prefix, sizeof(fullusername));
strncat(fullusername, mailbox, sizeof(fullusername) - 1 - strlen(fullusername));
ast_copy_string(mailbox, fullusername, mailbox_size);
@@ -11164,6 +11165,10 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
free_user(vmu);
return -1;
}
+ if (ast_waitstream(chan, "")) { /* Channel is hung up */
+ free_user(vmu);
+ return -1;
+ }
} else {
if (useadsi)
adsi_login(chan);
@@ -11173,10 +11178,6 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
return -1;
}
}
- if (ast_waitstream(chan, "")) { /* Channel is hung up */
- free_user(vmu);
- return -1;
- }
}
}
if (!valid && (logretries >= max_logins)) {