aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_directory.c
diff options
context:
space:
mode:
author(no author) <(no author)@f38db490-d61c-443f-a65b-d21fe96a405b>2004-04-13 04:46:23 +0000
committer(no author) <(no author)@f38db490-d61c-443f-a65b-d21fe96a405b>2004-04-13 04:46:23 +0000
commitd46468f42c6762ce7646e773c7d0919ed1f626d4 (patch)
tree5d62a34385385b3485137835b2629174ca0464cf /apps/app_directory.c
parentf38bc8131c9eda8d0b0eabaafbaa53f4247989c4 (diff)
This commit was manufactured by cvs2svn to create tag 'v0_9_0'.
git-svn-id: http://svn.digium.com/svn/asterisk/tags/v0_9_0@2684 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_directory.c')
-rwxr-xr-xapps/app_directory.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/apps/app_directory.c b/apps/app_directory.c
index 8e8f62455..199888b23 100755
--- a/apps/app_directory.c
+++ b/apps/app_directory.c
@@ -37,7 +37,8 @@ static char *descrip =
"discovered from voicemail.conf. The context argument is required, and\n"
"specifies the context in which to interpret the extensions. Returns 0\n"
"unless the user hangs up. It also sets up the channel on exit to enter the\n"
-"extension the user selected.\n";
+"extension the user selected. Please note that the context must be the same\n"
+"as the section in voicemail.conf that the mailbox is processed from as well.\n";
/* For simplicity, I'm keeping the format compatible with the voicemail config,
but i'm open to suggestions for isolating it */
@@ -199,10 +200,15 @@ ahem:
ast_stopstream(chan);
if (res > -1) {
if (res == '1') {
- strncpy(chan->exten, v->name, sizeof(chan->exten)-1);
- chan->priority = 0;
- strncpy(chan->context, context, sizeof(chan->context)-1);
- res = 0;
+ if (ast_exists_extension(chan, context, v->name, 1, chan->callerid)) {
+ strncpy(chan->exten, v->name, sizeof(chan->exten)-1);
+ chan->priority = 0;
+ strncpy(chan->context, context, sizeof(chan->context)-1);
+ res = 0;
+ } else {
+ ast_log(LOG_WARNING, "Can't find extension '%s' in context '%s'. Did you pass the wrong context to Directory?\n", v->name, context);
+ res = -1;
+ }
break;
} else if (res == '*') {
res = 0;