42 #include <netinet/in.h> 48 #include <iso/limits_iso.h> 65 char fnbuf[10], asciibuf[20] =
"letters/ascii";
75 while (str[num] && !res) {
85 fn =
"letters/exclaimation-point";
91 fn =
"letters/dollar";
100 fn =
"letters/equals";
106 fn =
"letters/slash";
109 fn =
"letters/space";
121 strcpy(fnbuf,
"digits/X");
127 if (
'A' <= ltr && ltr <=
'Z') {
129 switch (sensitivity) {
137 }
else if (
'a' <= ltr && ltr <=
'z') {
138 switch (sensitivity) {
149 strcpy(fnbuf,
"uppercase");
151 strcpy(fnbuf,
"lowercase");
153 strcpy(fnbuf,
"letters/X");
159 (snprintf(asciibuf + 13,
sizeof(asciibuf) - 13,
"%d", str[num]) > 0 &&
ast_fileexists(asciibuf,
NULL, lang) > 0 && (fn = asciibuf))) {
162 if (upper || lower) {
179 while ((fn =
strsep(&files,
"&"))) {
182 if ((audiofd > -1) && (ctrlfd > -1))
215 fn =
"letters/exclaimation-point";
221 fn =
"letters/dollar";
230 fn =
"letters/equals";
236 fn =
"letters/slash";
239 fn =
"letters/space";
250 strcpy(fnbuf,
"digits/X");
256 if (
'A' <= ltr && ltr <=
'Z') ltr +=
'a' -
'A';
257 strcpy(fnbuf,
"phonetic/X_p");
278 while ((fn =
strsep(&files,
"&"))) {
281 if ((audiofd > -1) && (ctrlfd > -1))
325 strcpy(fnbuf,
"digits/X");
347 while ((fn =
strsep(&files,
"&"))) {
350 if ((audiofd > -1) && (ctrlfd > -1))
374 if (sscanf(str,
"%30lf", &dollars) != 1) {
381 cents = amt - (((int) dollars) * 100);
382 ast_debug(1,
"Cents is %d, amount is %d\n", cents, amt);
391 ast_str_append(&filenames, 0,
"&%s", (cents > 0) ?
"letters/dollar_" :
"letters/dollar");
407 ast_str_append(&filenames, 0,
"&%s", (cents == 1) ?
"cent" :
"cents");
408 }
else if (amt == 0) {
421 if (!strncasecmp(lang,
"en", 2)) {
425 ast_log(
LOG_WARNING,
"Language %s not currently supported, defaulting to US Dollars\n", lang);
438 while ((fn =
strsep(&files,
"&"))) {
441 if ((audiofd > -1) && (ctrlfd > -1))
471 while (!res && (num || playh)) {
474 if ( num > INT_MIN ) {
482 }
else if (num < 20) {
483 snprintf(fn,
sizeof(fn),
"digits/%d", num);
485 }
else if (num < 100) {
486 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
490 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
500 snprintf(fn,
sizeof(fn),
"&digits/thousand");
502 if (num < 1000000000) {
527 if (!strncasecmp(lang,
"en", 2)) {
531 ast_log(
LOG_WARNING,
"Language %s not currently supported, defaulting to English\n", lang);
716 if (!strncasecmp(language,
"en_GB", 5)) {
718 }
else if (!strncasecmp(language,
"en", 2)) {
720 }
else if (!strncasecmp(language,
"cs", 2)) {
722 }
else if (!strncasecmp(language,
"da", 2)) {
724 }
else if (!strncasecmp(language,
"de", 2)) {
726 }
else if (!strncasecmp(language,
"es", 2)) {
728 }
else if (!strncasecmp(language,
"fr", 2)) {
730 }
else if (!strncasecmp(language,
"gr", 2)) {
732 }
else if (!strncasecmp(language,
"ja", 2)) {
734 }
else if (!strncasecmp(language,
"he", 2)) {
736 }
else if (!strncasecmp(language,
"hu", 2)) {
738 }
else if (!strncasecmp(language,
"is", 2)) {
740 }
else if (!strncasecmp(language,
"it", 2)) {
742 }
else if (!strncasecmp(language,
"ka", 2)) {
744 }
else if (!strncasecmp(language,
"nl", 2)) {
746 }
else if (!strncasecmp(language,
"no", 2)) {
748 }
else if (!strncasecmp(language,
"pl", 2)) {
750 }
else if (!strncasecmp(language,
"pt", 2)) {
752 }
else if (!strncasecmp(language,
"ru", 2)) {
754 }
else if (!strncasecmp(language,
"se", 2)) {
756 }
else if (!strncasecmp(language,
"th", 2)) {
758 }
else if (!strncasecmp(language,
"zh", 2)) {
760 }
else if (!strncasecmp(language,
"ur", 2)) {
762 }
else if (!strncasecmp(language,
"vi", 2)) {
780 while ((fn =
strsep(&files,
"&"))) {
783 if ((audiofd > -1) && (ctrlfd > -1))
799 for (x=0;x<power;x++)
843 while (!res && (num || playh)) {
846 if ( num > INT_MIN ) {
851 }
else if (num < 3 ) {
852 snprintf(fn,
sizeof(fn),
"digits/%d%c", num, options[0]);
855 }
else if (num < 20) {
856 snprintf(fn,
sizeof(fn),
"digits/%d", num);
859 }
else if (num < 100) {
860 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
862 }
else if (num < 1000) {
863 hundered = num / 100;
864 if ( hundered == 1 ) {
866 }
else if ( hundered == 2 ) {
872 if (hundered == 3 || hundered == 4) {
874 }
else if ( hundered > 4 ) {
878 num -= (hundered * 100);
880 length = (int)log10(num)+1;
881 while ( (length % 3 ) != 1 ) {
887 case 9: options =
"w";
889 default : options =
"m";
898 snprintf(fn,
sizeof(fn),
"digits/5_E%d", length - 1);
899 }
else if ( left >= 2 && left <= 4 ) {
900 snprintf(fn,
sizeof(fn),
"digits/2-4_E%d", length - 1);
902 snprintf(fn,
sizeof(fn),
"digits/1_E%d", length - 1);
908 if ((audiofd > -1) && (ctrlfd > -1)) {
934 if (options && !strncasecmp(options,
"n", 1)) cn = -1;
936 while (!res && (num || playh || playa )) {
949 if ( num > INT_MIN ) {
960 }
else if (num == 1 && cn == -1) {
963 }
else if (num < 20) {
964 snprintf(fn,
sizeof(fn),
"digits/%d", num);
966 }
else if (num < 100) {
969 snprintf(fn,
sizeof(fn),
"digits/%d-and", ones);
972 snprintf(fn,
sizeof(fn),
"digits/%d", num);
977 int hundreds = num / 100;
981 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 100));
984 num -= 100 * hundreds;
996 if (num < 1000000000) {
997 int millions = num / 1000000;
1005 num = num % 1000000;
1007 ast_debug(1,
"Number '%d' is too big for me\n", num);
1011 if (num && num < 100)
1017 if ((audiofd > -1) && (ctrlfd > -1))
1047 if (options && (!strncasecmp(options,
"f", 1)))
1050 while (!res && num) {
1066 if ( num > INT_MIN ) {
1071 }
else if (num == 1 && mf == -1) {
1072 snprintf(fn,
sizeof(fn),
"digits/%dF", num);
1074 }
else if (num < 20) {
1075 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1077 }
else if (num < 100) {
1078 int ones = num % 10;
1080 snprintf(fn,
sizeof(fn),
"digits/%d-and", ones);
1083 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1086 }
else if (num == 100 && t == 0) {
1089 }
else if (num < 1000) {
1090 int hundreds = num / 100;
1092 if (hundreds == 1) {
1095 snprintf(fn,
sizeof(fn),
"digits/%d", hundreds);
1098 }
else if (num == 1000 && t == 0) {
1101 }
else if (num < 1000000) {
1102 int thousands = num / 1000;
1105 if (thousands == 1) {
1114 }
else if (num < 1000000000) {
1115 int millions = num / 1000000;
1116 num = num % 1000000;
1118 if (millions == 1) {
1127 }
else if (num <= INT_MAX) {
1128 int billions = num / 1000000000;
1129 num = num % 1000000000;
1131 if (billions == 1) {
1142 ast_debug(1,
"Number '%d' is too big for me\n", num);
1147 if ((audiofd > -1) && (ctrlfd > -1))
1155 if ((audiofd > -1) && (ctrlfd > -1))
1181 while (!res && (num || playh || playa )) {
1184 if ( num > INT_MIN ) {
1195 }
else if (num < 20) {
1196 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1198 }
else if (num < 100) {
1199 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
1201 }
else if (num < 1000) {
1202 int hundreds = num / 100;
1203 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 100));
1206 num -= 100 * hundreds;
1209 }
else if (num < 1000000) {
1215 if (num && num < 100)
1217 }
else if (num < 1000000000) {
1218 int millions = num / 1000000;
1224 if (num && num < 100)
1227 ast_debug(1,
"Number '%d' is too big for me\n", num);
1233 if ((audiofd > -1) && (ctrlfd > -1))
1261 if (!strncasecmp(options,
"f", 1))
1263 else if (!strncasecmp(options,
"m", 1))
1267 while (!res && num) {
1270 if ( num > INT_MIN ) {
1278 }
else if (num == 1) {
1280 snprintf(fn,
sizeof(fn),
"digits/%dF", num);
1282 snprintf(fn,
sizeof(fn),
"digits/%dM", num);
1284 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1286 }
else if (num < 31) {
1287 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1289 }
else if (num < 100) {
1290 snprintf(fn,
sizeof(fn),
"digits/%d", (num/10)*10);
1294 }
else if (num == 100) {
1297 }
else if (num < 200) {
1302 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100)*100);
1304 }
else if (num < 2000) {
1308 if (num < 1000000) {
1315 if (num < 2147483640) {
1316 if ((num/1000000) == 1) {
1329 ast_debug(1,
"Number '%d' is too big for me\n", num);
1338 if ((audiofd > -1) && (ctrlfd > -1))
1365 if (options && !strncasecmp(options,
"f", 1))
1368 while (!res && (num || playh || playa)) {
1371 if ( num > INT_MIN ) {
1382 }
else if (num == 1) {
1384 snprintf(fn,
sizeof(fn),
"digits/%dF", num);
1386 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1388 }
else if (num < 21) {
1389 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1391 }
else if (num < 70) {
1392 snprintf(fn,
sizeof(fn),
"digits/%d", (num/10)*10);
1393 if ((num % 10) == 1) playa++;
1395 }
else if (num < 80) {
1397 if ((num % 10) == 1) playa++;
1399 }
else if (num < 100) {
1402 }
else if (num < 200) {
1405 }
else if (num < 1000) {
1406 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
1409 }
else if (num < 2000) {
1412 }
else if (num < 1000000) {
1418 }
else if (num < 1000000000) {
1423 num = num % 1000000;
1425 ast_debug(1,
"Number '%d' is too big for me\n", num);
1430 if ((audiofd > -1) && (ctrlfd > -1))
1446 #define SAY_NUM_BUF_SIZE 256 1456 ast_verb(3,
"ast_say_digits_full: started. num: %d, options=\"%s\"\n", num, options);
1461 if (options && !strncasecmp(options,
"m", 1)) {
1464 ast_verb(3,
"ast_say_digits_full: num: %d, state=%d, options=\"%s\", mf=%d\n", num, state, options, mf);
1467 while (!res && (num || (state > 0))) {
1475 ast_verb(3,
"ast_say_digits_full: num: %d, state=%d, options=\"%s\", mf=%d, tmpnum=%d\n", num, state, options, mf, tmpnum);
1479 }
else if (state == 2) {
1480 if ((num >= 11) && (num < 21)) {
1482 snprintf(fn,
sizeof(fn),
"digits/ve");
1484 snprintf(fn,
sizeof(fn),
"digits/uu");
1489 snprintf(fn,
sizeof(fn),
"digits/ve");
1492 snprintf(fn,
sizeof(fn),
"digits/uu");
1496 snprintf(fn,
sizeof(fn),
"digits/ve");
1498 snprintf(fn,
sizeof(fn),
"digits/uu");
1502 snprintf(fn,
sizeof(fn),
"digits/ve");
1505 snprintf(fn,
sizeof(fn),
"digits/ve");
1508 snprintf(fn,
sizeof(fn),
"digits/ve");
1511 snprintf(fn,
sizeof(fn),
"digits/ve");
1514 snprintf(fn,
sizeof(fn),
"digits/uu");
1517 snprintf(fn,
sizeof(fn),
"digits/ve");
1520 snprintf(fn,
sizeof(fn),
"digits/ve");
1525 }
else if (state == 3) {
1526 snprintf(fn,
sizeof(fn),
"digits/1k");
1528 }
else if (num < 0) {
1529 snprintf(fn,
sizeof(fn),
"digits/minus");
1531 }
else if (num < 20) {
1533 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1535 snprintf(fn,
sizeof(fn),
"digits/%dm", num);
1538 }
else if ((num < 100) && (num >= 20)) {
1539 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 10) * 10);
1544 }
else if ((num >= 100) && (num < 1000)) {
1546 snprintf(fn,
sizeof(fn),
"digits/%d00", tmpnum);
1547 num = num - (tmpnum * 100);
1548 if ((num > 0) && (num < 11)) {
1551 }
else if ((num >= 1000) && (num < 10000)) {
1552 tmpnum = num / 1000;
1553 snprintf(fn,
sizeof(fn),
"digits/%dk", tmpnum);
1554 num = num - (tmpnum * 1000);
1555 if ((num > 0) && (num < 11)) {
1558 }
else if (num < 20000) {
1559 snprintf(fn,
sizeof(fn),
"digits/%dm", (num / 1000));
1562 }
else if (num < 1000000) {
1567 snprintf(fn,
sizeof(fn),
"digits/1k");
1569 if ((num > 0) && (num < 11)) {
1572 }
else if (num < 2000000) {
1573 snprintf(fn,
sizeof(fn),
"digits/million");
1574 num = num % 1000000;
1575 if ((num > 0) && (num < 11)) {
1578 }
else if (num < 3000000) {
1579 snprintf(fn,
sizeof(fn),
"digits/twomillion");
1580 num = num - 2000000;
1581 if ((num > 0) && (num < 11)) {
1584 }
else if (num < 1000000000) {
1589 snprintf(fn,
sizeof(fn),
"digits/million");
1590 num = num % 1000000;
1591 if ((num > 0) && (num < 11)) {
1595 ast_debug(1,
"Number '%d' is too big for me\n", num);
1601 if ((audiofd > -1) && (ctrlfd > -1)) {
1633 while(!res && (num || playh)) {
1636 if ( num > INT_MIN ) {
1644 }
else if (num < 11 || num == 20) {
1645 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1647 }
else if (num < 20) {
1650 }
else if (num < 30) {
1653 }
else if (num < 100) {
1654 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
1658 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
1662 if (num < 1000000) {
1669 if (num < 1000000000) {
1676 ast_debug(1,
"Number '%d' is too big for me\n", num);
1684 if ((audiofd > -1) && (ctrlfd > -1))
1710 if (options && !strncasecmp(options,
"f", 1)) cn = 2;
1711 if (options && !strncasecmp(options,
"c", 1)) cn = 3;
1713 if (options && !strncasecmp(options,
"n", 1)) cn = 3;
1715 while (!res && (num || playh || playa )) {
1718 if ( num > INT_MIN ) {
1732 }
else if (num < 5 && cn == 2) {
1733 snprintf(fn,
sizeof(fn),
"digits/%dkvk", num);
1735 }
else if (num < 5 && cn == 3) {
1736 snprintf(fn,
sizeof(fn),
"digits/%dhk", num);
1738 }
else if (num < 20) {
1739 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1741 }
else if (num < 100) {
1742 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
1746 }
else if (num < 1000) {
1747 int hundreds = num / 100;
1750 snprintf(fn,
sizeof(fn),
"digits/%dhk", hundreds);
1752 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 100));
1755 num -= 100 * hundreds;
1756 if (num && num < 20)
1759 if (num && (num % 10) == 0)
1761 }
else if (num < 1000000) {
1764 if ((num % 100) == 0 && (num % 1000 != 0)) {
1771 if (num && (num < 20 || (num % 10 == 0)))
1773 }
else if (num < 1000000000) {
1774 int millions = num / 1000000;
1784 if (num && num < 100)
1786 }
else if (num < INT_MAX) {
1787 int milliards = num / 1000000000;
1797 if (num && num < 100)
1800 ast_debug(1,
"Number '%d' is too big for me\n", num);
1806 if ((audiofd > -1) && (ctrlfd > -1))
1853 while (!res && (num || playh)) {
1856 if ( num > INT_MIN ) {
1864 }
else if (num < 20) {
1865 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1867 }
else if (num == 21) {
1868 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1870 }
else if (num == 28) {
1871 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1873 }
else if (num == 31) {
1874 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1876 }
else if (num == 38) {
1877 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1879 }
else if (num == 41) {
1880 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1882 }
else if (num == 48) {
1883 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1885 }
else if (num == 51) {
1886 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1888 }
else if (num == 58) {
1889 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1891 }
else if (num == 61) {
1892 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1894 }
else if (num == 68) {
1895 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1897 }
else if (num == 71) {
1898 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1900 }
else if (num == 78) {
1901 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1903 }
else if (num == 81) {
1904 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1906 }
else if (num == 88) {
1907 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1909 }
else if (num == 91) {
1910 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1912 }
else if (num == 98) {
1913 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1915 }
else if (num < 100) {
1916 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
1920 if ((num / 100) > 1) {
1921 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
1928 if (num < 1000000) {
1935 if ((tempnum / 1000) < 2)
1940 if (num < 1000000000) {
1941 if ((num / 1000000) > 1)
1947 if ((tempnum / 1000000) < 2)
1952 ast_debug(1,
"Number '%d' is too big for me\n", num);
1960 if ((audiofd > -1) && (ctrlfd > -1))
1982 while (!res && (num || playh )) {
1985 if ( num > INT_MIN ) {
1993 }
else if (num < 20) {
1994 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1996 }
else if (num < 100) {
2005 snprintf(fn,
sizeof(fn),
"digits/%d", num - units);
2008 }
else if (num < 200) {
2012 }
else if (num < 1000) {
2013 snprintf(fn,
sizeof(fn),
"digits/%d", num / 100);
2021 }
else if (num < 10000) {
2028 if (num < 1000000) {
2035 if (num < 1000000000) {
2042 ast_debug(1,
"Number '%d' is too big for me\n", num);
2051 if ((audiofd > -1) && (ctrlfd > -1))
2083 if (options && !strncasecmp(options,
"n", 1)) cn = -1;
2085 while (!res && (num || playh || playa )) {
2088 if ( num > INT_MIN ) {
2099 }
else if (num == 1 && cn == -1) {
2102 }
else if (num < 20) {
2103 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2105 }
else if (num < 100) {
2106 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
2108 }
else if (num < 1000) {
2109 int hundreds = num / 100;
2113 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 100));
2116 num -= 100 * hundreds;
2119 }
else if (num < 1000000) {
2125 if (num && num < 100)
2127 }
else if (num < 1000000000) {
2128 int millions = num / 1000000;
2134 if (num && num < 100)
2137 ast_debug(1,
"Number '%d' is too big for me\n", num);
2143 if ((audiofd > -1) && (ctrlfd > -1))
2159 char *dziesiatki[10];
2170 return odm->
rzedy[rzad - 1][0];
2171 if ((i > 21 || i < 11) && i%10 > 1 && i%10 < 5)
2172 return odm->
rzedy[rzad - 1][1];
2174 return odm->
rzedy[rzad - 1][2];
2179 strcpy(buffer, str);
2180 buffer += strlen(str);
2186 char file_name[255] =
"digits/";
2187 strcat(file_name, fn);
2188 ast_debug(1,
"Trying to play: %s\n", file_name);
2190 if ((audiofd > -1) && (ctrlfd > -1))
2210 if (i == 0 && rzad > 0) {
2218 m1000E6 = i % 1000000000;
2219 i1000E6 = i / 1000000000;
2221 powiedz(chan, language, audiofd, ctrlfd, ints, odm, rzad+3, i1000E6);
2223 m1000E3 = m1000E6 % 1000000;
2224 i1000E3 = m1000E6 / 1000000;
2226 powiedz(chan, language, audiofd, ctrlfd, ints, odm, rzad+2, i1000E3);
2228 m1000 = m1000E3 % 1000;
2229 i1000 = m1000E3 / 1000;
2231 powiedz(chan, language, audiofd, ctrlfd, ints, odm, rzad+1, i1000);
2239 if (m100 > 0 && m100 <= 9) {
2244 }
else if (m100 % 10 == 0 && m100 != 0) {
2246 }
else if (m100 > 10 && m100 <= 19) {
2248 }
else if (m100 > 20) {
2361 char *zenski_cyfry[] = {
"0",
"1z",
"2z",
"3",
"4",
"5",
"6",
"7",
"8",
"9"};
2363 char *zenski_cyfry2[] = {
"0",
"1",
"2z",
"3",
"4",
"5",
"6",
"7",
"8",
"9"};
2365 char *meski_cyfry[] = {
"0",
"1",
"2-1m",
"3-1m",
"4-1m",
"5m",
"6m",
"7m",
"8m",
"9m"};
2367 char *meski_cyfry2[] = {
"0",
"1",
"2-2m",
"3-2m",
"4-2m",
"5m",
"6m",
"7m",
"8m",
"9m"};
2369 char *meski_setki[] = {
"",
"100m",
"200m",
"300m",
"400m",
"500m",
"600m",
"700m",
"800m",
"900m"};
2371 char *meski_dziesiatki[] = {
"",
"10m",
"20m",
"30m",
"40m",
"50m",
"60m",
"70m",
"80m",
"90m"};
2373 char *meski_nastki[] = {
"",
"11m",
"12m",
"13m",
"14m",
"15m",
"16m",
"17m",
"18m",
"19m"};
2375 char *nijaki_cyfry[] = {
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9"};
2377 char *nijaki_cyfry2[] = {
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9"};
2379 char *nijaki_setki[] = {
"",
"100",
"200",
"300",
"400",
"500",
"600",
"700",
"800",
"900"};
2381 char *nijaki_dziesiatki[] = {
"",
"10",
"20",
"30",
"40",
"50",
"60",
"70",
"80",
"90"};
2383 char *nijaki_nastki[] = {
"",
"11",
"12",
"13",
"14",
"15",
"16",
"17",
"18",
"19"};
2385 char *rzedy[][3] = { {
"1000",
"1000.2",
"1000.5"}, {
"1000000",
"1000000.2",
"1000000.5"}, {
"1000000000",
"1000000000.2",
"1000000000.5"}};
2394 if (odmiana_nieosobowa ==
NULL) {
2395 odmiana_nieosobowa =
ast_malloc(
sizeof(*odmiana_nieosobowa));
2399 memcpy(odmiana_nieosobowa->
cyfry, nijaki_cyfry,
sizeof(odmiana_nieosobowa->
cyfry));
2400 memcpy(odmiana_nieosobowa->
cyfry2, nijaki_cyfry2,
sizeof(odmiana_nieosobowa->
cyfry));
2401 memcpy(odmiana_nieosobowa->
setki, nijaki_setki,
sizeof(odmiana_nieosobowa->
setki));
2402 memcpy(odmiana_nieosobowa->
dziesiatki, nijaki_dziesiatki,
sizeof(odmiana_nieosobowa->
dziesiatki));
2403 memcpy(odmiana_nieosobowa->
nastki, nijaki_nastki,
sizeof(odmiana_nieosobowa->
nastki));
2404 memcpy(odmiana_nieosobowa->
rzedy, rzedy,
sizeof(odmiana_nieosobowa->
rzedy));
2407 if (odmiana_zenska ==
NULL) {
2408 odmiana_zenska =
ast_malloc(
sizeof(*odmiana_zenska));
2412 memcpy(odmiana_zenska->
cyfry, zenski_cyfry,
sizeof(odmiana_zenska->
cyfry));
2413 memcpy(odmiana_zenska->
cyfry2, zenski_cyfry2,
sizeof(odmiana_zenska->
cyfry));
2414 memcpy(odmiana_zenska->
setki, nijaki_setki,
sizeof(odmiana_zenska->
setki));
2416 memcpy(odmiana_zenska->
nastki, nijaki_nastki,
sizeof(odmiana_zenska->
nastki));
2417 memcpy(odmiana_zenska->
rzedy, rzedy,
sizeof(odmiana_zenska->
rzedy));
2420 if (odmiana_meska ==
NULL) {
2421 odmiana_meska =
ast_malloc(
sizeof(*odmiana_meska));
2425 memcpy(odmiana_meska->
cyfry, meski_cyfry,
sizeof(odmiana_meska->
cyfry));
2426 memcpy(odmiana_meska->
cyfry2, meski_cyfry2,
sizeof(odmiana_meska->
cyfry));
2427 memcpy(odmiana_meska->
setki, meski_setki,
sizeof(odmiana_meska->
setki));
2429 memcpy(odmiana_meska->
nastki, meski_nastki,
sizeof(odmiana_meska->
nastki));
2430 memcpy(odmiana_meska->
rzedy, rzedy,
sizeof(odmiana_meska->
rzedy));
2434 if (strncasecmp(options,
"f", 1) == 0)
2436 else if (strncasecmp(options,
"m", 1) == 0)
2439 o = odmiana_nieosobowa;
2441 o = odmiana_nieosobowa;
2443 powiedz(chan, language, audiofd, ctrlfd, ints, o, 0, num);
2465 if (options && !strncasecmp(options,
"f", 1))
2468 while (!res && num ) {
2471 if ( num > INT_MIN ) {
2476 }
else if (num < 20) {
2477 if ((num == 1 || num == 2) && (mf < 0))
2478 snprintf(fn,
sizeof(fn),
"digits/%dF", num);
2480 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2482 }
else if (num < 100) {
2483 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 10) * 10);
2487 }
else if (num < 1000) {
2493 if (mf < 0 && num > 199)
2494 snprintf(fn,
sizeof(fn),
"digits/%dF", (num / 100) * 100);
2496 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 100) * 100);
2501 }
else if (num < 1000000) {
2508 if ((num % 1000) && ((num % 1000) < 100 || !(num % 100)))
2511 }
else if (num < 1000000000) {
2520 if ((num % 1000000) &&
2522 ((!((num / 1000) % 1000) && ((num % 1000) < 100 || !(num % 100))) ||
2524 (!(num % 1000) && (((num / 1000) % 1000) < 100 || !((num / 1000) % 100))) ) )
2526 num = num % 1000000;
2534 if ((audiofd > -1) && (ctrlfd > -1))
2541 if (!res && playh) {
2542 res =
wait_file(chan, ints,
"digits/pt-e", language);
2566 if (options && !strncasecmp(options,
"n", 1)) cn = -1;
2568 while (num || playh) {
2571 if ( num > INT_MIN ) {
2579 }
else if (start && num < 200 && num > 99 && cn == -1) {
2581 snprintf(fn,
sizeof(fn),
"digits/hundred");
2583 }
else if (num == 1 && cn == -1) {
2586 }
else if (num < 20) {
2587 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2589 }
else if (num < 100) {
2590 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
2592 }
else if (num < 1000) {
2594 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
2597 }
else if (num < 1000000) {
2605 }
else if (num < 1000000000) {
2614 ast_debug(1,
"Number '%d' is too big for me\n", num);
2619 if ((audiofd > -1) && (ctrlfd > -1)) {
2641 int last_length = 0;
2647 while (!res && (num || playh || playt || playz)) {
2650 if ( num > INT_MIN ) {
2656 snprintf(fn,
sizeof(fn),
"digits/0");
2663 snprintf(fn,
sizeof(fn),
"digits/thousand");
2665 }
else if (num < 10) {
2666 snprintf(buf, 12,
"%d", num);
2667 if (last_length - strlen(buf) > 1 && last_length != 0) {
2668 last_length = strlen(buf);
2672 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2674 }
else if (num < 100) {
2675 snprintf(buf, 10,
"%d", num);
2676 if (last_length - strlen(buf) > 1 && last_length != 0) {
2677 last_length = strlen(buf);
2681 last_length = strlen(buf);
2682 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 10) * 10);
2686 snprintf(buf, 10,
"%d", num);
2687 if (last_length - strlen(buf) > 1 && last_length != 0) {
2688 last_length = strlen(buf);
2692 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 100));
2694 snprintf(buf, 10,
"%d", num);
2695 ast_debug(1,
"Number '%d' %d %d\n", num, (
int)strlen(buf), last_length);
2696 last_length = strlen(buf);
2697 num -= ((num / 100) * 100);
2698 }
else if (num < 10000){
2699 snprintf(buf, 10,
"%d", num);
2700 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 1000));
2702 snprintf(buf, 10,
"%d", num);
2703 ast_debug(1,
"Number '%d' %d %d\n", num, (
int)strlen(buf), last_length);
2704 last_length = strlen(buf);
2705 num -= ((num / 1000) * 1000);
2706 }
else if (num < 100000000) {
2710 snprintf(buf, 10,
"%d", num);
2711 ast_debug(1,
"Number '%d' %d %d\n", num, (
int)strlen(buf), last_length);
2712 num -= ((num / 10000) * 10000);
2713 last_length = strlen(buf);
2714 snprintf(fn,
sizeof(fn),
"digits/wan");
2716 if (num < 1000000000) {
2720 snprintf(buf, 10,
"%d", num);
2721 ast_debug(1,
"Number '%d' %d %d\n", num, (
int)strlen(buf), last_length);
2722 last_length = strlen(buf);
2723 num -= ((num / 100000000) * 100000000);
2724 snprintf(fn,
sizeof(fn),
"digits/yi");
2726 ast_debug(1,
"Number '%d' is too big for me\n", num);
2733 if ((audiofd > -1) && (ctrlfd > -1))
2758 while (!res && (num || playh)) {
2760 snprintf(fn,
sizeof(fn),
"digits/hundred");
2762 }
else if (num < 100) {
2763 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2765 }
else if (num < 1000) {
2766 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 100));
2768 num -= ((num / 100) * 100);
2769 }
else if (num < 100000) {
2774 snprintf(fn,
sizeof(fn),
"digits/thousand");
2775 }
else if (num < 10000000) {
2780 snprintf(fn,
sizeof(fn),
"digits/lac");
2781 }
else if (num < 1000000000) {
2785 num = num % 10000000;
2786 snprintf(fn,
sizeof(fn),
"digits/crore");
2788 ast_debug(1,
"Number '%d' is too big for me\n", num);
2794 if ((audiofd > -1) && (ctrlfd > -1)) {
2810 }
else if (num < 100) {
2812 }
else if (num < 1000) {
2842 while (!res && (num)) {
2845 if ( num > INT_MIN ) {
2850 }
else if (num < 20) {
2851 if (options && strlen(options) == 1 && num < 3) {
2852 snprintf(fn,
sizeof(fn),
"digits/%d%s", num, options);
2854 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2857 }
else if (num < 100) {
2858 snprintf(fn,
sizeof(fn),
"digits/%d", num - (num % 10));
2860 }
else if (num < 1000){
2861 snprintf(fn,
sizeof(fn),
"digits/%d", num - (num % 100));
2863 }
else if (num < 1000000) {
2866 if (lastdigits < 3) {
2873 if (lastdigits == 1) {
2875 }
else if (lastdigits > 1 && lastdigits < 5) {
2881 }
else if (num < 1000000000) {
2887 if (lastdigits == 1) {
2889 }
else if (lastdigits > 1 && lastdigits < 5) {
2896 ast_debug(1,
"Number '%d' is too big for me\n", num);
2901 if ((audiofd > -1) && (ctrlfd > -1))
2921 while(!res && (num || playh)) {
2924 if ( num > INT_MIN ) {
2932 }
else if (num < 100) {
2933 if ((num <= 20) || ((num % 10) == 1)) {
2934 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2937 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 10) * 10);
2940 }
else if (num < 1000) {
2941 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
2944 }
else if (num < 10000) {
2950 }
else if (num < 100000) {
2956 }
else if (num < 1000000) {
2971 if ((audiofd > -1) && (ctrlfd > -1))
2994 while (!res && (num || playh)) {
2997 if ( num > INT_MIN ) {
3003 snprintf(fn,
sizeof(fn),
"digits/%da", num);
3012 }
else if (playoh) {
3015 }
else if (playohz) {
3018 }
else if (num < 20) {
3019 snprintf(fn,
sizeof(fn),
"digits/%d", num);
3021 }
else if (num < 100) {
3022 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
3024 if ((num == 5) || (num == 4) || (num == 1)) playl++;
3027 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
3029 if (num && (num < 10)) {
3036 if (num < 1000000) {
3041 snprintf(fn,
sizeof(fn),
"digits/thousand");
3042 if (num && (num < 10)) {
3044 }
else if (num && (num < 100)){
3052 if (num < 1000000000) {
3066 if ((audiofd > -1) && (ctrlfd > -1))
3081 if (!strncasecmp(language,
"en", 2)) {
3083 }
else if (!strncasecmp(language,
"da", 2)) {
3085 }
else if (!strncasecmp(language,
"de", 2)) {
3087 }
else if (!strncasecmp(language,
"he", 2)) {
3089 }
else if (!strncasecmp(language,
"is", 2)) {
3091 }
else if (!strncasecmp(language,
"vi", 2)) {
3106 while (!res && num) {
3109 if ( num > INT_MIN ) {
3114 }
else if (num < 20) {
3115 snprintf(fn,
sizeof(fn),
"digits/h-%d", num);
3117 }
else if (num < 100) {
3118 int tens = num / 10;
3121 snprintf(fn,
sizeof(fn),
"digits/h-%d", (tens * 10));
3123 snprintf(fn,
sizeof(fn),
"digits/%d", (tens * 10));
3125 }
else if (num < 1000) {
3126 int hundreds = num / 100;
3128 if (hundreds > 1 || t == 1) {
3138 }
else if (num < 1000000) {
3139 int thousands = num / 1000;
3141 if (thousands > 1 || t == 1) {
3152 }
else if (num < 1000000000) {
3153 int millions = num / 1000000;
3154 num = num % 1000000;
3164 }
else if (num < INT_MAX) {
3165 int billions = num / 1000000000;
3166 num = num % 1000000000;
3176 }
else if (num == INT_MAX) {
3180 ast_debug(1,
"Number '%d' is too big for me\n", num);
3186 if ((audiofd > -1) && (ctrlfd > -1)) {
3205 if ((audiofd > -1) && (ctrlfd > -1)) {
3222 char fn[256] =
"", fna[256] =
"";
3225 if (options && !strncasecmp(options,
"f", 1)) {
3227 }
else if (options && !strncasecmp(options,
"n", 1)) {
3236 while (!res && num) {
3239 if ( num > INT_MIN ) {
3244 }
else if (num < 100 && t) {
3247 }
else if (num < 20) {
3248 snprintf(fn,
sizeof(fn),
"digits/h-%d%s", num, gender);
3250 }
else if (num < 100) {
3251 int ones = num % 10;
3253 snprintf(fn,
sizeof(fn),
"digits/%d-and", ones);
3256 snprintf(fn,
sizeof(fn),
"digits/h-%d%s", num, gender);
3259 }
else if (num == 100 && t == 0) {
3260 snprintf(fn,
sizeof(fn),
"digits/h-hundred%s", gender);
3262 }
else if (num < 1000) {
3263 int hundreds = num / 100;
3265 if (hundreds == 1) {
3268 snprintf(fn,
sizeof(fn),
"digits/%d", hundreds);
3273 snprintf(fna,
sizeof(fna),
"digits/h-hundred%s", gender);
3276 }
else if (num < 1000000) {
3277 int thousands = num / 1000;
3279 if (thousands == 1) {
3286 snprintf(fna,
sizeof(fna),
"digits/h-thousand%s", gender);
3288 snprintf(fn,
sizeof(fn),
"digits/h-thousand%s", gender);
3299 snprintf(fn,
sizeof(fn),
"digits/h-thousand%s", gender);
3303 }
else if (num < 1000000000) {
3304 int millions = num / 1000000;
3305 num = num % 1000000;
3306 if (millions == 1) {
3312 snprintf(fna,
sizeof(fna),
"digits/h-million%s", gender);
3322 snprintf(fn,
sizeof(fn),
"digits/h-million%s", gender);
3326 }
else if (num < INT_MAX) {
3327 int billions = num / 1000000000;
3328 num = num % 1000000000;
3329 if (billions == 1) {
3335 snprintf(fna,
sizeof(fna),
"digits/h-milliard%s", gender);
3344 snprintf(fn,
sizeof(fna),
"digits/h-milliard%s", gender);
3348 }
else if (num == INT_MAX) {
3349 snprintf(fn,
sizeof(fn),
"digits/h-last%s", gender);
3352 ast_debug(1,
"Number '%d' is too big for me\n", num);
3358 if ((audiofd > -1) && (ctrlfd > -1))
3366 if ((audiofd > -1) && (ctrlfd > -1)) {
3385 char fn[256] =
"", fna[256] =
"";
3388 if (options && !strncasecmp(options,
"f", 1)) {
3390 }
else if (options && !strncasecmp(options,
"n", 1)) {
3399 while (!res && num) {
3402 if ( num > INT_MIN ) {
3407 }
else if (num < 100 && t) {
3410 }
else if (num < 20) {
3411 snprintf(fn,
sizeof(fn),
"digits/h-%d%s", num, gender);
3413 }
else if (num < 100) {
3414 int ones = num % 10;
3416 snprintf(fn,
sizeof(fn),
"digits/%d-and", ones);
3419 snprintf(fn,
sizeof(fn),
"digits/h-%d%s", num, gender);
3422 }
else if (num == 100 && t == 0) {
3423 snprintf(fn,
sizeof(fn),
"digits/h-hundred%s", gender);
3425 }
else if (num < 1000) {
3426 int hundreds = num / 100;
3428 if (hundreds == 1) {
3431 snprintf(fn,
sizeof(fn),
"digits/%d", hundreds);
3436 snprintf(fna,
sizeof(fna),
"digits/h-hundred%s", gender);
3439 }
else if (num < 1000000) {
3440 int thousands = num / 1000;
3442 if (thousands == 1) {
3449 snprintf(fna,
sizeof(fna),
"digits/h-thousand%s", gender);
3451 snprintf(fn,
sizeof(fn),
"digits/h-thousand%s", gender);
3462 snprintf(fn,
sizeof(fn),
"digits/h-thousand%s", gender);
3466 }
else if (num < 1000000000) {
3467 int millions = num / 1000000;
3468 num = num % 1000000;
3469 if (millions == 1) {
3475 snprintf(fna,
sizeof(fna),
"digits/h-million%s", gender);
3485 snprintf(fn,
sizeof(fn),
"digits/h-million%s", gender);
3489 }
else if (num < INT_MAX) {
3490 int billions = num / 1000000000;
3491 num = num % 1000000000;
3492 if (billions == 1) {
3498 snprintf(fna,
sizeof(fna),
"digits/h-milliard%s", gender);
3507 snprintf(fn,
sizeof(fna),
"digits/h-milliard%s", gender);
3511 }
else if (num == INT_MAX) {
3512 snprintf(fn,
sizeof(fn),
"digits/h-last%s", gender);
3515 ast_debug(1,
"Number '%d' is too big for me\n", num);
3521 if ((audiofd > -1) && (ctrlfd > -1))
3529 if ((audiofd > -1) && (ctrlfd > -1)) {
3548 ast_verb(3,
"ast_say_digits_full: started. num: %d, options=\"%s\"\n", num, options);
3550 if (options && !strncasecmp(options,
"m", 1)) {
3554 ast_verb(3,
"ast_say_digits_full: num: %d, options=\"%s\", mf=%d\n", num, options, mf);
3556 while (!res && num) {
3558 snprintf(fn,
sizeof(fn),
"digits/minus");
3559 if (num > INT_MIN) {
3564 }
else if (num < 21) {
3567 snprintf(fn,
sizeof(fn),
"digits/f-0%d", num);
3569 snprintf(fn,
sizeof(fn),
"digits/f-%d", num);
3573 snprintf(fn,
sizeof(fn),
"digits/m-0%d", num);
3575 snprintf(fn,
sizeof(fn),
"digits/m-%d", num);
3579 }
else if ((num < 100) && num >= 20) {
3580 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 10) * 10);
3582 }
else if ((num >= 100) && (num < 1000)) {
3583 int tmpnum = num / 100;
3584 snprintf(fn,
sizeof(fn),
"digits/%d00", tmpnum);
3585 num = num - (tmpnum * 100);
3586 }
else if ((num >= 1000) && (num < 10000)) {
3587 int tmpnum = num / 1000;
3588 snprintf(fn,
sizeof(fn),
"digits/%dk", tmpnum);
3589 num = num - (tmpnum * 1000);
3590 }
else if (num < 20000) {
3591 snprintf(fn,
sizeof(fn),
"digits/m-%d", (num / 1000));
3593 }
else if (num < 1000000) {
3598 snprintf(fn,
sizeof(fn),
"digits/1k");
3600 }
else if (num < 2000000) {
3601 snprintf(fn,
sizeof(fn),
"digits/1m");
3602 num = num % 1000000;
3603 }
else if (num < 3000000) {
3604 snprintf(fn,
sizeof(fn),
"digits/2m");
3605 num = num - 2000000;
3606 }
else if (num < 1000000000) {
3611 snprintf(fn,
sizeof(fn),
"digits/1m");
3612 num = num % 1000000;
3614 ast_debug(1,
"Number '%d' is too big for me\n", num);
3619 if ((audiofd > -1) && (ctrlfd > -1)) {
3636 char fn[256] =
"", fna[256] =
"";
3639 if (options && !strncasecmp(options,
"f", 1)) {
3641 }
else if (options && !strncasecmp(options,
"n", 1)) {
3650 while (!res && num) {
3653 if ( num > INT_MIN ) {
3658 }
else if (num < 100 && t) {
3661 }
else if (num < 20) {
3662 snprintf(fn,
sizeof(fn),
"digits/h-%d%s", num, gender);
3664 }
else if (num < 100) {
3665 int ones = num % 10;
3667 int tens = num - ones;
3668 snprintf(fn,
sizeof(fn),
"digits/h-%d%s", tens, gender);
3673 snprintf(fn,
sizeof(fn),
"digits/and");
3677 snprintf(fn,
sizeof(fn),
"digits/h-%d%s", num, gender);
3681 }
else if (num == 100 && t == 0) {
3682 snprintf(fn,
sizeof(fn),
"digits/h-hundred%s", gender);
3684 }
else if (num < 1000) {
3685 int hundreds = num / 100;
3687 if (hundreds == 1) {
3690 snprintf(fn,
sizeof(fn),
"digits/%d", hundreds);
3695 snprintf(fna,
sizeof(fna),
"digits/h-hundred%s", gender);
3698 }
else if (num < 1000000) {
3699 int thousands = num / 1000;
3701 if (thousands == 1) {
3709 snprintf(fna,
sizeof(fna),
"digits/h-thousand%s", gender);
3711 snprintf(fn,
sizeof(fn),
"digits/h-thousand%s", gender);
3722 snprintf(fn,
sizeof(fn),
"digits/h-thousand%s", gender);
3727 }
else if (num < 1000000000) {
3728 int millions = num / 1000000;
3729 num = num % 1000000;
3730 if (millions == 1) {
3737 snprintf(fna,
sizeof(fna),
"digits/h-million%s", gender);
3747 snprintf(fn,
sizeof(fn),
"digits/h-million%s", gender);
3752 }
else if (num < INT_MAX) {
3753 int billions = num / 1000000000;
3754 num = num % 1000000000;
3755 if (billions == 1) {
3761 snprintf(fna,
sizeof(fna),
"digits/h-milliard%s", gender);
3770 snprintf(fn,
sizeof(fna),
"digits/h-milliard%s", gender);
3775 }
else if (num == INT_MAX) {
3776 snprintf(fn,
sizeof(fn),
"digits/h-last%s", gender);
3779 ast_debug(1,
"Number '%d' is too big for me\n", num);
3785 if ((audiofd > -1) && (ctrlfd > -1))
3793 if ((audiofd > -1) && (ctrlfd > -1)) {
3809 if (!strncasecmp(lang,
"en", 2)) {
3811 }
else if (!strncasecmp(lang,
"da", 2)) {
3813 }
else if (!strncasecmp(lang,
"de", 2)) {
3815 }
else if (!strncasecmp(lang,
"fr", 2)) {
3817 }
else if (!strncasecmp(lang,
"gr", 2)) {
3819 }
else if (!strncasecmp(lang,
"ja", 2)) {
3821 }
else if (!strncasecmp(lang,
"he", 2)) {
3823 }
else if (!strncasecmp(lang,
"hu", 2)) {
3825 }
else if (!strncasecmp(lang,
"is", 2)) {
3827 }
else if (!strncasecmp(lang,
"ka", 2)) {
3829 }
else if (!strncasecmp(lang,
"nl", 2)) {
3831 }
else if (!strncasecmp(lang,
"pt", 2)) {
3833 }
else if (!strncasecmp(lang,
"th", 2)) {
3845 struct timeval when = { t, 0 };
3850 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
3856 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
3873 struct timeval when = { t, 0 };
3879 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
3889 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
3905 snprintf(fn,
sizeof(fn),
"digits/%d", (year / 100));
3908 res =
wait_file(chan, ints,
"digits/hundred", lang);
3909 if (!res && year % 100 != 0) {
3910 res =
ast_say_number(chan, (year % 100), ints, lang, (
char *) NULL);
3922 struct timeval when = { t, 0 };
3928 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
3938 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
3955 snprintf(fn,
sizeof(fn),
"digits/%d", (year / 100) );
3958 res =
wait_file(chan, ints,
"digits/hundred", lang);
3959 if (!res && year % 100 != 0) {
3960 res =
ast_say_number(chan, (year % 100), ints, lang, (
char *) NULL);
3972 struct timeval when = { t, 0 };
3983 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
3993 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
4004 struct timeval when = { t, 0 };
4010 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
4020 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
4033 struct timeval when = { t, 0 };
4039 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
4047 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
4062 struct timeval when = { t, 0 };
4068 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
4082 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
4098 struct timeval when = { t, 0 };
4104 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
4110 res =
wait_file(chan, ints,
"digits/pt-de", lang);
4111 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
4115 res =
wait_file(chan, ints,
"digits/pt-de", lang);
4125 struct timeval when = { t, 0 };
4131 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
4138 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
4159 struct timeval when = { t, 0 };
4165 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
4175 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
4191 snprintf(fn,
sizeof(fn),
"digits/%d", (year / 100));
4194 res =
wait_file(chan, ints,
"digits/hundred", lang);
4195 if (!res && year % 100 != 0) {
4196 res =
ast_say_number(chan, (year % 100), ints, lang, (
char *) NULL);
4207 if (!strncasecmp(lang,
"en", 2)) {
4209 }
else if (!strncasecmp(lang,
"da", 2)) {
4211 }
else if (!strncasecmp(lang,
"de", 2)) {
4213 }
else if (!strncasecmp(lang,
"es", 2)) {
4215 }
else if (!strncasecmp(lang,
"he", 2)) {
4217 }
else if (!strncasecmp(lang,
"fr", 2)) {
4219 }
else if (!strncasecmp(lang,
"gr", 2)) {
4221 }
else if (!strncasecmp(lang,
"is", 2)) {
4223 }
else if (!strncasecmp(lang,
"ja", 2)) {
4225 }
else if (!strncasecmp(lang,
"it", 2)) {
4227 }
else if (!strncasecmp(lang,
"nl", 2)) {
4229 }
else if (!strncasecmp(lang,
"pl", 2)) {
4231 }
else if (!strncasecmp(lang,
"pt", 2)) {
4233 }
else if (!strncasecmp(lang,
"th", 2)) {
4235 }
else if (!strncasecmp(lang,
"zh", 2)) {
4237 }
else if (!strncasecmp(lang,
"vi", 2)) {
4248 struct timeval when = { t, 0 };
4250 int res=0, offset, sndoffset;
4251 char sndfile[256], nextmsg[256];
4254 format =
"ABdY 'digits/at' IMp";
4258 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
4259 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
4260 switch (format[offset]) {
4264 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
4265 sndfile[sndoffset] = format[offset];
4267 sndfile[sndoffset] =
'\0';
4268 res =
wait_file(chan, ints, sndfile, lang);
4273 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
4274 res =
wait_file(chan, ints, nextmsg, lang);
4280 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
4281 res =
wait_file(chan, ints, nextmsg, lang);
4300 res =
wait_file(chan, ints,
"digits/19", lang);
4304 res =
wait_file(chan, ints,
"digits/oh", lang);
4317 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
4319 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
4320 res =
wait_file(chan, ints, nextmsg, lang);
4325 if (format[offset] ==
'H') {
4328 res =
wait_file(chan, ints,
"digits/oh", lang);
4333 res =
wait_file(chan, ints,
"digits/oh", lang);
4340 res =
wait_file(chan, ints,
"digits/20", lang);
4344 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", remaining);
4345 res =
wait_file(chan, ints, nextmsg, lang);
4354 if (format[offset] ==
'M') {
4355 res =
wait_file(chan, ints,
"digits/oclock", lang);
4357 res =
wait_file(chan, ints,
"digits/hundred", lang);
4359 }
else if (tm.
tm_min < 10) {
4360 res =
wait_file(chan, ints,
"digits/oh", lang);
4362 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_min);
4363 res =
wait_file(chan, ints, nextmsg, lang);
4376 res =
wait_file(chan, ints, nextmsg, lang);
4388 gettimeofday(&now, NULL);
4393 if (beg_today < t) {
4395 res =
wait_file(chan, ints,
"digits/today", lang);
4396 }
else if (beg_today - 86400 < t) {
4398 res =
wait_file(chan, ints,
"digits/yesterday", lang);
4399 }
else if (beg_today - 86400 * 6 < t) {
4402 }
else if (beg_today - 2628000 < t) {
4405 }
else if (beg_today - 15768000 < t) {
4429 if (beg_today < t) {
4431 }
else if ((beg_today - 86400) < t) {
4433 res =
wait_file(chan, ints,
"digits/yesterday", lang);
4434 }
else if (beg_today - 86400 * 6 < t) {
4437 }
else if (beg_today - 2628000 < t) {
4440 }
else if (beg_today - 15768000 < t) {
4455 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
4456 res =
wait_file(chan, ints, nextmsg, lang);
4457 }
else if (tm.
tm_sec < 10) {
4458 res =
wait_file(chan, ints,
"digits/oh", lang);
4460 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
4461 res =
wait_file(chan, ints, nextmsg, lang);
4476 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
4495 struct timeval when = { t, 0 };
4497 int res=0, offset, sndoffset;
4498 char sndfile[256], nextmsg[256];
4501 format =
"A dBY HMS";
4505 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
4506 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
4507 switch (format[offset]) {
4511 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
4512 sndfile[sndoffset] = format[offset];
4514 sndfile[sndoffset] =
'\0';
4515 res =
wait_file(chan, ints, sndfile, lang);
4520 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
4521 res =
wait_file(chan, ints, nextmsg, lang);
4527 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
4528 res =
wait_file(chan, ints, nextmsg, lang);
4552 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", (year / 100) );
4553 res =
wait_file(chan, ints, nextmsg, lang);
4555 res =
wait_file(chan, ints,
"digits/hundred", lang);
4556 if (!res && year % 100 != 0) {
4567 res =
wait_file(chan, ints,
"digits/oclock", lang);
4571 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
4573 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
4575 res =
wait_file(chan, ints, nextmsg, lang);
4581 res =
wait_file(chan, ints,
"digits/0", lang);
4593 if (!res &&
next_item(&format[offset + 1]) ==
'S') {
4595 res =
wait_file(chan, ints,
"minute", lang);
4597 res =
wait_file(chan, ints,
"minutes", lang);
4608 res =
wait_file(chan, ints, nextmsg, lang);
4624 if (beg_today < t) {
4626 res =
wait_file(chan, ints,
"digits/today", lang);
4627 }
else if (beg_today - 86400 < t) {
4629 res =
wait_file(chan, ints,
"digits/yesterday", lang);
4649 if (beg_today < t) {
4651 }
else if ((beg_today - 86400) < t) {
4653 res =
wait_file(chan, ints,
"digits/yesterday", lang);
4654 }
else if (beg_today - 86400 * 6 < t) {
4667 res =
wait_file(chan, ints,
"digits/and", lang);
4671 res =
wait_file(chan, ints,
"seconds", lang);
4684 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
4697 struct timeval when = { t, 0 };
4699 int res=0, offset, sndoffset;
4700 char sndfile[256], nextmsg[256];
4703 format =
"A dBY HMS";
4707 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
4708 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
4709 switch (format[offset]) {
4713 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
4714 sndfile[sndoffset] = format[offset];
4716 sndfile[sndoffset] =
'\0';
4717 res =
wait_file(chan, ints, sndfile, lang);
4722 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
4723 res =
wait_file(chan, ints, nextmsg, lang);
4729 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
4730 res =
wait_file(chan, ints, nextmsg, lang);
4754 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", (year / 100) );
4755 res =
wait_file(chan, ints, nextmsg, lang);
4757 res =
wait_file(chan, ints,
"digits/hundred", lang);
4758 if (!res && year % 100 != 0) {
4772 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
4774 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
4775 res =
wait_file(chan, ints, nextmsg, lang);
4777 res =
wait_file(chan, ints,
"digits/oclock", lang);
4785 res =
wait_file(chan, ints,
"digits/oclock", lang);
4790 if (
next_item(&format[offset + 1]) ==
'S') {
4792 }
else if (tm.
tm_min > 0) {
4796 if (!res &&
next_item(&format[offset + 1]) ==
'S') {
4798 res =
wait_file(chan, ints,
"minute", lang);
4800 res =
wait_file(chan, ints,
"minutes", lang);
4811 res =
wait_file(chan, ints, nextmsg, lang);
4827 if (beg_today < t) {
4829 res =
wait_file(chan, ints,
"digits/today", lang);
4830 }
else if (beg_today - 86400 < t) {
4832 res =
wait_file(chan, ints,
"digits/yesterday", lang);
4852 if (beg_today < t) {
4854 }
else if ((beg_today - 86400) < t) {
4856 res =
wait_file(chan, ints,
"digits/yesterday", lang);
4857 }
else if (beg_today - 86400 * 6 < t) {
4870 res =
wait_file(chan, ints,
"digits/and", lang);
4874 res =
wait_file(chan, ints, tm.
tm_sec == 1 ?
"second" :
"seconds", lang);
4887 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
4900 struct timeval when = { t, 0 };
4902 int res=0, offset, sndoffset;
4903 char sndfile[256], nextmsg[256];
4906 format =
"A dBY HMS";
4910 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
4911 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
4912 switch (format[offset]) {
4916 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
4917 sndfile[sndoffset] = format[offset];
4919 sndfile[sndoffset] =
'\0';
4920 res =
wait_file(chan, ints, sndfile, lang);
4925 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
4926 res =
wait_file(chan, ints, nextmsg, lang);
4932 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
4933 res =
wait_file(chan, ints, nextmsg, lang);
4957 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", (year / 100) );
4958 res =
wait_file(chan, ints, nextmsg, lang);
4960 res =
wait_file(chan, ints,
"digits/hundred", lang);
4961 if (!res && year % 100 != 0) {
4972 res =
wait_file(chan, ints,
"digits/oclock", lang);
4976 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
4978 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
4980 res =
wait_file(chan, ints, nextmsg, lang);
4986 res =
wait_file(chan, ints,
"digits/0", lang);
4997 res =
wait_file(chan, ints,
"digits/0", lang);
4999 if (
next_item(&format[offset + 1]) ==
'S')
5004 if (!res &&
next_item(&format[offset + 1]) ==
'S') {
5007 res =
wait_file(chan, ints,
"minute", lang);
5009 res =
wait_file(chan, ints,
"minutes", lang);
5020 res =
wait_file(chan, ints, nextmsg, lang);
5036 if (beg_today < t) {
5038 res =
wait_file(chan, ints,
"digits/today", lang);
5039 }
else if (beg_today - 86400 < t) {
5041 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5061 if (beg_today < t) {
5063 }
else if ((beg_today - 86400) < t) {
5065 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5066 }
else if (beg_today - 86400 * 6 < t) {
5079 res =
wait_file(chan, ints,
"digits/and", lang);
5083 if (!res && (tm.
tm_sec % 10 == 1) && (tm.
tm_sec != 11)) {
5084 res =
wait_file(chan, ints,
"second", lang);
5086 res =
wait_file(chan, ints,
"seconds", lang);
5099 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
5112 struct timeval when = { t, 0 };
5114 int res=0, offset, sndoffset;
5115 char sndfile[256], nextmsg[256];
5118 format =
"a 'digits/tee' e 'digits/duan' hY I 'digits/naliga' M 'digits/natee'";
5122 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
5123 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
5124 switch (format[offset]) {
5128 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
5129 sndfile[sndoffset] = format[offset];
5131 sndfile[sndoffset] =
'\0';
5132 res =
wait_file(chan, ints, sndfile, lang);
5137 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
5138 res =
wait_file(chan, ints, nextmsg, lang);
5144 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
5145 res =
wait_file(chan, ints, nextmsg, lang);
5165 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
5166 res =
wait_file(chan, ints, nextmsg, lang);
5173 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
5174 res =
wait_file(chan, ints, nextmsg, lang);
5197 if (beg_today < t) {
5199 res =
wait_file(chan, ints,
"digits/today", lang);
5200 }
else if (beg_today - 86400 < t) {
5202 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5203 }
else if (beg_today - 86400 * 6 < t) {
5206 }
else if (beg_today - 2628000 < t) {
5209 }
else if (beg_today - 15768000 < t) {
5232 if (beg_today < t) {
5234 }
else if ((beg_today - 86400) < t) {
5236 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5237 }
else if (beg_today - 86400 * 6 < t) {
5240 }
else if (beg_today - 2628000 < t) {
5243 }
else if (beg_today - 15768000 < t) {
5267 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
5297 #define IL_DATE_STR "AdBY" 5298 #define IL_TIME_STR "HM" 5299 #define IL_DATE_STR_FULL IL_DATE_STR " 'digits/at' " IL_TIME_STR 5303 struct timeval when = { t, 0 };
5305 int res = 0, offset, sndoffset;
5306 char sndfile[256], nextmsg[256];
5314 for (offset = 0; format[offset] !=
'\0'; offset++) {
5315 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
5316 switch (format[offset]) {
5320 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
5321 sndfile[sndoffset] = format[offset];
5323 sndfile[sndoffset] =
'\0';
5324 res =
wait_file(chan, ints, sndfile, lang);
5329 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
5330 res =
wait_file(chan, ints, nextmsg, lang);
5336 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
5337 res =
wait_file(chan, ints, nextmsg, lang);
5380 char todo = format[offset];
5386 if (beg_today < t) {
5389 res =
wait_file(chan, ints,
"digits/today", lang);
5391 }
else if (beg_today - 86400 < t) {
5393 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5394 }
else if ((todo !=
'Q') && (beg_today - 86400 * 6 < t)) {
5407 ints, lang,
"f", -1, -1
5430 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
5444 struct timeval when = { t, 0 };
5446 int res=0, offset, sndoffset;
5447 char sndfile[256], nextmsg[256];
5450 format =
"'digits/es-el' Ad 'digits/es-de' B 'digits/es-de' Y 'digits/at' IMp";
5454 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
5455 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
5456 switch (format[offset]) {
5460 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
5461 sndfile[sndoffset] = format[offset];
5463 sndfile[sndoffset] =
'\0';
5464 snprintf(nextmsg,
sizeof(nextmsg),
"%s", sndfile);
5465 res =
wait_file(chan, ints, nextmsg, lang);
5470 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
5471 res =
wait_file(chan, ints, nextmsg, lang);
5477 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
5478 res =
wait_file(chan, ints, nextmsg, lang);
5482 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", tm.
tm_mon +1);
5483 res =
wait_file(chan, ints, nextmsg, lang);
5500 snprintf(nextmsg,
sizeof(nextmsg),
"digits/1F");
5502 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
5504 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
5505 res =
wait_file(chan, ints, nextmsg, lang);
5520 res =
wait_file(chan, ints,
"digits/p-m", lang);
5522 res =
wait_file(chan, ints,
"digits/afternoon", lang);
5524 res =
wait_file(chan, ints,
"digits/a-m", lang);
5540 if (beg_today < t) {
5542 res =
wait_file(chan, ints,
"digits/today", lang);
5543 }
else if (beg_today - 86400 < t) {
5545 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5565 if (beg_today < t) {
5567 res =
wait_file(chan, ints,
"digits/today", lang);
5568 }
else if ((beg_today - 86400) < t) {
5570 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5571 }
else if (beg_today - 86400 * 6 < t) {
5585 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
5586 res =
wait_file(chan, ints, nextmsg, lang);
5587 }
else if (tm.
tm_sec < 10) {
5588 res =
wait_file(chan, ints,
"digits/oh", lang);
5590 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
5591 res =
wait_file(chan, ints, nextmsg, lang);
5593 }
else if ((tm.
tm_sec < 21) || (tm.
tm_sec % 10 == 0)) {
5594 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
5595 res =
wait_file(chan, ints, nextmsg, lang);
5598 ten = (tm.
tm_sec / 10) * 10;
5600 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", ten);
5601 res =
wait_file(chan, ints, nextmsg, lang);
5605 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", one);
5606 res =
wait_file(chan, ints, nextmsg, lang);
5620 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
5635 struct timeval when = { t, 0 };
5637 int res=0, offset, sndoffset;
5638 char sndfile[256], nextmsg[256];
5641 format =
"AdBY 'digits/at' IMp";
5645 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
5646 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
5647 switch (format[offset]) {
5651 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
5652 sndfile[sndoffset] = format[offset];
5654 sndfile[sndoffset] =
'\0';
5655 res =
wait_file(chan, ints, sndfile, lang);
5660 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
5661 res =
wait_file(chan, ints, nextmsg, lang);
5667 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
5668 res =
wait_file(chan, ints, nextmsg, lang);
5672 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", tm.
tm_mon +1);
5673 res =
wait_file(chan, ints, nextmsg, lang);
5679 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", tm.
tm_mday);
5680 res =
wait_file(chan, ints, nextmsg, lang);
5688 res =
wait_file(chan, ints,
"digits/2", lang);
5690 res =
wait_file(chan, ints,
"digits/thousand", lang);
5702 res =
wait_file(chan, ints,
"digits/thousand", lang);
5704 wait_file(chan, ints,
"digits/9", lang);
5705 wait_file(chan, ints,
"digits/hundred", lang);
5717 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
5719 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
5720 res =
wait_file(chan, ints, nextmsg, lang);
5722 res =
wait_file(chan, ints,
"digits/oclock", lang);
5729 res =
wait_file(chan, ints,
"digits/oclock", lang);
5745 res =
wait_file(chan, ints, nextmsg, lang);
5761 if (beg_today < t) {
5763 res =
wait_file(chan, ints,
"digits/today", lang);
5764 }
else if (beg_today - 86400 < t) {
5766 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5786 if (beg_today < t) {
5788 }
else if ((beg_today - 86400) < t) {
5790 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5791 }
else if (beg_today - 86400 * 6 < t) {
5806 res =
wait_file(chan, ints,
"second", lang);
5818 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
5831 struct timeval when = { t, 0 };
5833 int res=0, offset, sndoffset;
5834 char sndfile[256], nextmsg[256];
5837 format =
"AdB 'digits/at' IMp";
5841 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
5842 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
5843 switch (format[offset]) {
5847 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
5848 sndfile[sndoffset] = format[offset];
5850 sndfile[sndoffset] =
'\0';
5851 res =
wait_file(chan, ints, sndfile, lang);
5856 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
5857 res =
wait_file(chan, ints, nextmsg, lang);
5863 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
5864 res =
wait_file(chan, ints, nextmsg, lang);
5868 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", tm.
tm_mon +1);
5869 res =
wait_file(chan, ints, nextmsg, lang);
5875 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", tm.
tm_mday);
5876 res =
wait_file(chan, ints, nextmsg, lang);
5886 res =
wait_file(chan, ints,
"digits/ore-2000", lang);
5890 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year - 100);
5891 res =
wait_file(chan, ints, nextmsg, lang);
5899 res =
wait_file(chan, ints,
"digits/ore-1900", lang);
5900 if ((!res) && (tm.
tm_year != 0)) {
5903 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year);
5904 res =
wait_file(chan, ints, nextmsg, lang);
5910 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", ten * 10);
5911 res =
wait_file(chan, ints, nextmsg, lang);
5914 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", one);
5915 res =
wait_file(chan, ints, nextmsg, lang);
5929 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
5931 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
5933 res =
wait_file(chan, ints, nextmsg, lang);
5939 res =
wait_file(chan, ints,
"digits/ore-mezzanotte", lang);
5941 res =
wait_file(chan, ints,
"digits/ore-una", lang);
5958 res =
wait_file(chan, ints, nextmsg, lang);
5974 if (beg_today < t) {
5976 res =
wait_file(chan, ints,
"digits/today", lang);
5977 }
else if (beg_today - 86400 < t) {
5979 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5996 if (beg_today < t) {
5998 }
else if ((beg_today - 86400) < t) {
6000 res =
wait_file(chan, ints,
"digits/yesterday", lang);
6001 }
else if (beg_today - 86400 * 6 < t) {
6015 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
6016 res =
wait_file(chan, ints, nextmsg, lang);
6017 }
else if (tm.
tm_sec < 10) {
6018 res =
wait_file(chan, ints,
"digits/oh", lang);
6020 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
6021 res =
wait_file(chan, ints, nextmsg, lang);
6023 }
else if ((tm.
tm_sec < 21) || (tm.
tm_sec % 10 == 0)) {
6024 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
6025 res =
wait_file(chan, ints, nextmsg, lang);
6028 ten = (tm.
tm_sec / 10) * 10;
6030 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", ten);
6031 res =
wait_file(chan, ints, nextmsg, lang);
6035 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", one);
6036 res =
wait_file(chan, ints, nextmsg, lang);
6050 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
6063 struct timeval when = { t, 0 };
6065 int res=0, offset, sndoffset;
6066 char sndfile[256], nextmsg[256];
6069 format =
"AdBY 'digits/at' IMp";
6073 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
6074 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
6075 switch (format[offset]) {
6079 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
6080 sndfile[sndoffset] = format[offset];
6082 sndfile[sndoffset] =
'\0';
6083 res =
wait_file(chan, ints, sndfile, lang);
6088 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
6089 res =
wait_file(chan, ints, nextmsg, lang);
6095 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
6096 res =
wait_file(chan, ints, nextmsg, lang);
6100 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", tm.
tm_mon +1);
6101 res =
wait_file(chan, ints, nextmsg, lang);
6111 res =
wait_file(chan, ints,
"digits/2", lang);
6113 res =
wait_file(chan, ints,
"digits/thousand", lang);
6125 res =
wait_file(chan, ints,
"digits/19", lang);
6129 res =
wait_file(chan, ints,
"digits/oh", lang);
6131 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year);
6132 res =
wait_file(chan, ints, nextmsg, lang);
6134 }
else if (tm.
tm_year <= 20) {
6136 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year);
6137 res =
wait_file(chan, ints, nextmsg, lang);
6143 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", ten * 10);
6144 res =
wait_file(chan, ints, nextmsg, lang);
6147 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", one);
6148 res =
wait_file(chan, ints, nextmsg, lang);
6162 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
6164 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
6165 res =
wait_file(chan, ints, nextmsg, lang);
6172 res =
wait_file(chan, ints,
"digits/nl-uur", lang);
6186 res =
wait_file(chan, ints, nextmsg, lang);
6202 if (beg_today < t) {
6204 res =
wait_file(chan, ints,
"digits/today", lang);
6205 }
else if (beg_today - 86400 < t) {
6207 res =
wait_file(chan, ints,
"digits/yesterday", lang);
6224 if (beg_today < t) {
6226 }
else if ((beg_today - 86400) < t) {
6228 res =
wait_file(chan, ints,
"digits/yesterday", lang);
6229 }
else if (beg_today - 86400 * 6 < t) {
6253 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
6266 struct timeval when = { thetime, 0 };
6268 int res=0, offset, sndoffset;
6269 char sndfile[256], nextmsg[256];
6273 for (offset = 0 ; format[offset] !=
'\0' ; offset++) {
6275 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
6276 switch (format[offset]) {
6280 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
6281 sndfile[sndoffset] = format[offset];
6283 sndfile[sndoffset] =
'\0';
6284 res =
wait_file(chan, ints, sndfile, lang);
6289 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
6290 res =
wait_file(chan, ints, nextmsg, lang);
6296 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
6297 res =
wait_file(chan, ints, nextmsg, lang);
6308 res =
wait_file(chan, ints,
"digits/h-30", lang);
6312 res =
wait_file(chan, ints,
"digits/h-20", lang);
6316 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", remaining);
6317 res =
wait_file(chan, ints, nextmsg, lang);
6323 res =
wait_file(chan, ints,
"digits/2", lang);
6325 res =
wait_file(chan, ints,
"digits/1000.2", lang);
6330 }
else if (tm.
tm_year == 100) {
6331 res =
wait_file(chan, ints,
"digits/h-2000", lang);
6338 res =
wait_file(chan, ints,
"digits/1000", lang);
6340 wait_file(chan, ints,
"digits/900", lang);
6346 wait_file(chan, ints,
"digits/year", lang);
6354 snprintf(nextmsg,
sizeof(nextmsg),
"digits/t-%d", tm.
tm_hour - 12);
6356 snprintf(nextmsg,
sizeof(nextmsg),
"digits/t-%d", tm.
tm_hour);
6358 res =
wait_file(chan, ints, nextmsg, lang);
6364 snprintf(nextmsg,
sizeof(nextmsg),
"digits/t-%d", tm.
tm_hour);
6365 res =
wait_file(chan, ints, nextmsg, lang);
6367 res =
wait_file(chan, ints,
"digits/t-24", lang);
6373 if (format[offset] ==
'M') {
6374 res =
wait_file(chan, ints,
"digits/oclock", lang);
6376 res =
wait_file(chan, ints,
"digits/100", lang);
6388 res =
wait_file(chan, ints, nextmsg, lang);
6401 if (beg_today < thetime) {
6403 res =
wait_file(chan, ints,
"digits/today", lang);
6404 }
else if (beg_today - 86400 < thetime) {
6406 res =
wait_file(chan, ints,
"digits/yesterday", lang);
6423 if (beg_today < thetime) {
6425 }
else if ((beg_today - 86400) < thetime) {
6427 res =
wait_file(chan, ints,
"digits/yesterday", lang);
6428 }
else if (beg_today - 86400 * 6 < thetime) {
6441 res =
wait_file(chan, ints,
"digits/and", lang);
6444 res =
wait_file(chan, ints,
"digits/1z", lang);
6446 res =
wait_file(chan, ints,
"digits/second-a", lang);
6454 if (one > 1 && one < 5 && ten != 1)
6455 res =
wait_file(chan, ints,
"seconds", lang);
6457 res =
wait_file(chan, ints,
"second", lang);
6471 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
6483 struct timeval when = { t, 0 };
6485 int res=0, offset, sndoffset;
6486 char sndfile[256], nextmsg[256];
6489 format =
"Ad 'digits/pt-de' B 'digits/pt-de' Y I 'digits/pt-e' Mp";
6493 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
6494 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
6495 switch (format[offset]) {
6499 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
6500 sndfile[sndoffset] = format[offset];
6502 sndfile[sndoffset] =
'\0';
6503 snprintf(nextmsg,
sizeof(nextmsg),
"%s", sndfile);
6504 res =
wait_file(chan, ints, nextmsg, lang);
6509 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
6510 res =
wait_file(chan, ints, nextmsg, lang);
6516 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
6517 res =
wait_file(chan, ints, nextmsg, lang);
6521 if (!strcasecmp(lang,
"pt_BR")) {
6524 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", tm.
tm_mon +1);
6525 res =
wait_file(chan, ints, nextmsg, lang);
6540 if (!strcasecmp(lang,
"pt_BR")) {
6542 if (format[offset] ==
'I')
6543 res =
wait_file(chan, ints,
"digits/pt-a", lang);
6545 res =
wait_file(chan, ints,
"digits/pt-meianoite", lang);
6546 }
else if (tm.
tm_hour == 12) {
6547 if (format[offset] ==
'I')
6548 res =
wait_file(chan, ints,
"digits/pt-ao", lang);
6550 res =
wait_file(chan, ints,
"digits/pt-meiodia", lang);
6552 if (format[offset] ==
'I') {
6554 res =
wait_file(chan, ints,
"digits/pt-as", lang);
6556 res =
wait_file(chan, ints,
"digits/pt-a", lang);
6563 if (format[offset] ==
'I')
6564 res =
wait_file(chan, ints,
"digits/pt-ah", lang);
6566 res =
wait_file(chan, ints,
"digits/pt-meianoite", lang);
6569 if (format[offset] ==
'I')
6570 res =
wait_file(chan, ints,
"digits/pt-ao", lang);
6572 res =
wait_file(chan, ints,
"digits/pt-meiodia", lang);
6575 if (format[offset] ==
'I') {
6576 res =
wait_file(chan, ints,
"digits/pt-ah", lang);
6579 res =
wait_file(chan, ints,
"digits/pt-sss", lang);
6589 if (!strcasecmp(lang,
"pt_BR")) {
6591 if ((!res) && (format[offset] ==
'H')) {
6593 res =
wait_file(chan, ints,
"digits/hours", lang);
6595 res =
wait_file(chan, ints,
"digits/hour", lang);
6604 res =
wait_file(chan, ints,
"digits/20", lang);
6608 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", remaining);
6609 res =
wait_file(chan, ints, nextmsg, lang);
6617 if (!strcasecmp(lang,
"pt_BR")) {
6621 res =
wait_file(chan, ints,
"minutes", lang);
6623 res =
wait_file(chan, ints,
"minute", lang);
6628 res =
wait_file(chan, ints,
"digits/pt-hora", lang);
6631 res =
wait_file(chan, ints,
"digits/pt-sss", lang);
6640 if (!strcasecmp(lang,
"pt_BR")) {
6642 res =
wait_file(chan, ints,
"digits/pt-da", lang);
6645 res =
wait_file(chan, ints,
"digits/morning", lang);
6647 res =
wait_file(chan, ints,
"digits/afternoon", lang);
6648 else res =
wait_file(chan, ints,
"digits/night", lang);
6653 res =
wait_file(chan, ints,
"digits/p-m", lang);
6655 res =
wait_file(chan, ints,
"digits/a-m", lang);
6672 if (beg_today < t) {
6674 res =
wait_file(chan, ints,
"digits/today", lang);
6675 }
else if (beg_today - 86400 < t) {
6677 res =
wait_file(chan, ints,
"digits/yesterday", lang);
6697 if (beg_today < t) {
6699 }
else if ((beg_today - 86400) < t) {
6701 res =
wait_file(chan, ints,
"digits/yesterday", lang);
6702 }
else if (beg_today - 86400 * 6 < t) {
6715 if (!strcasecmp(lang,
"pt_BR")) {
6719 res =
wait_file(chan, ints,
"seconds", lang);
6721 res =
wait_file(chan, ints,
"second", lang);
6726 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
6727 res =
wait_file(chan, ints, nextmsg, lang);
6728 }
else if (tm.
tm_sec < 10) {
6729 res =
wait_file(chan, ints,
"digits/oh", lang);
6731 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
6732 res =
wait_file(chan, ints, nextmsg, lang);
6734 }
else if ((tm.
tm_sec < 21) || (tm.
tm_sec % 10 == 0)) {
6735 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
6736 res =
wait_file(chan, ints, nextmsg, lang);
6739 ten = (tm.
tm_sec / 10) * 10;
6741 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", ten);
6742 res =
wait_file(chan, ints, nextmsg, lang);
6746 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", one);
6747 res =
wait_file(chan, ints, nextmsg, lang);
6762 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
6775 struct timeval when = { t, 0 };
6777 int res=0, offset, sndoffset;
6778 char sndfile[256], nextmsg[256];
6785 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
6786 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
6787 switch (format[offset]) {
6791 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
6792 sndfile[sndoffset] = format[offset];
6794 sndfile[sndoffset] =
'\0';
6795 res =
wait_file(chan, ints, sndfile, lang);
6800 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
6801 res =
wait_file(chan, ints, nextmsg, lang);
6808 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
6809 res =
wait_file(chan, ints, nextmsg, lang);
6815 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_mday);
6816 res =
wait_file(chan, ints, nextmsg, lang);
6818 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_mday - (tm.
tm_mday % 10));
6819 res =
wait_file(chan, ints, nextmsg, lang);
6821 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_mday % 10);
6822 res =
wait_file(chan, ints, nextmsg, lang);
6825 if (!res) res =
wait_file(chan, ints,
"digits/day", lang);
6830 res =
wait_file(chan, ints,
"digits/2", lang);
6832 res =
wait_file(chan, ints,
"digits/thousand", lang);
6836 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", (tm.
tm_year - 100) / 10);
6837 res =
wait_file(chan, ints, nextmsg, lang);
6839 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", (tm.
tm_year - 100) % 10);
6840 res =
wait_file(chan, ints, nextmsg, lang);
6845 res =
wait_file(chan, ints,
"digits/year", lang);
6852 res =
wait_file(chan, ints,
"digits/1", lang);
6854 res =
wait_file(chan, ints,
"digits/9", lang);
6859 res =
wait_file(chan, ints,
"digits/0", lang);
6861 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year);
6862 res =
wait_file(chan, ints, nextmsg, lang);
6866 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year / 10);
6867 res =
wait_file(chan, ints, nextmsg, lang);
6869 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year % 10);
6870 res =
wait_file(chan, ints, nextmsg, lang);
6876 res =
wait_file(chan, ints,
"digits/year", lang);
6886 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
6888 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
6889 res =
wait_file(chan, ints, nextmsg, lang);
6891 res =
wait_file(chan, ints,
"digits/oclock", lang);
6896 res =
wait_file(chan, ints,
"digits/0", lang);
6904 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
6905 res =
wait_file(chan, ints, nextmsg, lang);
6907 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - (tm.
tm_hour % 10));
6908 res =
wait_file(chan, ints, nextmsg, lang);
6910 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour % 10);
6911 res =
wait_file(chan, ints, nextmsg, lang);
6915 res =
wait_file(chan, ints,
"digits/oclock", lang);
6922 res =
wait_file(chan, ints,
"digits/0", lang);
6924 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_min);
6925 res =
wait_file(chan, ints, nextmsg, lang);
6927 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_min - (tm.
tm_min % 10));
6928 res =
wait_file(chan, ints, nextmsg, lang);
6930 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_min % 10);
6931 res =
wait_file(chan, ints, nextmsg, lang);
6935 res =
wait_file(chan, ints,
"minute", lang);
6945 res =
wait_file(chan, ints, nextmsg, lang);
6961 if (beg_today < t) {
6963 res =
wait_file(chan, ints,
"digits/today", lang);
6964 }
else if (beg_today - 86400 < t) {
6966 res =
wait_file(chan, ints,
"digits/yesterday", lang);
6986 if (beg_today < t) {
6988 }
else if ((beg_today - 86400) < t) {
6990 res =
wait_file(chan, ints,
"digits/yesterday", lang);
6991 }
else if (beg_today - 86400 * 6 < t) {
7006 res =
wait_file(chan, ints,
"digits/0", lang);
7008 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
7009 res =
wait_file(chan, ints, nextmsg, lang);
7011 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec - (tm.
tm_sec % 10));
7012 res =
wait_file(chan, ints, nextmsg, lang);
7014 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec % 10);
7015 res =
wait_file(chan, ints, nextmsg, lang);
7019 res =
wait_file(chan, ints,
"second", lang);
7031 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
7043 if (!strncasecmp(lang,
"en", 2)) {
7045 }
else if (!strncasecmp(lang,
"de", 2)) {
7047 }
else if (!strncasecmp(lang,
"fr", 2)) {
7049 }
else if (!strncasecmp(lang,
"gr", 2)) {
7051 }
else if (!strncasecmp(lang,
"ja", 2)) {
7053 }
else if (!strncasecmp(lang,
"he", 2)) {
7055 }
else if (!strncasecmp(lang,
"hu", 2)) {
7057 }
else if (!strncasecmp(lang,
"ka", 2)) {
7059 }
else if (!strncasecmp(lang,
"nl", 2)) {
7061 }
else if (!strncasecmp(lang,
"pt_BR", 5)) {
7063 }
else if (!strncasecmp(lang,
"pt", 2)) {
7065 }
else if (!strncasecmp(lang,
"th", 2)) {
7067 }
else if (!strncasecmp(lang,
"zh", 2)) {
7078 struct timeval when = { t, 0 };
7087 else if (hour == 12)
7089 else if (hour > 12) {
7127 struct timeval when = { t, 0 };
7147 struct timeval when = { t, 0 };
7170 struct timeval when = { t, 0 };
7189 struct timeval when = { t, 0 };
7209 struct timeval when = { t, 0 };
7220 res =
wait_file(chan, ints,
"digits/pt-e", lang);
7225 res =
wait_file(chan, ints,
"digits/pt-hora", lang);
7228 res =
wait_file(chan, ints,
"digits/pt-sss", lang);
7238 struct timeval when = { t, 0 };
7247 res =
wait_file(chan, ints,
"digits/hours", lang);
7249 res =
wait_file(chan, ints,
"digits/hour", lang);
7251 if ((!res) && (tm.
tm_min)) {
7252 res =
wait_file(chan, ints,
"digits/pt-e", lang);
7257 res =
wait_file(chan, ints,
"minutes", lang);
7259 res =
wait_file(chan, ints,
"minute", lang);
7268 struct timeval when = { t, 0 };
7286 struct timeval when = { t, 0 };
7295 else if (hour == 12)
7297 else if (hour > 12) {
7328 struct timeval when = { t, 0 };
7364 if (!strncasecmp(lang,
"en", 2)) {
7366 }
else if (!strncasecmp(lang,
"de", 2)) {
7368 }
else if (!strncasecmp(lang,
"fr", 2)) {
7370 }
else if (!strncasecmp(lang,
"gr", 2)) {
7372 }
else if (!strncasecmp(lang,
"ja", 2)) {
7374 }
else if (!strncasecmp(lang,
"he", 2)) {
7376 }
else if (!strncasecmp(lang,
"hu", 2)) {
7378 }
else if (!strncasecmp(lang,
"ka", 2)) {
7380 }
else if (!strncasecmp(lang,
"nl", 2)) {
7382 }
else if (!strncasecmp(lang,
"pt_BR", 5)) {
7384 }
else if (!strncasecmp(lang,
"pt", 2)) {
7386 }
else if (!strncasecmp(lang,
"th", 2)) {
7388 }
else if (!strncasecmp(lang,
"zh", 2)) {
7399 struct timeval when = { t, 0 };
7407 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
7413 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
7424 else if (hour == 12)
7426 else if (hour > 12) {
7466 struct timeval when = { t, 0 };
7481 struct timeval when = { t, 0 };
7495 struct timeval when = { t, 0 };
7506 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
7512 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
7536 struct timeval when = { t, 0 };
7555 struct timeval when = { t, 0 };
7563 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
7569 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
7580 else if (hour == 12)
7582 else if (hour > 12) {
7622 struct timeval when = { t, 0 };
7636 struct timeval when = { t, 0 };
7643 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
7649 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
7679 struct timeval when = { t, 0 };
7689 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
7697 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
7706 else if (hour == 12)
7708 else if (hour > 12) {
7739 struct timeval when = { t, 0 };
7747 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
7754 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
7804 if (!strncasecmp(lang,
"en", 2)) {
7806 }
else if (!strncasecmp(lang,
"fr", 2)) {
7808 }
else if (!strncasecmp(lang,
"he", 2)) {
7810 }
else if (!strncasecmp(lang,
"ka", 2)) {
7812 }
else if (!strncasecmp(lang,
"pt", 2)) {
7824 struct timeval nowtv =
ast_tvnow(), when = { t, 0 };
7833 if ((daydiff < 0) || (daydiff > 6)) {
7836 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
7844 }
else if (daydiff) {
7847 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
7862 struct timeval nowtv =
ast_tvnow(), when = { t, 0 };
7871 if ((daydiff < 0) || (daydiff > 6)) {
7874 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
7882 }
else if (daydiff) {
7885 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
7903 struct timeval nowtv =
ast_tvnow(), when = { t, 0 };
7909 if ((daydiff < 0) || (daydiff > 6)) {
7914 res =
wait_file(chan, ints,
"digits/pt-de", lang);
7915 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
7919 }
else if (daydiff) {
7921 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
7925 if (!strcasecmp(lang,
"pt_BR")) {
7939 res =
wait_file(chan, ints,
"digits/pt-sss", lang);
7950 struct timeval nowt =
ast_tvnow(), when = { t, 0 };
7959 if ((daydiff < 0) || (daydiff > 6)) {
7962 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
7970 }
else if (daydiff) {
7973 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
7999 snprintf(fn,
sizeof(fn),
"digits/female-%d", num);
8001 }
else if (num < 13) {
8003 }
else if (num <100 ) {
8004 tmp = (num/10) * 10;
8006 snprintf(fn,
sizeof(fn),
"digits/%d", tmp);
8050 while (!res && num ) {
8053 snprintf(fn,
sizeof(fn),
"digits/%d", num);
8055 }
else if (num <= 100) {
8057 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
8059 }
else if (num < 200) {
8061 snprintf(fn,
sizeof(fn),
"digits/hundred-100");
8063 }
else if (num < 1000) {
8065 snprintf(fn,
sizeof(fn),
"digits/hundred-%d", (num/100)*100);
8067 }
else if (num < 2000){
8068 snprintf(fn,
sizeof(fn),
"digits/xilia");
8072 if (num < 1000000) {
8077 snprintf(fn,
sizeof(fn),
"digits/thousands");
8079 if (num < 1000000000) {
8084 snprintf(fn,
sizeof(fn),
"digits/millions");
8086 ast_debug(1,
"Number '%d' is too big for me\n", num);
8093 if ((audiofd > -1) && (ctrlfd > -1))
8114 while (!res && (num || playh)) {
8117 if ( num > INT_MIN ) {
8125 }
else if (num < 20) {
8126 snprintf(fn,
sizeof(fn),
"digits/%d", num);
8128 }
else if (num < 100) {
8129 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
8133 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
8137 if (num < 1000000) {
8142 snprintf(fn,
sizeof(fn),
"digits/thousand");
8144 if (num < 1000000000) {
8151 ast_debug(1,
"Number '%d' is too big for me\n", num);
8159 if ((audiofd > -1) && (ctrlfd > -1))
8183 struct timeval when = { t, 0 };
8192 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
8203 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
8219 struct timeval tv = { t, 0 };
8232 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
8242 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
8263 struct timeval when = { t, 0 };
8273 else if (hour == 12)
8275 else if (hour > 12) {
8310 struct timeval tv = { t, 0 };
8320 else if (hour == 12)
8322 else if (hour > 12) {
8334 if (hour == 9 || hour == 21) {
8357 struct timeval when = { t, 0 };
8366 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
8377 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
8390 struct timeval tv = { t, 0 };
8403 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
8413 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
8422 else if (hour == 12)
8424 else if (hour > 12) {
8435 if (hour == 9 || hour == 21) {
8457 struct timeval when = { t, 0 };
8459 int res=0, offset, sndoffset;
8460 char sndfile[256], nextmsg[256];
8463 format =
"AdBY 'digits/at' IMp";
8467 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
8468 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
8469 switch (format[offset]) {
8473 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
8474 sndfile[sndoffset] = format[offset];
8476 sndfile[sndoffset] =
'\0';
8477 res =
wait_file(chan, ints, sndfile, lang);
8482 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
8483 res =
wait_file(chan, ints, nextmsg, lang);
8489 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
8490 res =
wait_file(chan, ints, nextmsg, lang);
8540 res =
wait_file(chan, ints, nextmsg, lang);
8556 if (beg_today < t) {
8558 res =
wait_file(chan, ints,
"digits/today", lang);
8559 }
else if (beg_today - 86400 < t) {
8561 res =
wait_file(chan, ints,
"digits/yesterday", lang);
8581 if (beg_today < t) {
8583 }
else if ((beg_today - 86400) < t) {
8585 res =
wait_file(chan, ints,
"digits/yesterday", lang);
8586 }
else if (beg_today - 86400 * 6 < t) {
8600 res =
wait_file(chan, ints, nextmsg, lang);
8605 res =
wait_file(chan, ints, nextmsg, lang);
8616 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
8629 struct timeval tv = { time, 0 };
8631 int res = 0, offset, sndoffset;
8632 char sndfile[256], nextmsg[256];
8635 format =
"YbdAPIMS";
8639 for (offset = 0; format[offset] !=
'\0'; offset++) {
8640 ast_log(
LOG_DEBUG,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
8641 switch (format[offset]) {
8645 for (sndoffset = 0; (format[++offset] !=
'\'') && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
8646 sndfile[sndoffset] = format[offset];
8648 sndfile[sndoffset] =
'\0';
8649 res =
wait_file(chan,ints,sndfile,lang);
8654 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
8655 res =
wait_file(chan,ints,nextmsg,lang);
8661 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
8662 res =
wait_file(chan,ints,nextmsg,lang);
8668 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d_2", tm.
tm_mday);
8669 res =
wait_file(chan,ints,nextmsg,lang);
8672 res =
wait_file(chan,ints,
"digits/20",lang);
8674 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_mday - 20);
8675 res =
wait_file(chan,ints,nextmsg,lang);
8677 res =
wait_file(chan,ints,
"digits/nichi",lang);
8678 }
else if (tm.
tm_mday == 30) {
8680 res =
wait_file(chan,ints,
"digits/h-30_2",lang);
8683 res =
wait_file(chan,ints,
"digits/30",lang);
8684 res =
wait_file(chan,ints,
"digits/1",lang);
8685 res =
wait_file(chan,ints,
"digits/nichi",lang);
8691 res =
wait_file(chan,ints,
"digits/2",lang);
8693 res =
wait_file(chan,ints,
"digits/thousand",lang);
8698 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year - 100);
8699 res =
wait_file(chan,ints,nextmsg,lang);
8707 res =
wait_file(chan,ints,
"digits/19",lang);
8711 res =
wait_file(chan,ints,
"digits/oh",lang);
8713 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year);
8714 res =
wait_file(chan,ints,nextmsg,lang);
8716 }
else if (tm.
tm_year <= 20) {
8718 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year);
8719 res =
wait_file(chan,ints,nextmsg,lang);
8725 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", ten * 10);
8726 res =
wait_file(chan,ints,nextmsg,lang);
8729 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", one);
8730 res =
wait_file(chan,ints,nextmsg,lang);
8737 res =
wait_file(chan,ints,
"digits/nen",lang);
8743 snprintf(nextmsg,
sizeof(nextmsg),
"digits/p-m");
8745 snprintf(nextmsg,
sizeof(nextmsg),
"digits/a-m");
8746 res =
wait_file(chan,ints,nextmsg,lang);
8752 snprintf(nextmsg,
sizeof(nextmsg),
"digits/12");
8754 snprintf(nextmsg,
sizeof(nextmsg),
"digits/9_2");
8756 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
8758 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
8759 res =
wait_file(chan,ints,nextmsg,lang);
8760 if(!res) res =
wait_file(chan,ints,
"digits/ji",lang);
8768 res =
wait_file(chan,ints,
"digits/20",lang);
8772 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", remainder);
8773 res =
wait_file(chan,ints,nextmsg,lang);
8777 res =
wait_file(chan,ints,
"digits/ji",lang);
8782 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_min);
8783 res =
wait_file(chan,ints,nextmsg,lang);
8786 ten = (tm.
tm_min / 10) * 10;
8788 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", ten);
8789 res =
wait_file(chan,ints,nextmsg,lang);
8793 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", one);
8794 res =
wait_file(chan,ints,nextmsg,lang);
8798 res =
wait_file(chan,ints,
"digits/fun",lang);
8807 gettimeofday(&now,
NULL);
8812 if (beg_today < time) {
8814 res =
wait_file(chan,ints,
"digits/today",lang);
8815 }
else if (beg_today - 86400 < time) {
8817 res =
wait_file(chan,ints,
"digits/yesterday",lang);
8830 gettimeofday(&now,
NULL);
8835 if (beg_today < time) {
8837 }
else if ((beg_today - 86400) < time) {
8839 res =
wait_file(chan,ints,
"digits/yesterday",lang);
8840 }
else if (beg_today - 86400 * 6 < time) {
8854 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
8855 res =
wait_file(chan,ints,nextmsg,lang);
8856 }
else if ((tm.
tm_sec < 21) || (tm.
tm_sec % 10 == 0)) {
8857 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
8858 res =
wait_file(chan,ints,nextmsg,lang);
8861 ten = (tm.
tm_sec / 10) * 10;
8863 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", ten);
8864 res =
wait_file(chan,ints,nextmsg,lang);
8868 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", one);
8869 res =
wait_file(chan,ints,nextmsg,lang);
8873 res =
wait_file(chan,ints,
"digits/byou",lang);
8884 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
8897 struct timeval when = { t, 0 };
8899 int res = 0, offset, sndoffset;
8900 char sndfile[256], nextmsg[256];
8903 format =
"A 'digits/day' eB 'digits/year' Y 'digits/at' k 'hours' M 'minutes' p";
8907 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
8908 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
8909 switch (format[offset]) {
8913 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
8914 sndfile[sndoffset] = format[offset];
8916 sndfile[sndoffset] =
'\0';
8917 res =
wait_file(chan, ints, sndfile, lang);
8922 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
8923 res =
wait_file(chan, ints, nextmsg, lang);
8929 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
8930 res =
wait_file(chan, ints, nextmsg, lang);
8949 res =
wait_file(chan, ints,
"digits/19", lang);
8953 res =
wait_file(chan, ints,
"digits/odd", lang);
8966 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
8968 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
8969 res =
wait_file(chan, ints, nextmsg, lang);
8974 if (format[offset] ==
'H') {
8977 res =
wait_file(chan, ints,
"digits/0", lang);
8982 res =
wait_file(chan, ints,
"digits/0", lang);
8989 res =
wait_file(chan, ints,
"digits/20", lang);
8993 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", remaining);
8994 res =
wait_file(chan, ints, nextmsg, lang);
9011 res =
wait_file(chan, ints, nextmsg, lang);
9023 gettimeofday(&now, NULL);
9028 if (beg_today < t) {
9030 res =
wait_file(chan, ints,
"digits/today", lang);
9031 }
else if (beg_today - 86400 < t) {
9033 res =
wait_file(chan, ints,
"digits/yesterday", lang);
9034 }
else if (beg_today - 86400 * 6 < t) {
9037 }
else if (beg_today - 2628000 < t) {
9040 }
else if (beg_today - 15768000 < t) {
9064 if (beg_today < t) {
9066 }
else if ((beg_today - 86400) < t) {
9068 res =
wait_file(chan, ints,
"digits/yesterday", lang);
9069 }
else if (beg_today - 86400 * 6 < t) {
9072 }
else if (beg_today - 2628000 < t) {
9075 }
else if (beg_today - 15768000 < t) {
9100 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
9139 strncat(res,
"minus ", res_len - strlen(res) - 1);
9140 if ( num > INT_MIN ) {
9149 if (num <= 20 || num == 40 || num == 60 || num == 80 || num == 100) {
9150 snprintf(buf,
sizeof(buf),
"%d", num);
9151 strncat(res, buf, res_len - strlen(res) - 1);
9157 strncat(res,
"20_ ", res_len - strlen(res) - 1);
9162 strncat(res,
"40_ ", res_len - strlen(res) - 1);
9167 strncat(res,
"60_ ", res_len - strlen(res) - 1);
9172 strncat(res,
"80_ ", res_len - strlen(res) - 1);
9178 remaining = num % 100;
9179 digit = (num - remaining) / 100;
9181 if (remaining == 0) {
9182 snprintf(buf,
sizeof(buf),
"%d", num);
9183 strncat(res, buf, res_len - strlen(res) - 1);
9186 snprintf(buf,
sizeof(buf),
"%d_ ", digit*100);
9187 strncat(res, buf, res_len - strlen(res) - 1);
9194 strncat(res,
"1000", res_len - strlen(res) - 1);
9199 if (num < 1000000) {
9200 remaining = num % 1000;
9201 digit = (num - remaining) / 1000;
9203 if (remaining == 0) {
9205 strncat(res,
" 1000", res_len - strlen(res) - 1);
9210 strncat(res,
"1000_ ", res_len - strlen(res) - 1);
9215 strncat(res,
" 1000_ ", res_len - strlen(res) - 1);
9220 if (num == 1000000) {
9221 strncat(res,
"1 1000000", res_len - strlen(res) - 1);
9226 if (num < 1000000000) {
9227 remaining = num % 1000000;
9228 digit = (num - remaining) / 1000000;
9230 if (remaining == 0) {
9232 strncat(res,
" 1000000", res_len - strlen(res) - 1);
9237 strncat(res,
" 1000000_ ", res_len - strlen(res) - 1);
9242 if (num == 1000000000) {
9243 strncat(res,
"1 1000000000", res_len - strlen(res) - 1);
9248 if (num > 1000000000) {
9249 remaining = num % 1000000000;
9250 digit = (num - remaining) / 1000000000;
9252 if (remaining == 0) {
9254 strncat(res,
" 1000000000", res_len - strlen(res) - 1);
9259 strncat(res,
" 1000000000_ ", res_len - strlen(res) - 1);
9275 const char* remaining = fn;
9286 while (res == 0 && (s = strstr(remaining,
" "))) {
9287 size_t len = s - remaining;
9288 char* new_string =
ast_malloc(len + 1 + strlen(
"digits/"));
9290 sprintf(new_string,
"digits/");
9291 strncat(new_string, remaining, len);
9295 if ((audiofd > -1) && (ctrlfd > -1)) {
9306 while (*remaining ==
' ') {
9313 if (res == 0 && *remaining) {
9315 char* new_string =
ast_malloc(strlen(remaining) + 1 + strlen(
"digits/"));
9316 sprintf(new_string,
"digits/%s", remaining);
9319 if ((audiofd > -1) && (ctrlfd > -1)) {
9350 struct timeval when = { t, 0 };
9361 snprintf(fn,
sizeof(fn),
"digits/tslis %d", tm.
tm_wday);
9376 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
9393 struct timeval when = { t, 0 };
9427 struct timeval when = { t, 0 };
9450 struct timeval when = { t, 0 }, nowt =
ast_tvnow();
9456 if ((daydiff < 0) || (daydiff > 6)) {
9462 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
9469 }
else if (daydiff) {
9472 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
9499 if (num == 1 || num == -1) {
9528 if (num > 0 && num < 5) {
9549 temp =
ast_alloca((temp_len = (strlen(noun) + strlen(ending) + 1)));
9550 snprintf(temp, temp_len,
"%s%s", noun, ending);
9571 return gender ? gender :
"";
9591 temp =
ast_alloca((temp_len = (strlen(adjective) + strlen(ending) + 1)));
9592 snprintf(temp, temp_len,
"%s%s", adjective, ending);
static int ast_say_enumeration_full_vi(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd)
static int ast_say_datetime_from_now_he(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Hebrew syntax.
static int say_character_str_full(struct ast_channel *chan, const char *str, const char *ints, const char *lang, enum ast_say_case_sensitivity sensitivity, int audiofd, int ctrlfd)
struct ast_str * ast_get_character_str(const char *str, const char *lang, enum ast_say_case_sensitivity sensitivity)
Returns an ast_str of files for SayAlpha playback.
Main Channel structure associated with a channel.
SAY_EXTERN int(* ast_say_number_full)(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options, int audiofd, int ctrlfd) SAY_INIT(ast_say_number_full)
Same as ast_say_number() with audiofd for received audio and returns 1 on ctrlfd being readable...
static int ast_say_number_full_ur(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
static int say_number_full(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
ast_say_number_full: call language-specific functions
static int wait_file(struct ast_channel *chan, const char *ints, const char *file, const char *lang)
int ast_streamfile(struct ast_channel *c, const char *filename, const char *preflang)
Streams a file.
Asterisk locking-related definitions:
static int ast_say_datetime_pt_BR(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Brazilian Portuguese syntax.
Asterisk main include file. File version handling, generic pbx functions.
SAY_EXTERN int(* ast_say_time)(struct ast_channel *chan, time_t t, const char *ints, const char *lang) SAY_INIT(ast_say_time)
static int ast_say_number_full_se(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
ast_say_number_full_se: Swedish syntax
SAY_EXTERN int(* ast_say_enumeration_full)(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options, int audiofd, int ctrlfd) SAY_INIT(ast_say_enumeration_full)
Same as ast_say_enumeration() with audiofd for received audio and returns 1 on ctrlfd being readable...
static int ast_say_number_full_hu(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd)
ast_say_number_full_hu: Hungarian syntax
static char * ast_translate_number_ka(int num, char *res, int res_len)
Georgian support.
static int ast_say_datetime_th(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Thai syntax.
static int ast_say_enumeration_full_he(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
static int ast_say_date_fr(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
French syntax.
static int ast_say_time_ka(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Georgian syntax. e.g. "otxi saati da eqvsi tsuti".
static int ast_say_number_full_ru(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
ast_say_number_full_ru: Russian syntax
Time-related functions and macros.
static int ast_say_time_he(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Hebrew syntax.
static int ast_say_datetime_nl(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Dutch syntax.
static int ast_say_date_with_format_nl(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
Dutch syntax.
struct ast_str * ast_get_number_str(int num, const char *lang)
ast_get_number_str: call language-specific functions
static int ast_say_date_with_format_zh(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
Taiwanese / Chinese syntax.
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
static int ast_say_date_th(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Thai syntax.
static int ast_say_date_with_format_en(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
English syntax.
static int ast_say_enumeration_full_is(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
ast_say_enumeration_full_is: Icelandic syntax
static int ast_say_datetime_ka(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Georgian syntax. Say date, then say time.
static int ast_say_enumeration_full_en(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd)
ast_say_enumeration_full_en: English syntax
SAY_EXTERN int(* ast_say_datetime_from_now)(struct ast_channel *chan, time_t t, const char *ints, const char *lang) SAY_INIT(ast_say_datetime_from_now)
struct ast_tm * ast_localtime(const struct timeval *timep, struct ast_tm *p_tm, const char *zone)
Timezone-independent version of localtime_r(3).
int ast_say_digits_full(struct ast_channel *chan, int num, const char *ints, const char *lang, int audiofd, int ctrlfd)
Same as ast_say_digits() with audiofd for received audio and returns 1 on ctrlfd being readable...
static int ast_say_time_en(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
English syntax.
static int ast_say_enumeration_full_da(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
ast_say_enumeration_full_da: Danish syntax
static int say_datetime_from_now(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
static int ast_say_date_gr(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Greek support.
static int ast_say_datetime_fr(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
French syntax.
static int ast_say_date_with_format_es(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
Spanish syntax.
static int say_datetime(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
static int ast_say_date_en(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
English syntax.
static int ast_say_datetime_from_now_fr(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
French syntax.
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
static int ast_say_number_full_gr(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd)
Greek support A list of the files that you need to create -> digits/xilia = "xilia" -> digits/myrio =...
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
static int ast_say_number_full_nl(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd)
ast_say_number_full_nl: dutch syntax New files: digits/nl-en
Generic File Format Support. Should be included by clients of the file handling routines. File service providers should instead include mod_format.h.
static int ast_say_number_full_it(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd)
ast_say_number_full_it: Italian
struct ast_str * ast_get_money_str(const char *str, const char *lang)
ast_get_money_str: call language-specific functions
static int ast_say_datetime_en(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
English syntax.
static int ast_say_number_full_he(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
#define ast_verb(level,...)
static int ast_say_number_full_is(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
ast_say_number_full_is: Icelandic syntax
static int ast_say_date_with_format_gr(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
Greek support.
static int ast_say_date_nl(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Dutch syntax.
SAY_EXTERN int(* ast_say_money_str_full)(struct ast_channel *chan, const char *num, const char *ints, const char *lang, int audiofd, int ctrlfd) SAY_INIT(ast_say_money_str_full)
static int exp10_int(int power)
static int ast_say_datetime_from_now_pt(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Portuguese syntax.
static int ast_say_date_ka(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Georgian syntax. e.g. "oriatas xuti tslis 5 noemberi".
Custom localtime functions for multiple timezones.
static int ast_say_number_full_fr(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
ast_say_number_full_fr: French syntax Extra sounds needed: 1F: feminin 'une' et: 'and' ...
static int ast_say_date_with_format_vi(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
Vietnamese syntax.
static int ast_say_number_full_no(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
ast_say_number_full_no: Norwegian syntax New files: In addition to American English, the following sounds are required: "and", "1N"
static int ast_say_datetime_pt(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Portuguese syntax.
#define ast_debug(level,...)
Log a DEBUG message.
static int ast_say_date_hu(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Hungarian syntax.
struct ast_str * ast_get_digit_str(const char *str, const char *lang)
Returns an ast_str of files for SayDigits playback.
static int ast_say_time_th(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Thai syntax.
General Asterisk PBX channel definitions.
SAY_EXTERN int(* ast_say_digit_str_full)(struct ast_channel *chan, const char *num, const char *ints, const char *lang, int audiofd, int ctrlfd) SAY_INIT(ast_say_digit_str_full)
Same as ast_say_digit_str() with audiofd for received audio and returns 1 on ctrlfd being readable...
static int ast_say_number_full_cs(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
ast_say_number_full_cs: Czech syntax
static int ast_say_number_full_de(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
ast_say_number_full_de: German syntax
static int ast_say_number_full_pt(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
static char * pl_append(char *buffer, char *str)
static int ast_say_date_is(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
static int ast_say_number_full_ja(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd)
static int say_date(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
int ast_play_and_wait(struct ast_channel *chan, const char *fn)
Play a stream and wait for a digit, returning the digit that was pressed.
static int ast_say_date_with_format_he(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
ast_say_date_with_format_he Say formatted date in Hebrew
static int ast_say_time_de(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
German syntax.
static const char * counted_adjective_ending_ru(int num, const char gender[])
In slavic languages such as Russian and Ukrainian the rules for declining adjectives are simpler than...
static int say_money_str_full(struct ast_channel *chan, const char *str, const char *ints, const char *lang, int audiofd, int ctrlfd)
static struct ast_str * ast_get_money_en_dollars_str(const char *str, const char *lang)
char * separator_dziesiatek
static int say_enumeration_full(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
ast_say_enumeration_full: call language-specific functions
static int ast_say_datetime_ja(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
static char language[MAX_LANGUAGE]
static char next_item(const char *format)
#define ast_malloc(len)
A wrapper for malloc()
static int ast_say_date_with_format_de(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
German syntax.
static int ast_say_date_with_format_ja(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
static int ast_say_date_with_format_th(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
Thai syntax.
SAY_EXTERN int(* ast_say_date)(struct ast_channel *chan, time_t t, const char *ints, const char *lang) SAY_INIT(ast_say_date)
static int ast_say_number_full_en_GB(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd)
ast_say_number_full_en_GB: British syntax New files:
static int ast_say_datetime_zh(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Taiwanese / Chinese syntax.
ast_say_case_sensitivity
Controls how ast_say_character_str denotes the case of characters in a string.
static int get_lastdigits_ru(int num)
determine last digits for thousands/millions (ru)
static int ast_say_date_he(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Hebrew syntax.
#define ast_test_suite_event_notify(s, f,...)
#define ast_alloca(size)
call __builtin_alloca to ensure we get gcc builtin semantics
static int ast_say_time_nl(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Dutch syntax.
static void __say_init(void)
remap the 'say' functions to use those in this file
SAY_EXTERN int(* ast_say_date_with_format)(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *timezone) SAY_INIT(ast_say_date_with_format)
static char * pl_rzad_na_tekst(odmiana *odm, int i, int rzad)
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
static void powiedz(struct ast_channel *chan, const char *language, int audiofd, int ctrlfd, const char *ints, odmiana *odm, int rzad, int i)
static int ast_say_datetime_de(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
German syntax.
static const char * counted_noun_ending_slavic(int num)
Counting of objects in slavic languages such as Russian and Ukrainian the rules are more complicated...
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
int ast_say_counted_adjective(struct ast_channel *chan, int num, const char adjective[], const char gender[])
static int ast_say_time_ja(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
char * ast_skip_blanks(const char *str)
Gets a pointer to the first non-whitespace character in a string.
static int say_date_with_format(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
static int ast_say_datetime_from_now_en(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
English syntax.
static int ast_say_number_full_es(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
ast_say_number_full_es: Spanish syntax
static int ast_say_number_full_da(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
ast_say_number_full_da: Danish syntax New files:
static int ast_say_date_de(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
German syntax.
static int ast_say_enumeration_full_de(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
ast_say_enumeration_full_de: German syntax
SAY_EXTERN int(* ast_say_datetime)(struct ast_channel *chan, time_t t, const char *ints, const char *lang) SAY_INIT(ast_say_datetime)
static int ast_say_date_with_format_is(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
int ast_say_counted_noun(struct ast_channel *chan, int num, const char noun[])
static int ast_say_date_pt(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Portuguese syntax.
static int ast_say_number_full_vi(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd)
ast_say_number_full_vi: Vietnamese syntax
static int ast_say_date_da(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Danish syntax.
static int ast_say_time_pt(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Portuguese syntax.
void ast_str_reset(struct ast_str *buf)
Reset the content of a dynamic string. Useful before a series of ast_str_append.
static int ast_say_time_fr(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
French syntax.
static int ast_say_time_pt_BR(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Brazilian Portuguese syntax.
static int ast_say_date_with_format_it(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
Italian syntax.
int ast_waitstream_full(struct ast_channel *c, const char *breakon, int audiofd, int monfd)
char * strsep(char **str, const char *delims)
static int ast_say_date_with_format_pl(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
Polish syntax.
static int ast_say_number_full_th(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd)
Thai syntax.
static int ast_say_date_with_format_pt(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
Portuguese syntax.
int ast_say_number(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options)
says a number
struct ast_str * ast_get_phonetic_str(const char *str, const char *lang)
Returns an ast_str of files for SayPhonetic playback.
static int say_digit_str_full(struct ast_channel *chan, const char *str, const char *ints, const char *lang, int audiofd, int ctrlfd)
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
static int ast_say_time_hu(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Hungarian syntax.
const char * ast_channel_name(const struct ast_channel *chan)
static int say_time(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
int ast_waitstream(struct ast_channel *c, const char *breakon)
Waits for a stream to stop or digit to be pressed.
int ast_fileexists(const char *filename, const char *fmt, const char *preflang)
Checks for the existence of a given file.
static int say_phonetic_str_full(struct ast_channel *chan, const char *str, const char *ints, const char *lang, int audiofd, int ctrlfd)
static int ast_say_datetime_hu(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Hungarian syntax.
static int ast_say_date_ja(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
static int ast_say_number_full_zh(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd)
ast_say_number_full_zh: Taiwanese / Chinese syntax
static int ast_say_time_zh(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Taiwanese / Chinese syntax.
const char * ast_channel_language(const struct ast_channel *chan)
static const char * counted_noun_ending_en(int num)
In English, we use the plural for everything but one. For example:
SAY_EXTERN int(* ast_say_character_str_full)(struct ast_channel *chan, const char *num, const char *ints, const char *lang, enum ast_say_case_sensitivity sensitivity, int audiofd, int ctrlfd) SAY_INIT(ast_say_character_str_full)
static void pl_odtworz_plik(struct ast_channel *chan, const char *language, int audiofd, int ctrlfd, const char *ints, char *fn)
static int ast_say_datetime_from_now_ka(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Georgian syntax.
static int ast_say_datetime_gr(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Greek support.
int ast_say_enumeration(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options)
says an enumeration
static int ast_say_time_gr(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Greek support.
Say numbers and dates (maybe words one day too)
static int ast_say_number_full_en(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd)
ast_say_number_full_en: English syntax
static int ast_say_number_full_ka(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
ast_say_number_full_ka: Georgian syntax
SAY_EXTERN int(* ast_say_phonetic_str_full)(struct ast_channel *chan, const char *num, const char *ints, const char *lang, int audiofd, int ctrlfd) SAY_INIT(ast_say_phonetic_str_full)
static snd_pcm_format_t format
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
static int ast_say_datetime_he(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Hebrew syntax.
static int gr_say_number_female(int num, struct ast_channel *chan, const char *ints, const char *lang)
Greek digits/female-[1..4] : "Mia, dyo , treis, tessereis".
static int ast_say_number_full_pl(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
int ast_stopstream(struct ast_channel *c)
Stops a stream.
static int ast_say_date_with_format_da(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
Danish syntax.
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
static int ast_say_date_with_format_fr(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
French syntax oclock = heure.
static struct ast_str * get_number_str_en(int num, const char *lang)