diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-12-14 18:39:25 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-12-14 18:39:25 +0000 |
commit | c60f8a2b8e1551244e674baff85cb1a4f2d5fd5b (patch) | |
tree | 62bfb34e055d67dbfba2486b86759a4b1acef221 /res/res_agi.c | |
parent | 6e1a5b03df5c5e7a7143e46811f3054b187996dd (diff) |
Add "SAY ALPHA" (matt nicholson)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4445 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_agi.c')
-rwxr-xr-x | res/res_agi.c | 25 |
1 files changed, 25 insertions, 0 deletions
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 <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 @@ static agi_command commands[MAX_COMMANDS] = { { { "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 }, |