[Asterisk-cvs] asterisk/res res_agi.c,1.17,1.18

markster at lists.digium.com markster at lists.digium.com
Tue Dec 14 13:42:38 CST 2004


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

Modified Files:
	res_agi.c 
Log Message:
Add "SAY ALPHA" (matt nicholson)


Index: res_agi.c
===================================================================
RCS file: /usr/cvsroot/asterisk/res/res_agi.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- res_agi.c	17 Nov 2004 04:36:39 -0000	1.17
+++ res_agi.c	14 Dec 2004 18:39:25 -0000	1.18
@@ -577,6 +577,23 @@
 		return RESULT_FAILURE;
 }
 
+static int handle_sayalpha(struct ast_channel *chan, AGI *agi, int argc, char *argv[])
+{
+	int res;
+
+	if (argc != 4)
+		return RESULT_SHOWUSAGE;
+
+	res = ast_say_character_str_full(chan, argv[2], argv[3], chan->language, agi->audio, agi->ctrl);
+	if (res == 1) /* New command */
+		return RESULT_SUCCESS;
+	fdprintf(agi->fd, "200 result=%d\n", res);
+	if (res >= 0)
+		return RESULT_SUCCESS;
+	else
+		return RESULT_FAILURE;
+}
+
 static int handle_saytime(struct ast_channel *chan, AGI *agi, int argc, char *argv[])
 {
 	int res;
@@ -1302,6 +1319,13 @@
 " being pressed, or the ASCII numerical value of the digit if one was pressed or\n"
 " -1 on error/hangup.\n";
 
+static char usage_sayalpha[] =
+" Usage: SAY ALPHA <number> <escape digits>\n"
+"        Say a given character string, 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"
+" -1 on error/hangup.\n";
+
 static char usage_saytime[] =
 " Usage: SAY TIME <time> <escape digits>\n"
 "        Say a given time, returning early if any of the given DTMF digits are\n"
@@ -1366,6 +1390,7 @@
 	{ { "get", "option", NULL }, handle_getoption, "Stream File", usage_getoption },
 	{ { "send", "image", NULL }, handle_sendimage, "Sends images to channels supporting it", usage_sendimage },
 	{ { "say", "digits", NULL }, handle_saydigits, "Says a given digit string", usage_saydigits },
+	{ { "say", "alpha", NULL }, handle_sayalpha, "Says a given character string", usage_sayalpha },
 	{ { "say", "number", NULL }, handle_saynumber, "Says a given number", usage_saynumber },
 	{ { "say", "phonetic", NULL }, handle_sayphonetic, "Says a given character string with phonetics", usage_sayphonetic },
 	{ { "say", "time", NULL }, handle_saytime, "Says a given time", usage_saytime },




More information about the svn-commits mailing list