[Asterisk-cvs] asterisk/apps app_directory.c,1.17,1.18

markster at lists.digium.com markster at lists.digium.com
Thu Apr 29 09:43:45 CDT 2004


Update of /usr/cvsroot/asterisk/apps
In directory mongoose.digium.com:/tmp/cvs-serv16433/apps

Modified Files:
	app_directory.c 
Log Message:
Add ability to customize directory introduction (bug #1488)


Index: app_directory.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_directory.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- app_directory.c	28 Apr 2004 15:29:26 -0000	1.17
+++ app_directory.c	29 Apr 2004 13:50:29 -0000	1.18
@@ -238,7 +238,7 @@
 	int res = 0;
 	struct localuser *u;
 	struct ast_config *cfg;
-	char *context, *dialcontext;
+	char *context, *dialcontext, *dirintro;
 	if (!data) {
 		ast_log(LOG_WARNING, "directory requires an argument (context)\n");
 		return -1;
@@ -250,6 +250,9 @@
 	}
 	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,7 +263,7 @@
 	if (chan->_state != AST_STATE_UP) 
 		res = ast_answer(chan);
 	if (!res)
-		res = ast_streamfile(chan, "dir-intro", chan->language);
+		res = ast_streamfile(chan, dirintro, chan->language);
 	if (!res)
 		res = ast_waitstream(chan, AST_DIGIT_ANY);
 	ast_stopstream(chan);




More information about the svn-commits mailing list