[svn-commits] russell: trunk r63901 - /trunk/res/res_agi.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Fri May 11 09:16:50 MST 2007


Author: russell
Date: Fri May 11 11:16:50 2007
New Revision: 63901

URL: http://svn.digium.com/view/asterisk?view=rev&rev=63901
Log:
Add gender support for AGI SAY NUMBER.
(issue #9537, patch by chappell)

Modified:
    trunk/res/res_agi.c

Modified: trunk/res/res_agi.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_agi.c?view=diff&rev=63901&r1=63900&r2=63901
==============================================================================
--- trunk/res/res_agi.c (original)
+++ trunk/res/res_agi.c Fri May 11 11:16:50 2007
@@ -697,17 +697,16 @@
 
 
 /*--- handle_saynumber: Say number in various language syntaxes ---*/
-/* Need to add option for gender here as well. Coders wanted */
 /* While waiting, we're sending a NULL.  */
 static int handle_saynumber(struct ast_channel *chan, AGI *agi, int argc, char *argv[])
 {
 	int res;
 	int num;
-	if (argc != 4)
+	if (argc < 4 || argc > 5)
 		return RESULT_SHOWUSAGE;
 	if (sscanf(argv[2], "%d", &num) != 1)
 		return RESULT_SHOWUSAGE;
-	res = ast_say_number_full(chan, num, argv[3], chan->language, NULL, agi->audio, agi->ctrl);
+	res = ast_say_number_full(chan, num, argv[3], chan->language, argc > 4 ? argv[4] : NULL, agi->audio, agi->ctrl);
 	if (res == 1)
 		return RESULT_SUCCESS;
 	fdprintf(agi->fd, "200 result=%d\n", res);
@@ -1513,7 +1512,7 @@
 "	Behaves similar to STREAM FILE but used with a timeout option.\n";
 
 static char usage_saynumber[] =
-" Usage: SAY NUMBER <number> <escape digits>\n"
+" Usage: SAY NUMBER <number> <escape digits> [gender]\n"
 "	Say a given number, returning early if any of the given DTMF digits\n"
 " are received on the channel.  Returns 0 if playback completes without a digit\n"
 " being pressed, or the ASCII numerical value of the digit if one was pressed or\n"



More information about the svn-commits mailing list