mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-17 15:29:05 +00:00
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
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user