aboutsummaryrefslogtreecommitdiffstats
path: root/say.c
diff options
context:
space:
mode:
Diffstat (limited to 'say.c')
-rwxr-xr-xsay.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/say.c b/say.c
index fea77dd8c..02216e8d6 100755
--- a/say.c
+++ b/say.c
@@ -44,6 +44,8 @@ int ast_say_number(struct ast_channel *chan, int num, char *language)
int res = 0;
int playh = 0;
char fn[256] = "";
+ if (!num)
+ return ast_say_digits(chan, 0,language);
if (0) {
/* XXX Only works for english XXX */
} else {
@@ -65,9 +67,22 @@ int ast_say_number(struct ast_channel *chan, int num, char *language)
if (num < 1000){
snprintf(fn, sizeof(fn), "digits/%d", (num/100));
playh++;
+ num -= ((num / 100) * 100);
} else {
- ast_log(LOG_DEBUG, "Number '%d' is too big for me\n", num);
- res = -1;
+ if (num < 1000000) {
+ ast_say_number(chan, num / 1000, language);
+ num = num % 1000;
+ snprintf(fn, sizeof(fn), "digits/thousand");
+ } else {
+ if (num < 1000000000) {
+ ast_say_number(chan, num / 1000000, language);
+ num = num % 1000000;
+ snprintf(fn, sizeof(fn), "digits/million");
+ } else {
+ ast_log(LOG_DEBUG, "Number '%d' is too big for me\n", num);
+ res = -1;
+ }
+ }
}
}
if (!res) {