Version 0.1.9 from FTP
authorMark Spencer <markster@digium.com>
Wed, 18 Jul 2001 18:48:58 +0000 (18:48 +0000)
committerMark Spencer <markster@digium.com>
Wed, 18 Jul 2001 18:48:58 +0000 (18:48 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@341 65c4cc65-6c06-0410-ace0-fbb531ad65f3

say.c
sounds/digits/million.gsm [new file with mode: 0755]
sounds/digits/thousand.gsm [new file with mode: 0755]

diff --git a/say.c b/say.c
index fea77dd..02216e8 100755 (executable)
--- 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] = "";
        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 {
        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++;
                                if (num < 1000){
                                        snprintf(fn, sizeof(fn), "digits/%d", (num/100));
                                        playh++;
+                                       num -= ((num / 100) * 100);
                                } else {
                                } 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) {
                                }
                        }
                        if (!res) {
diff --git a/sounds/digits/million.gsm b/sounds/digits/million.gsm
new file mode 100755 (executable)
index 0000000..9d69ad5
Binary files /dev/null and b/sounds/digits/million.gsm differ
diff --git a/sounds/digits/thousand.gsm b/sounds/digits/thousand.gsm
new file mode 100755 (executable)
index 0000000..b059108
Binary files /dev/null and b/sounds/digits/thousand.gsm differ