diff options
author | Kinsey Moore <kmoore@digium.com> | 2013-08-22 22:33:48 +0000 |
---|---|---|
committer | Kinsey Moore <kmoore@digium.com> | 2013-08-22 22:33:48 +0000 |
commit | 7b032c1adb10d79f8610e88d2baf5cacf3ba9f58 (patch) | |
tree | 7c10a365fa41daaf9ad9bb1535d6ebad188cb406 /res | |
parent | aefebebd37add82bbea2d3423a5fc5f28feb2c60 (diff) |
Add SayAlphaCase and similar functionality for AGI
This adds a new dialplan application, SayAlphaCase, that performs much
the same function as SayAlpha except that it takes additional options
which allow the user to specify whether the case of each letter should
be announced for uppercase, lowercase, or all letters. Similar
functionality has been added to the SAY ALPHA AGI command via an
optional parameter.
Original Patch by: Kevin Scott Adams
Reported by: Kevin Scott Adams
Review: https://reviewboard.asterisk.org/r/2725/
(closes issue ASTERISK-20782)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397493 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rw-r--r-- | res/res_agi.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/res/res_agi.c b/res/res_agi.c index 6619183fc..74d665bd5 100644 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -2313,11 +2313,37 @@ static int handle_saydigits(struct ast_channel *chan, AGI *agi, int argc, const static int handle_sayalpha(struct ast_channel *chan, AGI *agi, int argc, const char * const argv[]) { int res; + int sensitivity = AST_SAY_CASE_NONE; - if (argc != 4) + if (argc < 4 || argc > 5) { return RESULT_SHOWUSAGE; + } - res = ast_say_character_str_full(chan, argv[2], argv[3], ast_channel_language(chan), agi->audio, agi->ctrl); + if (argc > 4) { + switch (argv[4][0]) { + case 'a': + case 'A': + sensitivity = AST_SAY_CASE_ALL; + break; + case 'l': + case 'L': + sensitivity = AST_SAY_CASE_LOWER; + break; + case 'n': + case 'N': + sensitivity = AST_SAY_CASE_NONE; + break; + case 'u': + case 'U': + sensitivity = AST_SAY_CASE_UPPER; + break; + case '\0': + break; + default: + return RESULT_SHOWUSAGE; + } + } + res = ast_say_character_str_full(chan, argv[2], argv[3], ast_channel_language(chan), sensitivity, agi->audio, agi->ctrl); if (res == 1) /* New command */ return RESULT_SUCCESS; ast_agi_send(agi->fd, chan, "200 result=%d\n", res); |