mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 12:16:00 +00:00
Version 0.1.9 from FTP
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@341 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
19
say.c
19
say.c
@@ -44,6 +44,8 @@ int ast_say_number(struct ast_channel *chan, int num, char *language)
|
|||||||
int res = 0;
|
int res = 0;
|
||||||
int playh = 0;
|
int playh = 0;
|
||||||
char fn[256] = "";
|
char fn[256] = "";
|
||||||
|
if (!num)
|
||||||
|
return ast_say_digits(chan, 0,language);
|
||||||
if (0) {
|
if (0) {
|
||||||
/* XXX Only works for english XXX */
|
/* XXX Only works for english XXX */
|
||||||
} else {
|
} else {
|
||||||
@@ -65,9 +67,22 @@ int ast_say_number(struct ast_channel *chan, int num, char *language)
|
|||||||
if (num < 1000){
|
if (num < 1000){
|
||||||
snprintf(fn, sizeof(fn), "digits/%d", (num/100));
|
snprintf(fn, sizeof(fn), "digits/%d", (num/100));
|
||||||
playh++;
|
playh++;
|
||||||
|
num -= ((num / 100) * 100);
|
||||||
} else {
|
} else {
|
||||||
ast_log(LOG_DEBUG, "Number '%d' is too big for me\n", num);
|
if (num < 1000000) {
|
||||||
res = -1;
|
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) {
|
||||||
|
BIN
sounds/digits/million.gsm
Executable file
BIN
sounds/digits/million.gsm
Executable file
Binary file not shown.
BIN
sounds/digits/thousand.gsm
Executable file
BIN
sounds/digits/thousand.gsm
Executable file
Binary file not shown.
Reference in New Issue
Block a user