diff options
author | martinp <martinp@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-08-01 23:14:37 +0000 |
---|---|---|
committer | martinp <martinp@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-08-01 23:14:37 +0000 |
commit | 4cbd8cd185c573662ad5a06ddd3383448bb8e0dc (patch) | |
tree | 846971774235fb97f5389368227ba1f4a0a68d86 /apps/app_directory.c | |
parent | 1d007230fb971548422b419075bfe2b65c79d758 (diff) |
Let directory application browse through the multi-company directory entries
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1246 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_directory.c')
-rwxr-xr-x | apps/app_directory.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/apps/app_directory.c b/apps/app_directory.c index 949676d86..8c18c81a5 100755 --- a/apps/app_directory.c +++ b/apps/app_directory.c @@ -129,6 +129,7 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, char * int found=0; char *start, *pos, *conv,*stringp=NULL; char fn[256]; + char fn2[256]; if (!context || !strlen(context)) { ast_log(LOG_WARNING, "Directory must be called with an argument (context in which to interpret extensions)\n"); return -1; @@ -171,12 +172,20 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, char * } if (v) { /* We have a match -- play a greeting if they have it */ - snprintf(fn, sizeof(fn), "%s/vm/%s/greet", (char *)ast_config_AST_SPOOL_DIR, v->name); + /* Check for the VoiceMail2 greeting first */ + snprintf(fn, sizeof(fn), "%s/voicemail/%s/%s/greet", (char *)ast_config_AST_SPOOL_DIR, context, v->name); + /* Otherwise, check for an old-style Voicemail greeting */ + snprintf(fn2, sizeof(fn2), "%s/vm/%s/greet", (char *)ast_config_AST_SPOOL_DIR, v->name); if (ast_fileexists(fn, NULL, chan->language) > 0) { res = ast_streamfile(chan, fn, chan->language); if (!res) res = ast_waitstream(chan, AST_DIGIT_ANY); ast_stopstream(chan); + } else if (ast_fileexists(fn2, NULL, chan->language) > 0) { + res = ast_streamfile(chan, fn2, chan->language); + if (!res) + res = ast_waitstream(chan, AST_DIGIT_ANY); + ast_stopstream(chan); } else { res = ast_say_digit_str(chan, v->name, AST_DIGIT_ANY, chan->language); } |