Skip to content
Snippets Groups Projects
Commit ebe8fb51 authored by Martin Pycko's avatar Martin Pycko
Browse files

Let directory application browse through the multi-company directory entries

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1246 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent e217072b
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment