[Asterisk-cvs] asterisk/apps app_directory.c,1.19,1.20

markster at lists.digium.com markster at lists.digium.com
Mon May 3 00:28:55 CDT 2004


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

Modified Files:
	app_directory.c 
Log Message:
Make directory spell name if available


Index: app_directory.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_directory.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- app_directory.c	29 Apr 2004 13:53:38 -0000	1.19
+++ app_directory.c	3 May 2004 04:36:46 -0000	1.20
@@ -125,6 +125,7 @@
 {
 	/* Read in the first three digits..  "digit" is the first digit, already read */
 	char ext[NUMDIGITS + 1];
+	char name[80] = "";
 	struct ast_variable *v;
 	int res;
 	int found=0;
@@ -152,6 +153,7 @@
 					strsep(&stringp, ",");
 					pos = strsep(&stringp, ",");
 					if (pos) {
+						strncpy(name, pos, sizeof(name) - 1);
 						/* Grab the last name */
 						if (strrchr(pos, ' '))
 							pos = strrchr(pos, ' ') + 1;
@@ -188,7 +190,7 @@
 						res = ast_waitstream(chan, AST_DIGIT_ANY);
 					ast_stopstream(chan);
 				} else {
-					res = ast_say_digit_str(chan, v->name, AST_DIGIT_ANY, chan->language);
+					res = ast_say_character_str(chan, strlen(name) ? name : v->name, AST_DIGIT_ANY, chan->language);
 				}
 ahem:
 				if (!res)




More information about the svn-commits mailing list