aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2010-04-21 21:45:36 +0000
committerjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2010-04-21 21:45:36 +0000
commit288f94f8375c554d255483a175007aa0ad9f6205 (patch)
treee80e5c30b9656b397a5a81c13079f9b94520b9ae /apps
parentf0275ea2c887a8112cd3f0433c9e24f71133ac0a (diff)
Fix looping forever when no input received in certain voicemail menu scenarios.
Specifically, prompting for an extension (when leaving or forwarding a message) or when prompting for a digit (when saving a message or changing folders). ABE-2122 SWP-1268 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@258432 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_voicemail.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index cdb868a72..cfd0d6528 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -5094,10 +5094,16 @@ static int get_folder(struct ast_channel *chan, int start)
static int get_folder2(struct ast_channel *chan, char *fn, int start)
{
int res = 0;
+ int loops = 0;
res = ast_play_and_wait(chan, fn); /* Folder name */
while (((res < '0') || (res > '9')) &&
- (res != '#') && (res >= 0)) {
+ (res != '#') && (res >= 0) &&
+ loops < 4) {
res = get_folder(chan, 0);
+ loops++;
+ }
+ if (loops == 4) { /* give up */
+ return '#';
}
return res;
}
@@ -5283,6 +5289,7 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
int valid_extensions = 0;
char *dir;
int curmsg;
+ int prompt_played = 0;
if (vms == NULL) return -1;
dir = vms->curdir;
@@ -5364,7 +5371,8 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
} else {
/* Ask for an extension */
res = ast_streamfile(chan, "vm-extension", chan->language); /* "extension" */
- if (res)
+ prompt_played++;
+ if (res || prompt_played > 4)
break;
if ((res = ast_readstring(chan, username, sizeof(username) - 1, 2000, 10000, "#") < 0))
break;