From: Matthew Nicholson Date: Tue, 12 Jul 2011 20:07:20 +0000 (+0000) Subject: search in the current context for 'a' and 'o' instead of 'default' X-Git-Tag: 1.8.6.0-rc1~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3769e99537329fcdd0cd4d84462bf5e939b9aba4;p=thirdparty%2Fasterisk.git search in the current context for 'a' and 'o' instead of 'default' git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@327890 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_directory.c b/apps/app_directory.c index 305bcdd7b3..8451eea083 100644 --- a/apps/app_directory.c +++ b/apps/app_directory.c @@ -57,7 +57,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") This is the dialplan context to use when looking for an extension that the user has selected, or when jumping to the - o or a extension. + o or a extension. If not + specified, the current context will be used. @@ -246,7 +247,7 @@ static int compare(const char *text, const char *template) static int goto_exten(struct ast_channel *chan, const char *dialcontext, char *ext) { - if (!ast_goto_if_exists(chan, dialcontext, ext, 1) || + if (!ast_goto_if_exists(chan, S_OR(dialcontext, chan->context), ext, 1) || (!ast_strlen_zero(chan->macrocontext) && !ast_goto_if_exists(chan, chan->macrocontext, ext, 1))) { return 0; @@ -685,11 +686,11 @@ static int do_directory(struct ast_channel *chan, struct ast_config *vmcfg, stru int count, i; char ext[10] = ""; - if (digit == '0' && !goto_exten(chan, S_OR(dialcontext, "default"), "o")) { + if (digit == '0' && !goto_exten(chan, dialcontext, "o")) { return digit; } - if (digit == '*' && !goto_exten(chan, S_OR(dialcontext, "default"), "a")) { + if (digit == '*' && !goto_exten(chan, dialcontext, "a")) { return digit; }