aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_directory.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-09-07 19:13:00 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-09-07 19:13:00 +0000
commita21860310e9d59b024eaa4cd22e6d85dd8845941 (patch)
tree09d54e0b28af50c87bac02b87c93c36feb721cf9 /apps/app_directory.c
parentceace6fb1143f67f0b266c66e63f391840e0e89d (diff)
convert a bunch of apps to use ast_goto_if_exists() (issue #5138)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6533 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_directory.c')
-rwxr-xr-xapps/app_directory.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/apps/app_directory.c b/apps/app_directory.c
index ad21736c4..2c1729ef2 100755
--- a/apps/app_directory.c
+++ b/apps/app_directory.c
@@ -182,11 +182,7 @@ static int play_mailbox_owner(struct ast_channel *chan, char *context, char *dia
case '1':
/* Name selected */
loop = 0;
- if (ast_exists_extension(chan,dialcontext,ext,1,chan->cid.cid_num)) {
- ast_copy_string(chan->exten, ext, sizeof(chan->exten));
- chan->priority = 0;
- ast_copy_string(chan->context, dialcontext, sizeof(chan->context));
- } else {
+ 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",
@@ -293,11 +289,8 @@ 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) ||
- (!ast_strlen_zero(chan->macrocontext) &&
- ast_exists_extension(chan, chan->macrocontext, "o", 1, chan->cid.cid_num))) {
- strcpy(chan->exten, "o");
- chan->priority = 0;
+ if (ast_goto_if_exists(chan, chan->context, "o", 1) ||
+ (!ast_strlen_zero(chan->macrocontext) && ast_goto_if_exists(chan, chan->macrocontext, "o", 1))) {
return 0;
} else {
@@ -307,14 +300,10 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, char *
}
}
if (digit == '*') {
- if (ast_exists_extension(chan,chan->context,"a",1,chan->cid.cid_num) ||
- (!ast_strlen_zero(chan->macrocontext) &&
- ast_exists_extension(chan, chan->macrocontext, "a", 1, chan->cid.cid_num))) {
- strcpy(chan->exten, "a");
- chan->priority = 0;
+ if (ast_goto_if_exists(chan, chan->context, "a", 1) ||
+ (!ast_strlen_zero(chan->macrocontext) && ast_goto_if_exists(chan, chan->macrocontext, "a", 1))) {
return 0;
} else {
-
ast_log(LOG_WARNING, "Can't find extension 'a' in current context. "
"Not Exiting the Directory!\n");
res = 0;