Even better, let it be specified per-context
authorMark Spencer <markster@digium.com>
Thu, 29 Apr 2004 13:53:38 +0000 (13:53 +0000)
committerMark Spencer <markster@digium.com>
Thu, 29 Apr 2004 13:53:38 +0000 (13:53 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2820 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_directory.c
configs/voicemail.conf.sample

index bd51bb2..658798d 100755 (executable)
@@ -250,9 +250,6 @@ static int directory_exec(struct ast_channel *chan, void *data)
        }
        LOCAL_USER_ADD(u);
 top:
-       dirintro = ast_variable_retrieve(cfg, "general", "directoryintro");
-       if (!dirintro || !strlen(dirintro))
-               dirintro = "dir-intro";
        context = ast_strdupa(data);
        dialcontext = strchr(context, '|');
        if (dialcontext) {
@@ -260,6 +257,11 @@ top:
                dialcontext++;
        } else
                dialcontext = context;
+       dirintro = ast_variable_retrieve(cfg, context, "directoryintro");
+       if (!dirintro || !strlen(dirintro))
+               dirintro = ast_variable_retrieve(cfg, "general", "directoryintro");
+       if (!dirintro || !strlen(dirintro))
+               dirintro = "dir-intro";
        if (chan->_state != AST_STATE_UP) 
                res = ast_answer(chan);
        if (!res)
index f850c10..6a0e1c5 100755 (executable)
@@ -115,4 +115,6 @@ yes
 ;
 
 [other]
+;The intro can be customized on a per-context basis
+;directoryintro=dir-company2
 1234 => 5678,Company2 User,root@localhost