aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-06-28 15:08:39 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-06-28 15:08:39 +0000
commite4b3fe2ec6cbf35f8d01eb2b4f5549ffb51a3667 (patch)
treebf92217945dc01cebd4e8696ca93fdfa98801ce0 /apps
parent000fdda5cab78a8a69674eb40d80a3f31d541c12 (diff)
Directory fixes (bug #1887)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3329 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rwxr-xr-xapps/app_directory.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/app_directory.c b/apps/app_directory.c
index d3d899c86..1e2fe1869 100755
--- a/apps/app_directory.c
+++ b/apps/app_directory.c
@@ -128,7 +128,7 @@ static char *convert(char *lastname)
*/
static int play_mailbox_owner(struct ast_channel *chan, char *context, char *dialcontext, char *ext, char *name) {
int res = 0;
- int loop = -1;
+ int loop = 3;
char fn[256];
char fn2[256];
@@ -172,6 +172,7 @@ static int play_mailbox_owner(struct ast_channel *chan, char *context, char *dia
if (res > -1) {
switch (res) {
case '1':
+ /* Name selected */
loop = 0;
if (ast_exists_extension(chan,dialcontext,ext,1,chan->callerid)) {
strncpy(chan->exten, ext, sizeof(chan->exten)-1);
@@ -187,14 +188,21 @@ static int play_mailbox_owner(struct ast_channel *chan, char *context, char *dia
break;
case '*':
+ /* Skip to next match in list */
loop = 0;
break;
default:
+ /* Not '1', or '*', so decrement number of tries */
res = 0;
+ loop--;
break;
} /* end switch */
} /* end if */
+ else {
+ /* User hungup, so jump out now */
+ loop = 0;
+ }
} /* end while */
return(res);
@@ -261,7 +269,9 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, char *
res = play_mailbox_owner(chan, context, dialcontext, v->name, name);
switch (res) {
case -1:
- /* user pressed '1' but extension does not exist */
+ /* user pressed '1' but extension does not exist, or
+ * user hungup
+ */
lastuserchoice = 0;
break;
case '1':