From 0f205bb07903a70272e8ae2403afe20ceb06cedc Mon Sep 17 00:00:00 2001 From: Mark Spencer Date: Tue, 14 Dec 2004 18:39:25 +0000 Subject: Add "SAY ALPHA" (matt nicholson) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4445 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- res/res_agi.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'res/res_agi.c') diff --git a/res/res_agi.c b/res/res_agi.c index 59841efda..d7582ba44 100755 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -577,6 +577,23 @@ static int handle_saydigits(struct ast_channel *chan, AGI *agi, int argc, char * 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 @@ static char usage_saydigits[] = " 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 \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