aboutsummaryrefslogtreecommitdiffstats
path: root/pbx.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-05-03 00:54:16 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-05-03 00:54:16 +0000
commitddca191dd31cb7fdb3076a34ddbc9389127e3208 (patch)
treec0f02df20bee0b5575cee77409b55f0e9bdb91f1 /pbx.c
parent75a0cc8b77f46f8e6017b158d60c24abfd73aa89 (diff)
Add SayPhonetic and SayAlpha applications (bug #793)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2864 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx.c')
-rwxr-xr-xpbx.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/pbx.c b/pbx.c
index 85e5e0103..4a5fd82d6 100755
--- a/pbx.c
+++ b/pbx.c
@@ -169,6 +169,8 @@ static int pbx_builtin_gotoif(struct ast_channel *, void *);
static int pbx_builtin_gotoiftime(struct ast_channel *, void *);
static int pbx_builtin_saynumber(struct ast_channel *, void *);
static int pbx_builtin_saydigits(struct ast_channel *, void *);
+static int pbx_builtin_saycharacters(struct ast_channel *, void *);
+static int pbx_builtin_sayphonetic(struct ast_channel *, void *);
int pbx_builtin_setvar(struct ast_channel *, void *);
void pbx_builtin_setvar_helper(struct ast_channel *chan, char *name, char *value);
char *pbx_builtin_getvar_helper(struct ast_channel *chan, char *name);
@@ -293,6 +295,14 @@ static struct pbx_builtin {
"Say Digits",
" SayDigits(digits): Says the passed digits\n" },
+ { "SayAlpha", pbx_builtin_saycharacters,
+"Say Alpha",
+" SayAlpha(string): Spells the passed string\n" },
+
+ { "SayPhonetic", pbx_builtin_sayphonetic,
+"Say Phonetic",
+" SayPhonetic(string): Spells the passed string with phonetic alphabet\n" },
+
{ "SetAccount", pbx_builtin_setaccount,
"Sets account code",
" SetAccount([account]): Set the channel account code for billing\n"
@@ -4601,6 +4611,22 @@ static int pbx_builtin_saydigits(struct ast_channel *chan, void *data)
return res;
}
+static int pbx_builtin_saycharacters(struct ast_channel *chan, void *data)
+{
+ int res = 0;
+ if (data)
+ res = ast_say_character_str(chan, (char *)data, "", chan->language);
+ return res;
+}
+
+static int pbx_builtin_sayphonetic(struct ast_channel *chan, void *data)
+{
+ int res = 0;
+ if (data)
+ res = ast_say_phonetic_str(chan, (char *)data, "", chan->language);
+ return res;
+}
+
int load_pbx(void)
{
int x;