summaryrefslogtreecommitdiff
path: root/apps/app_directory.c
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2005-09-15 01:31:49 +0000
committerKevin P. Fleming <kpfleming@digium.com>2005-09-15 01:31:49 +0000
commit981970c57bc69e3837728ea82251f511ebbd809c (patch)
tree982b7fa34cc1967f3134176041dc7ed5e41b07e7 /apps/app_directory.c
parent44e3b6feb146b4f84215ac19a008967ef867444f (diff)
_really_ fix app_directory (doh... how did I miss this before?) (issue #5232, take two)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6611 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_directory.c')
-rwxr-xr-xapps/app_directory.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/apps/app_directory.c b/apps/app_directory.c
index 39b7488c6..0c616b9f4 100755
--- a/apps/app_directory.c
+++ b/apps/app_directory.c
@@ -193,7 +193,7 @@ static int play_mailbox_owner(struct ast_channel *chan, char *context, char *dia
case '1':
/* Name selected */
loop = 0;
- if (!ast_goto_if_exists(chan, dialcontext, ext, 1)) {
+ if (ast_goto_if_exists(chan, dialcontext, ext, 1)) {
ast_log(LOG_WARNING,
"Can't find extension '%s' in context '%s'. "
"Did you pass the wrong context to Directory?\n",
@@ -300,25 +300,20 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, char *
return -1;
}
if (digit == '0') {
- if (ast_exists_extension(chan,chan->context,"o",1,chan->cid.cid_num) ||
+ if (!ast_goto_if_exists(chan, chan->context, "o", 1) ||
(!ast_strlen_zero(chan->macrocontext) &&
- ast_exists_extension(chan, chan->macrocontext, "o", 1, chan->cid.cid_num))) {
- strcpy(chan->exten, "o");
- chan->priority = 0;
+ !ast_goto_if_exists(chan, chan->macrocontext, "o", 1))) {
return 0;
} else {
-
ast_log(LOG_WARNING, "Can't find extension 'o' in current context. "
"Not Exiting the Directory!\n");
res = 0;
}
}
if (digit == '*') {
- if (ast_exists_extension(chan,chan->context,"a",1,chan->cid.cid_num) ||
+ if (!ast_goto_if_exists(chan, chan->context, "a", 1) ||
(!ast_strlen_zero(chan->macrocontext) &&
- ast_exists_extension(chan, chan->macrocontext, "a", 1, chan->cid.cid_num))) {
- strcpy(chan->exten, "a");
- chan->priority = 0;
+ !ast_goto_if_exists(chan, chan->macrocontext, "a", 1))) {
return 0;
} else {
ast_log(LOG_WARNING, "Can't find extension 'a' in current context. "
@@ -375,11 +370,11 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, char *
lastuserchoice = 0;
break;
case '1':
- /* user pressed '1' and extensions exists */
+ /* user pressed '1' and extensions exists;
+ play_mailbox_owner will already have done
+ a goto() on the channel
+ */
lastuserchoice = res;
- ast_copy_string(chan->context, dialcontext, sizeof(chan->context));
- ast_copy_string(chan->exten, v->name, sizeof(chan->exten));
- chan->priority = 0;
break;
case '*':
/* user pressed '*' to skip something found */