summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2017-07-19 18:11:19 -0500
committerRichard Mudgett <rmudgett@digium.com>2017-07-21 16:16:47 -0500
commit5125374821e28fdbf8adfe663874a6c0c9ca423b (patch)
treea0094a708977c9242e600b008784c63e67b3e657 /apps
parent74d2ddef4ff1ec4616dfbec5a5087a8a3d3a4ee0 (diff)
app_voicemail.c: Allow mailbox entry on authentication retry prompt.
The following testsuite voicemail tests were failing to re-enter the mailbox after the first login attempt. tests/apps/voicemail/authenticate_invalid_mailbox tests/apps/voicemail/authenticate_invalid_password The tests were noting the start of the vm-incorrect-mailbox prompt and immediately sending the mailbox for the next login attempt. Since the invalid message playback had to complete before the digits were recognized, the test passed for the wrong reason and added approximately 20 seconds to the test times. * Allow the vm-incorrect-mailbox prompt to get interrupted by the mailbox digits like the initial vm-login prompt so the tests are able to enter the intended mailbox. Change-Id: I1dc53fe917bfe03a4587b2c4cd24c94696a69df8
Diffstat (limited to 'apps')
-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 19a5d317d..e25ea8850 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -11066,7 +11066,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 */
@@ -11108,7 +11108,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);
@@ -11166,6 +11167,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);
@@ -11175,10 +11180,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)) {