[Asterisk-cvs] asterisk say.c,1.49,1.50
markster at lists.digium.com
markster at lists.digium.com
Fri Feb 4 01:10:26 CST 2005
Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv10454
Modified Files:
say.c
Log Message:
Fix spanish pronunciation (bug #3121, thanks to David Corredor)
Index: say.c
===================================================================
RCS file: /usr/cvsroot/asterisk/say.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- say.c 29 Jan 2005 17:35:12 -0000 1.49
+++ say.c 4 Feb 2005 07:11:28 -0000 1.50
@@ -1093,13 +1093,17 @@
{
int res = 0;
int playa = 0;
- int mf = 1; /* +1 = male; -1 = female */
+ int mf = 0; /* +1 = male; -1 = female */
char fn[256] = "";
if (!num)
return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd);
- if (options && !strncasecmp(options, "f",1))
- mf = -1;
+ if (options) {
+ if (!strncasecmp(options, "f",1))
+ mf = -1;
+ else if (!strncasecmp(options, "m", 1))
+ mf = 1;
+ }
while (!res && num) {
if (num < 0) {
@@ -1110,12 +1114,14 @@
num = 0;
}
} else if (playa) {
- snprintf(fn, sizeof(fn), "digits/y");
+ snprintf(fn, sizeof(fn), "digits/and");
playa = 0;
} else if (num == 1) {
if (mf < 0)
snprintf(fn, sizeof(fn), "digits/%dF", num);
- else
+ else if (mf > 0)
+ snprintf(fn, sizeof(fn), "digits/%dM", num);
+ else
snprintf(fn, sizeof(fn), "digits/%d", num);
num = 0;
} else if (num < 31) {
@@ -1127,28 +1133,37 @@
if (num)
playa++;
} else if (num == 100) {
- snprintf(fn, sizeof(fn), "digits/cien");
+ snprintf(fn, sizeof(fn), "digits/100");
num = 0;
+ } else if (num < 200) {
+ snprintf(fn, sizeof(fn), "digits/100-and");
+ num -= 100;
} else {
if (num < 1000) {
snprintf(fn, sizeof(fn), "digits/%d", (num/100)*100);
num -= ((num/100)*100);
+ } else if (num < 2000) {
+ num = num % 1000;
+ snprintf(fn, sizeof(fn), "digits/thousand");
} else {
if (num < 1000000) {
res = ast_say_number_full_es(chan, num / 1000, ints, language, options, audiofd, ctrlfd);
if (res)
return res;
num = num % 1000;
- snprintf(fn, sizeof(fn), "digits/mil");
+ snprintf(fn, sizeof(fn), "digits/thousand");
} else {
if (num < 2147483640) {
- res = ast_say_number_full_es(chan, num / 1000000, ints, language, options, audiofd, ctrlfd);
- if (res)
- return res;
if ((num/1000000) == 1) {
- snprintf(fn, sizeof(fn), "digits/millon");
+ res = ast_say_number_full_es(chan, num / 1000000, ints, language, "M", audiofd, ctrlfd);
+ if (res)
+ return res;
+ snprintf(fn, sizeof(fn), "digits/million");
} else {
- snprintf(fn, sizeof(fn), "digits/millones");
+ res = ast_say_number_full_es(chan, num / 1000000, ints, language, options, audiofd, ctrlfd);
+ if (res)
+ return res;
+ snprintf(fn, sizeof(fn), "digits/millions");
}
num = num % 1000000;
} else {
More information about the svn-commits
mailing list