42#include <netinet/in.h>
48#include <iso/limits_iso.h>
65 char fnbuf[10], asciibuf[20] =
"letters/ascii";
78 while (
str[num] && !res) {
88 fn =
"letters/exclaimation-point";
94 fn =
"letters/dollar";
103 fn =
"letters/equals";
109 fn =
"letters/slash";
112 fn =
"letters/space";
124 strcpy(fnbuf,
"digits/X");
130 if (
'A' <= ltr && ltr <=
'Z') {
132 switch (sensitivity) {
140 }
else if (
'a' <= ltr && ltr <=
'z') {
141 switch (sensitivity) {
152 strcpy(fnbuf,
"uppercase");
154 strcpy(fnbuf,
"lowercase");
156 strcpy(fnbuf,
"letters/X");
162 (snprintf(asciibuf + 13,
sizeof(asciibuf) - 13,
"%d",
str[num]) > 0 &&
ast_fileexists(asciibuf,
NULL, lang) > 0 && (fn = asciibuf))) {
165 if (upper || lower) {
192 while (!res && (fn =
strsep(&files,
"&"))) {
195 if ((audiofd > -1) && (ctrlfd > -1)) {
212 return say_filenames(chan, ints, lang, audiofd, ctrlfd, filenames);
238 fn =
"letters/exclaimation-point";
244 fn =
"letters/dollar";
253 fn =
"letters/equals";
259 fn =
"letters/slash";
262 fn =
"letters/space";
273 strcpy(fnbuf,
"digits/X");
279 if (
'A' <= ltr && ltr <=
'Z') ltr +=
'a' -
'A';
280 strcpy(fnbuf,
"phonetic/X_p");
296 return say_filenames(chan, ints, lang, audiofd, ctrlfd, filenames);
333 strcpy(fnbuf,
"digits/X");
350 return say_filenames(chan, ints, lang, audiofd, ctrlfd, filenames);
367 if (sscanf(
str,
"%30lf", &dollars) != 1) {
374 cents = amt - (((int) dollars) * 100);
375 ast_debug(1,
"Cents is %d, amount is %d\n", cents, amt);
388 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) {
429 if (!strncasecmp(lang,
"en", 2)) {
433 ast_log(
LOG_WARNING,
"Language %s not currently supported, defaulting to US Dollars\n", lang);
441 return say_filenames(chan, ints, lang, audiofd, ctrlfd, filenames);
465 while (!res && (num || playh)) {
468 if ( num > INT_MIN ) {
476 }
else if (num < 20) {
477 snprintf(fn,
sizeof(fn),
"digits/%d", num);
479 }
else if (num < 100) {
480 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
484 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
498 snprintf(fn,
sizeof(fn),
"&digits/thousand");
500 if (num < 1000000000) {
546 if (!strncasecmp(lang,
"en", 2)) {
550 ast_log(
LOG_WARNING,
"Language %s not currently supported, defaulting to English\n", lang);
576 while (!res && (num || playh)) {
579 if ( num > INT_MIN ) {
585 ast_copy_string(fn, (num % 100 == 0) ?
"digits/h-hundred" :
"digits/hundred",
sizeof(fn));
587 }
else if (num < 20) {
589 snprintf(fn,
sizeof(fn),
"digits/h-%d", num);
594 }
else if (num < 100) {
595 int base = (num / 10) * 10;
597 snprintf(fn,
sizeof(fn),
"digits/%d", base);
599 snprintf(fn,
sizeof(fn),
"digits/h-%d", base);
604 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
618 snprintf(fn,
sizeof(fn), (num % 1000 == 0) ?
"&digits/h-thousand" :
"&digits/thousand");
620 if (num < 1000000000) {
629 ast_copy_string(fn, (num % 1000000 == 0) ?
"&digits/h-million" :
"&digits/million",
sizeof(fn));
640 ast_copy_string(fn, (num % 1000000000 == 0) ?
"&digits/h-billion" :
"&digits/billion",
sizeof(fn));
666 if (!strncasecmp(lang,
"en", 2)) {
670 ast_log(
LOG_WARNING,
"Language %s not currently supported, defaulting to English\n", lang);
855 if (!strncasecmp(
language,
"en_GB", 5)) {
857 }
else if (!strncasecmp(
language,
"en", 2)) {
859 }
else if (!strncasecmp(
language,
"cs", 2)) {
861 }
else if (!strncasecmp(
language,
"da", 2)) {
863 }
else if (!strncasecmp(
language,
"de", 2)) {
865 }
else if (!strncasecmp(
language,
"es", 2)) {
867 }
else if (!strncasecmp(
language,
"fr", 2)) {
869 }
else if (!strncasecmp(
language,
"gr", 2)) {
871 }
else if (!strncasecmp(
language,
"ja", 2)) {
873 }
else if (!strncasecmp(
language,
"he", 2)) {
875 }
else if (!strncasecmp(
language,
"hu", 2)) {
877 }
else if (!strncasecmp(
language,
"is", 2)) {
879 }
else if (!strncasecmp(
language,
"it", 2)) {
881 }
else if (!strncasecmp(
language,
"ka", 2)) {
883 }
else if (!strncasecmp(
language,
"nl", 2)) {
885 }
else if (!strncasecmp(
language,
"no", 2)) {
887 }
else if (!strncasecmp(
language,
"pl", 2)) {
889 }
else if (!strncasecmp(
language,
"pt", 2)) {
891 }
else if (!strncasecmp(
language,
"ru", 2)) {
893 }
else if (!strncasecmp(
language,
"se", 2)) {
895 }
else if (!strncasecmp(
language,
"th", 2)) {
897 }
else if (!strncasecmp(
language,
"zh", 2)) {
899 }
else if (!strncasecmp(
language,
"ur", 2)) {
901 }
else if (!strncasecmp(
language,
"vi", 2)) {
927 for (x=0;x<power;x++)
971 while (!res && (num || playh)) {
974 if ( num > INT_MIN ) {
979 }
else if (num < 3 ) {
980 snprintf(fn,
sizeof(fn),
"digits/%d%c", num,
options[0]);
983 }
else if (num < 20) {
984 snprintf(fn,
sizeof(fn),
"digits/%d", num);
987 }
else if (num < 100) {
988 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
990 }
else if (num < 1000) {
992 if ( hundred == 1 ) {
994 }
else if ( hundred == 2 ) {
1000 if (hundred == 3 || hundred == 4) {
1002 }
else if ( hundred > 4 ) {
1006 num -= (hundred * 100);
1008 length = (int)log10(num)+1;
1009 while ( (length % 3 ) != 1 ) {
1026 snprintf(fn,
sizeof(fn),
"digits/5_E%d", length - 1);
1027 }
else if ( left >= 2 && left <= 4 ) {
1028 snprintf(fn,
sizeof(fn),
"digits/2-4_E%d", length - 1);
1030 snprintf(fn,
sizeof(fn),
"digits/1_E%d", length - 1);
1036 if ((audiofd > -1) && (ctrlfd > -1)) {
1064 while (!res && (num || playh || playa )) {
1077 if ( num > INT_MIN ) {
1088 }
else if (num == 1 && cn == -1) {
1091 }
else if (num < 20) {
1092 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1094 }
else if (num < 100) {
1095 int ones = num % 10;
1097 snprintf(fn,
sizeof(fn),
"digits/%d-and", ones);
1100 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1105 int hundreds = num / 100;
1109 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 100));
1112 num -= 100 * hundreds;
1117 if (num < 1000000) {
1124 if (num < 1000000000) {
1125 int millions = num / 1000000;
1133 num = num % 1000000;
1135 ast_debug(1,
"Number '%d' is too big for me\n", num);
1139 if (num && num < 100)
1145 if ((audiofd > -1) && (ctrlfd > -1))
1178 while (!res && num) {
1194 if ( num > INT_MIN ) {
1199 }
else if (num == 1 && mf == -1) {
1200 snprintf(fn,
sizeof(fn),
"digits/%dF", num);
1202 }
else if (num < 20) {
1203 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1205 }
else if (num < 100) {
1206 int ones = num % 10;
1208 snprintf(fn,
sizeof(fn),
"digits/%d-and", ones);
1211 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1214 }
else if (num == 100 && t == 0) {
1217 }
else if (num < 1000) {
1218 int hundreds = num / 100;
1220 if (hundreds == 1) {
1223 snprintf(fn,
sizeof(fn),
"digits/%d", hundreds);
1226 }
else if (num == 1000 && t == 0) {
1229 }
else if (num < 1000000) {
1230 int thousands = num / 1000;
1233 if (thousands == 1) {
1242 }
else if (num < 1000000000) {
1243 int millions = num / 1000000;
1244 num = num % 1000000;
1246 if (millions == 1) {
1255 }
else if (num <= INT_MAX) {
1256 int billions = num / 1000000000;
1257 num = num % 1000000000;
1259 if (billions == 1) {
1270 ast_debug(1,
"Number '%d' is too big for me\n", num);
1275 if ((audiofd > -1) && (ctrlfd > -1))
1283 if ((audiofd > -1) && (ctrlfd > -1))
1309 while (!res && (num || playh || playa )) {
1312 if ( num > INT_MIN ) {
1323 }
else if (num < 20) {
1324 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1326 }
else if (num < 100) {
1327 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
1329 }
else if (num < 1000) {
1330 int hundreds = num / 100;
1331 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 100));
1334 num -= 100 * hundreds;
1337 }
else if (num < 1000000) {
1343 if (num && num < 100)
1345 }
else if (num < 1000000000) {
1346 int millions = num / 1000000;
1352 if (num && num < 100)
1355 ast_debug(1,
"Number '%d' is too big for me\n", num);
1361 if ((audiofd > -1) && (ctrlfd > -1))
1389 if (!strncasecmp(
options,
"f", 1))
1391 else if (!strncasecmp(
options,
"m", 1))
1395 while (!res && num) {
1398 if ( num > INT_MIN ) {
1406 }
else if (num == 1) {
1408 snprintf(fn,
sizeof(fn),
"digits/%dF", num);
1410 snprintf(fn,
sizeof(fn),
"digits/%dM", num);
1412 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1414 }
else if (num < 31) {
1415 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1417 }
else if (num < 100) {
1418 snprintf(fn,
sizeof(fn),
"digits/%d", (num/10)*10);
1422 }
else if (num == 100) {
1425 }
else if (num < 200) {
1430 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100)*100);
1432 }
else if (num < 2000) {
1436 if (num < 1000000) {
1443 if (num < 2147483640) {
1444 if ((num/1000000) == 1) {
1457 ast_debug(1,
"Number '%d' is too big for me\n", num);
1466 if ((audiofd > -1) && (ctrlfd > -1))
1496 while (!res && (num || playh || playa)) {
1499 if ( num > INT_MIN ) {
1510 }
else if (num == 1) {
1512 snprintf(fn,
sizeof(fn),
"digits/%dF", num);
1514 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1516 }
else if (num < 21) {
1517 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1519 }
else if (num < 70) {
1520 snprintf(fn,
sizeof(fn),
"digits/%d", (num/10)*10);
1521 if ((num % 10) == 1) playa++;
1523 }
else if (num < 80) {
1525 if ((num % 10) == 1) playa++;
1527 }
else if (num < 100) {
1530 }
else if (num < 200) {
1533 }
else if (num < 1000) {
1534 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
1537 }
else if (num < 2000) {
1540 }
else if (num < 1000000) {
1546 }
else if (num < 1000000000) {
1551 num = num % 1000000;
1553 ast_debug(1,
"Number '%d' is too big for me\n", num);
1558 if ((audiofd > -1) && (ctrlfd > -1))
1574#define SAY_NUM_BUF_SIZE 256
1584 ast_verb(3,
"ast_say_digits_full: started. num: %d, options=\"%s\"\n", num,
options);
1592 ast_verb(3,
"ast_say_digits_full: num: %d, state=%d, options=\"%s\", mf=%d\n", num,
state,
options, mf);
1595 while (!res && (num || (
state > 0))) {
1603 ast_verb(3,
"ast_say_digits_full: num: %d, state=%d, options=\"%s\", mf=%d, tmpnum=%d\n", num,
state,
options, mf, tmpnum);
1607 }
else if (
state == 2) {
1608 if ((num >= 11) && (num < 21)) {
1610 snprintf(fn,
sizeof(fn),
"digits/ve");
1612 snprintf(fn,
sizeof(fn),
"digits/uu");
1617 snprintf(fn,
sizeof(fn),
"digits/ve");
1620 snprintf(fn,
sizeof(fn),
"digits/uu");
1624 snprintf(fn,
sizeof(fn),
"digits/ve");
1626 snprintf(fn,
sizeof(fn),
"digits/uu");
1630 snprintf(fn,
sizeof(fn),
"digits/ve");
1633 snprintf(fn,
sizeof(fn),
"digits/ve");
1636 snprintf(fn,
sizeof(fn),
"digits/ve");
1639 snprintf(fn,
sizeof(fn),
"digits/ve");
1642 snprintf(fn,
sizeof(fn),
"digits/uu");
1645 snprintf(fn,
sizeof(fn),
"digits/ve");
1648 snprintf(fn,
sizeof(fn),
"digits/ve");
1653 }
else if (
state == 3) {
1654 snprintf(fn,
sizeof(fn),
"digits/1k");
1656 }
else if (num < 0) {
1657 snprintf(fn,
sizeof(fn),
"digits/minus");
1659 }
else if (num < 20) {
1661 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1663 snprintf(fn,
sizeof(fn),
"digits/%dm", num);
1666 }
else if ((num < 100) && (num >= 20)) {
1667 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 10) * 10);
1672 }
else if ((num >= 100) && (num < 1000)) {
1674 snprintf(fn,
sizeof(fn),
"digits/%d00", tmpnum);
1675 num = num - (tmpnum * 100);
1676 if ((num > 0) && (num < 11)) {
1679 }
else if ((num >= 1000) && (num < 10000)) {
1680 tmpnum = num / 1000;
1681 snprintf(fn,
sizeof(fn),
"digits/%dk", tmpnum);
1682 num = num - (tmpnum * 1000);
1683 if ((num > 0) && (num < 11)) {
1686 }
else if (num < 20000) {
1687 snprintf(fn,
sizeof(fn),
"digits/%dm", (num / 1000));
1690 }
else if (num < 1000000) {
1695 snprintf(fn,
sizeof(fn),
"digits/1k");
1697 if ((num > 0) && (num < 11)) {
1700 }
else if (num < 2000000) {
1701 snprintf(fn,
sizeof(fn),
"digits/million");
1702 num = num % 1000000;
1703 if ((num > 0) && (num < 11)) {
1706 }
else if (num < 3000000) {
1707 snprintf(fn,
sizeof(fn),
"digits/twomillion");
1708 num = num - 2000000;
1709 if ((num > 0) && (num < 11)) {
1712 }
else if (num < 1000000000) {
1717 snprintf(fn,
sizeof(fn),
"digits/million");
1718 num = num % 1000000;
1719 if ((num > 0) && (num < 11)) {
1723 ast_debug(1,
"Number '%d' is too big for me\n", num);
1729 if ((audiofd > -1) && (ctrlfd > -1)) {
1761 while(!res && (num || playh)) {
1764 if ( num > INT_MIN ) {
1772 }
else if (num < 11 || num == 20) {
1773 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1775 }
else if (num < 20) {
1778 }
else if (num < 30) {
1781 }
else if (num < 100) {
1782 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
1786 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
1790 if (num < 1000000) {
1797 if (num < 1000000000) {
1804 ast_debug(1,
"Number '%d' is too big for me\n", num);
1812 if ((audiofd > -1) && (ctrlfd > -1))
1843 while (!res && (num || playh || playa )) {
1846 if ( num > INT_MIN ) {
1860 }
else if (num < 5 && cn == 2) {
1861 snprintf(fn,
sizeof(fn),
"digits/%dkvk", num);
1863 }
else if (num < 5 && cn == 3) {
1864 snprintf(fn,
sizeof(fn),
"digits/%dhk", num);
1866 }
else if (num < 20) {
1867 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1869 }
else if (num < 100) {
1870 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
1874 }
else if (num < 1000) {
1875 int hundreds = num / 100;
1878 snprintf(fn,
sizeof(fn),
"digits/%dhk", hundreds);
1880 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 100));
1883 num -= 100 * hundreds;
1884 if (num && num < 20)
1887 if (num && (num % 10) == 0)
1889 }
else if (num < 1000000) {
1892 if ((num % 100) == 0 && (num % 1000 != 0)) {
1899 if (num && (num < 20 || (num % 10 == 0)))
1901 }
else if (num < 1000000000) {
1902 int millions = num / 1000000;
1912 if (num && num < 100)
1914 }
else if (num < INT_MAX) {
1915 int milliards = num / 1000000000;
1925 if (num && num < 100)
1928 ast_debug(1,
"Number '%d' is too big for me\n", num);
1934 if ((audiofd > -1) && (ctrlfd > -1))
1981 while (!res && (num || playh)) {
1984 if ( num > INT_MIN ) {
1992 }
else if (num < 20) {
1993 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1995 }
else if (num == 21) {
1996 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1998 }
else if (num == 28) {
1999 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2001 }
else if (num == 31) {
2002 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2004 }
else if (num == 38) {
2005 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2007 }
else if (num == 41) {
2008 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2010 }
else if (num == 48) {
2011 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2013 }
else if (num == 51) {
2014 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2016 }
else if (num == 58) {
2017 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2019 }
else if (num == 61) {
2020 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2022 }
else if (num == 68) {
2023 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2025 }
else if (num == 71) {
2026 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2028 }
else if (num == 78) {
2029 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2031 }
else if (num == 81) {
2032 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2034 }
else if (num == 88) {
2035 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2037 }
else if (num == 91) {
2038 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2040 }
else if (num == 98) {
2041 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2043 }
else if (num < 100) {
2044 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
2048 if ((num / 100) > 1) {
2049 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
2056 if (num < 1000000) {
2063 if ((tempnum / 1000) < 2)
2068 if (num < 1000000000) {
2069 if ((num / 1000000) > 1)
2075 if ((tempnum / 1000000) < 2)
2080 ast_debug(1,
"Number '%d' is too big for me\n", num);
2088 if ((audiofd > -1) && (ctrlfd > -1))
2110 while (!res && (num || playh )) {
2113 if ( num > INT_MIN ) {
2121 }
else if (num < 20) {
2122 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2124 }
else if (num < 100) {
2133 snprintf(fn,
sizeof(fn),
"digits/%d", num - units);
2136 }
else if (num < 200) {
2140 }
else if (num < 1000) {
2141 snprintf(fn,
sizeof(fn),
"digits/%d", num / 100);
2149 }
else if (num < 10000) {
2156 if (num < 1000000) {
2163 if (num < 1000000000) {
2170 ast_debug(1,
"Number '%d' is too big for me\n", num);
2179 if ((audiofd > -1) && (ctrlfd > -1))
2213 while (!res && (num || playh || playa )) {
2216 if ( num > INT_MIN ) {
2227 }
else if (num == 1 && cn == -1) {
2230 }
else if (num < 20) {
2231 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2233 }
else if (num < 100) {
2234 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
2236 }
else if (num < 1000) {
2237 int hundreds = num / 100;
2241 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 100));
2244 num -= 100 * hundreds;
2247 }
else if (num < 1000000) {
2253 if (num && num < 100)
2255 }
else if (num < 1000000000) {
2256 int millions = num / 1000000;
2262 if (num && num < 100)
2265 ast_debug(1,
"Number '%d' is too big for me\n", num);
2271 if ((audiofd > -1) && (ctrlfd > -1))
2287 char *dziesiatki[10];
2298 return odm->
rzedy[rzad - 1][0];
2299 if ((i > 21 || i < 11) && i%10 > 1 && i%10 < 5)
2300 return odm->
rzedy[rzad - 1][1];
2302 return odm->
rzedy[rzad - 1][2];
2307 strcpy(buffer,
str);
2308 buffer += strlen(
str);
2314 char file_name[255] =
"digits/";
2315 strcat(file_name, fn);
2316 ast_debug(1,
"Trying to play: %s\n", file_name);
2318 if ((audiofd > -1) && (ctrlfd > -1))
2338 if (i == 0 && rzad > 0) {
2346 m1000E6 = i % 1000000000;
2347 i1000E6 = i / 1000000000;
2351 m1000E3 = m1000E6 % 1000000;
2352 i1000E3 = m1000E6 / 1000000;
2356 m1000 = m1000E3 % 1000;
2357 i1000 = m1000E3 / 1000;
2367 if (m100 > 0 && m100 <= 9) {
2372 }
else if (m100 % 10 == 0 && m100 != 0) {
2374 }
else if (m100 > 10 && m100 <= 19) {
2376 }
else if (m100 > 20) {
2489 char *zenski_cyfry[] = {
"0",
"1z",
"2z",
"3",
"4",
"5",
"6",
"7",
"8",
"9"};
2491 char *zenski_cyfry2[] = {
"0",
"1",
"2z",
"3",
"4",
"5",
"6",
"7",
"8",
"9"};
2493 char *meski_cyfry[] = {
"0",
"1",
"2-1m",
"3-1m",
"4-1m",
"5m",
"6m",
"7m",
"8m",
"9m"};
2495 char *meski_cyfry2[] = {
"0",
"1",
"2-2m",
"3-2m",
"4-2m",
"5m",
"6m",
"7m",
"8m",
"9m"};
2497 char *meski_setki[] = {
"",
"100m",
"200m",
"300m",
"400m",
"500m",
"600m",
"700m",
"800m",
"900m"};
2499 char *meski_dziesiatki[] = {
"",
"10m",
"20m",
"30m",
"40m",
"50m",
"60m",
"70m",
"80m",
"90m"};
2501 char *meski_nastki[] = {
"",
"11m",
"12m",
"13m",
"14m",
"15m",
"16m",
"17m",
"18m",
"19m"};
2503 char *nijaki_cyfry[] = {
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9"};
2505 char *nijaki_cyfry2[] = {
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9"};
2507 char *nijaki_setki[] = {
"",
"100",
"200",
"300",
"400",
"500",
"600",
"700",
"800",
"900"};
2509 char *nijaki_dziesiatki[] = {
"",
"10",
"20",
"30",
"40",
"50",
"60",
"70",
"80",
"90"};
2511 char *nijaki_nastki[] = {
"",
"11",
"12",
"13",
"14",
"15",
"16",
"17",
"18",
"19"};
2513 char *rzedy[][3] = { {
"1000",
"1000.2",
"1000.5"}, {
"1000000",
"1000000.2",
"1000000.5"}, {
"1000000000",
"1000000000.2",
"1000000000.5"}};
2522 if (odmiana_nieosobowa ==
NULL) {
2523 odmiana_nieosobowa =
ast_malloc(
sizeof(*odmiana_nieosobowa));
2527 memcpy(odmiana_nieosobowa->
cyfry, nijaki_cyfry,
sizeof(odmiana_nieosobowa->
cyfry));
2528 memcpy(odmiana_nieosobowa->
cyfry2, nijaki_cyfry2,
sizeof(odmiana_nieosobowa->
cyfry));
2529 memcpy(odmiana_nieosobowa->
setki, nijaki_setki,
sizeof(odmiana_nieosobowa->
setki));
2530 memcpy(odmiana_nieosobowa->
dziesiatki, nijaki_dziesiatki,
sizeof(odmiana_nieosobowa->
dziesiatki));
2531 memcpy(odmiana_nieosobowa->
nastki, nijaki_nastki,
sizeof(odmiana_nieosobowa->
nastki));
2532 memcpy(odmiana_nieosobowa->
rzedy, rzedy,
sizeof(odmiana_nieosobowa->
rzedy));
2535 if (odmiana_zenska ==
NULL) {
2536 odmiana_zenska =
ast_malloc(
sizeof(*odmiana_zenska));
2540 memcpy(odmiana_zenska->
cyfry, zenski_cyfry,
sizeof(odmiana_zenska->
cyfry));
2541 memcpy(odmiana_zenska->
cyfry2, zenski_cyfry2,
sizeof(odmiana_zenska->
cyfry));
2542 memcpy(odmiana_zenska->
setki, nijaki_setki,
sizeof(odmiana_zenska->
setki));
2544 memcpy(odmiana_zenska->
nastki, nijaki_nastki,
sizeof(odmiana_zenska->
nastki));
2545 memcpy(odmiana_zenska->
rzedy, rzedy,
sizeof(odmiana_zenska->
rzedy));
2548 if (odmiana_meska ==
NULL) {
2549 odmiana_meska =
ast_malloc(
sizeof(*odmiana_meska));
2553 memcpy(odmiana_meska->
cyfry, meski_cyfry,
sizeof(odmiana_meska->
cyfry));
2554 memcpy(odmiana_meska->
cyfry2, meski_cyfry2,
sizeof(odmiana_meska->
cyfry));
2555 memcpy(odmiana_meska->
setki, meski_setki,
sizeof(odmiana_meska->
setki));
2557 memcpy(odmiana_meska->
nastki, meski_nastki,
sizeof(odmiana_meska->
nastki));
2558 memcpy(odmiana_meska->
rzedy, rzedy,
sizeof(odmiana_meska->
rzedy));
2562 if (strncasecmp(
options,
"f", 1) == 0)
2564 else if (strncasecmp(
options,
"m", 1) == 0)
2567 o = odmiana_nieosobowa;
2569 o = odmiana_nieosobowa;
2596 while (!res && num ) {
2599 if ( num > INT_MIN ) {
2604 }
else if (num < 20) {
2605 if ((num == 1 || num == 2) && (mf < 0))
2606 snprintf(fn,
sizeof(fn),
"digits/%dF", num);
2608 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2610 }
else if (num < 100) {
2611 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 10) * 10);
2615 }
else if (num < 1000) {
2621 if (mf < 0 && num > 199)
2622 snprintf(fn,
sizeof(fn),
"digits/%dF", (num / 100) * 100);
2624 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 100) * 100);
2629 }
else if (num < 1000000) {
2636 if ((num % 1000) && ((num % 1000) < 100 || !(num % 100)))
2639 }
else if (num < 1000000000) {
2648 if ((num % 1000000) &&
2650 ((!((num / 1000) % 1000) && ((num % 1000) < 100 || !(num % 100))) ||
2652 (!(num % 1000) && (((num / 1000) % 1000) < 100 || !((num / 1000) % 100))) ) )
2654 num = num % 1000000;
2662 if ((audiofd > -1) && (ctrlfd > -1))
2669 if (!res && playh) {
2696 while (num || playh) {
2699 if ( num > INT_MIN ) {
2707 }
else if (start && num < 200 && num > 99 && cn == -1) {
2709 snprintf(fn,
sizeof(fn),
"digits/hundred");
2711 }
else if (num == 1 && cn == -1) {
2714 }
else if (num < 20) {
2715 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2717 }
else if (num < 100) {
2718 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
2720 }
else if (num < 1000) {
2722 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
2725 }
else if (num < 1000000) {
2733 }
else if (num < 1000000000) {
2742 ast_debug(1,
"Number '%d' is too big for me\n", num);
2747 if ((audiofd > -1) && (ctrlfd > -1)) {
2769 int last_length = 0;
2775 while (!res && (num || playh || playt || playz)) {
2778 if ( num > INT_MIN ) {
2784 snprintf(fn,
sizeof(fn),
"digits/0");
2791 snprintf(fn,
sizeof(fn),
"digits/thousand");
2793 }
else if (num < 10) {
2794 snprintf(
buf, 12,
"%d", num);
2795 if (last_length - strlen(
buf) > 1 && last_length != 0) {
2796 last_length = strlen(
buf);
2800 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2802 }
else if (num < 100) {
2803 snprintf(
buf, 10,
"%d", num);
2804 if (last_length - strlen(
buf) > 1 && last_length != 0) {
2805 last_length = strlen(
buf);
2809 last_length = strlen(
buf);
2810 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 10) * 10);
2814 snprintf(
buf, 10,
"%d", num);
2815 if (last_length - strlen(
buf) > 1 && last_length != 0) {
2816 last_length = strlen(
buf);
2820 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 100));
2822 snprintf(
buf, 10,
"%d", num);
2823 ast_debug(1,
"Number '%d' %d %d\n", num, (
int)strlen(
buf), last_length);
2824 last_length = strlen(
buf);
2825 num -= ((num / 100) * 100);
2826 }
else if (num < 10000){
2827 snprintf(
buf, 10,
"%d", num);
2828 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 1000));
2830 snprintf(
buf, 10,
"%d", num);
2831 ast_debug(1,
"Number '%d' %d %d\n", num, (
int)strlen(
buf), last_length);
2832 last_length = strlen(
buf);
2833 num -= ((num / 1000) * 1000);
2834 }
else if (num < 100000000) {
2838 snprintf(
buf, 10,
"%d", num);
2839 ast_debug(1,
"Number '%d' %d %d\n", num, (
int)strlen(
buf), last_length);
2840 num -= ((num / 10000) * 10000);
2841 last_length = strlen(
buf);
2842 snprintf(fn,
sizeof(fn),
"digits/wan");
2844 if (num < 1000000000) {
2848 snprintf(
buf, 10,
"%d", num);
2849 ast_debug(1,
"Number '%d' %d %d\n", num, (
int)strlen(
buf), last_length);
2850 last_length = strlen(
buf);
2851 num -= ((num / 100000000) * 100000000);
2852 snprintf(fn,
sizeof(fn),
"digits/yi");
2854 ast_debug(1,
"Number '%d' is too big for me\n", num);
2861 if ((audiofd > -1) && (ctrlfd > -1))
2886 while (!res && (num || playh)) {
2888 snprintf(fn,
sizeof(fn),
"digits/hundred");
2890 }
else if (num < 100) {
2891 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2893 }
else if (num < 1000) {
2894 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 100));
2896 num -= ((num / 100) * 100);
2897 }
else if (num < 100000) {
2902 snprintf(fn,
sizeof(fn),
"digits/thousand");
2903 }
else if (num < 10000000) {
2908 snprintf(fn,
sizeof(fn),
"digits/lac");
2909 }
else if (num < 1000000000) {
2913 num = num % 10000000;
2914 snprintf(fn,
sizeof(fn),
"digits/crore");
2916 ast_debug(1,
"Number '%d' is too big for me\n", num);
2922 if ((audiofd > -1) && (ctrlfd > -1)) {
2938 }
else if (num < 100) {
2940 }
else if (num < 1000) {
2970 while (!res && (num)) {
2973 if ( num > INT_MIN ) {
2978 }
else if (num < 20) {
2980 snprintf(fn,
sizeof(fn),
"digits/%d%s", num,
options);
2982 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2985 }
else if (num < 100) {
2986 snprintf(fn,
sizeof(fn),
"digits/%d", num - (num % 10));
2988 }
else if (num < 1000){
2989 snprintf(fn,
sizeof(fn),
"digits/%d", num - (num % 100));
2991 }
else if (num < 1000000) {
2994 if (lastdigits < 3) {
3001 if (lastdigits == 1) {
3003 }
else if (lastdigits > 1 && lastdigits < 5) {
3009 }
else if (num < 1000000000) {
3015 if (lastdigits == 1) {
3017 }
else if (lastdigits > 1 && lastdigits < 5) {
3024 ast_debug(1,
"Number '%d' is too big for me\n", num);
3029 if ((audiofd > -1) && (ctrlfd > -1))
3049 while(!res && (num || playh)) {
3052 if ( num > INT_MIN ) {
3060 }
else if (num < 100) {
3061 if ((num <= 20) || ((num % 10) == 1)) {
3062 snprintf(fn,
sizeof(fn),
"digits/%d", num);
3065 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 10) * 10);
3068 }
else if (num < 1000) {
3069 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
3072 }
else if (num < 10000) {
3078 }
else if (num < 100000) {
3084 }
else if (num < 1000000) {
3099 if ((audiofd > -1) && (ctrlfd > -1))
3122 while (!res && (num || playh)) {
3125 if ( num > INT_MIN ) {
3131 snprintf(fn,
sizeof(fn),
"digits/%da", num);
3140 }
else if (playoh) {
3143 }
else if (playohz) {
3146 }
else if (num < 20) {
3147 snprintf(fn,
sizeof(fn),
"digits/%d", num);
3149 }
else if (num < 100) {
3150 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
3152 if ((num == 5) || (num == 4) || (num == 1)) playl++;
3155 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
3157 if (num && (num < 10)) {
3164 if (num < 1000000) {
3169 snprintf(fn,
sizeof(fn),
"digits/thousand");
3170 if (num && (num < 10)) {
3172 }
else if (num && (num < 100)){
3180 if (num < 1000000000) {
3194 if ((audiofd > -1) && (ctrlfd > -1))
3209 if (!strncasecmp(
language,
"en", 2)) {
3211 }
else if (!strncasecmp(
language,
"da", 2)) {
3213 }
else if (!strncasecmp(
language,
"de", 2)) {
3215 }
else if (!strncasecmp(
language,
"he", 2)) {
3217 }
else if (!strncasecmp(
language,
"is", 2)) {
3219 }
else if (!strncasecmp(
language,
"vi", 2)) {
3234 while (!res && num) {
3237 if ( num > INT_MIN ) {
3242 }
else if (num < 20) {
3243 snprintf(fn,
sizeof(fn),
"digits/h-%d", num);
3245 }
else if (num < 100) {
3246 int tens = num / 10;
3249 snprintf(fn,
sizeof(fn),
"digits/h-%d", (tens * 10));
3251 snprintf(fn,
sizeof(fn),
"digits/%d", (tens * 10));
3253 }
else if (num < 1000) {
3254 int hundreds = num / 100;
3256 if (hundreds > 1 || t == 1) {
3266 }
else if (num < 1000000) {
3267 int thousands = num / 1000;
3269 if (thousands > 1 || t == 1) {
3280 }
else if (num < 1000000000) {
3281 int millions = num / 1000000;
3282 num = num % 1000000;
3292 }
else if (num < INT_MAX) {
3293 int billions = num / 1000000000;
3294 num = num % 1000000000;
3304 }
else if (num == INT_MAX) {
3308 ast_debug(1,
"Number '%d' is too big for me\n", num);
3314 if ((audiofd > -1) && (ctrlfd > -1)) {
3333 if ((audiofd > -1) && (ctrlfd > -1)) {
3350 char fn[256] =
"", fna[256] =
"";
3364 while (!res && num) {
3367 if ( num > INT_MIN ) {
3372 }
else if (num < 100 && t) {
3375 }
else if (num < 20) {
3376 snprintf(fn,
sizeof(fn),
"digits/h-%d%s", num, gender);
3378 }
else if (num < 100) {
3379 int ones = num % 10;
3381 snprintf(fn,
sizeof(fn),
"digits/%d-and", ones);
3384 snprintf(fn,
sizeof(fn),
"digits/h-%d%s", num, gender);
3387 }
else if (num == 100 && t == 0) {
3388 snprintf(fn,
sizeof(fn),
"digits/h-hundred%s", gender);
3390 }
else if (num < 1000) {
3391 int hundreds = num / 100;
3393 if (hundreds == 1) {
3396 snprintf(fn,
sizeof(fn),
"digits/%d", hundreds);
3401 snprintf(fna,
sizeof(fna),
"digits/h-hundred%s", gender);
3404 }
else if (num < 1000000) {
3405 int thousands = num / 1000;
3407 if (thousands == 1) {
3414 snprintf(fna,
sizeof(fna),
"digits/h-thousand%s", gender);
3416 snprintf(fn,
sizeof(fn),
"digits/h-thousand%s", gender);
3427 snprintf(fn,
sizeof(fn),
"digits/h-thousand%s", gender);
3431 }
else if (num < 1000000000) {
3432 int millions = num / 1000000;
3433 num = num % 1000000;
3434 if (millions == 1) {
3440 snprintf(fna,
sizeof(fna),
"digits/h-million%s", gender);
3450 snprintf(fn,
sizeof(fn),
"digits/h-million%s", gender);
3454 }
else if (num < INT_MAX) {
3455 int billions = num / 1000000000;
3456 num = num % 1000000000;
3457 if (billions == 1) {
3463 snprintf(fna,
sizeof(fna),
"digits/h-milliard%s", gender);
3472 snprintf(fn,
sizeof(fna),
"digits/h-milliard%s", gender);
3476 }
else if (num == INT_MAX) {
3477 snprintf(fn,
sizeof(fn),
"digits/h-last%s", gender);
3480 ast_debug(1,
"Number '%d' is too big for me\n", num);
3486 if ((audiofd > -1) && (ctrlfd > -1))
3494 if ((audiofd > -1) && (ctrlfd > -1)) {
3513 char fn[256] =
"", fna[256] =
"";
3527 while (!res && num) {
3530 if ( num > INT_MIN ) {
3535 }
else if (num < 100 && t) {
3538 }
else if (num < 20) {
3539 snprintf(fn,
sizeof(fn),
"digits/h-%d%s", num, gender);
3541 }
else if (num < 100) {
3542 int ones = num % 10;
3544 snprintf(fn,
sizeof(fn),
"digits/%d-and", ones);
3547 snprintf(fn,
sizeof(fn),
"digits/h-%d%s", num, gender);
3550 }
else if (num == 100 && t == 0) {
3551 snprintf(fn,
sizeof(fn),
"digits/h-hundred%s", gender);
3553 }
else if (num < 1000) {
3554 int hundreds = num / 100;
3556 if (hundreds == 1) {
3559 snprintf(fn,
sizeof(fn),
"digits/%d", hundreds);
3564 snprintf(fna,
sizeof(fna),
"digits/h-hundred%s", gender);
3567 }
else if (num < 1000000) {
3568 int thousands = num / 1000;
3570 if (thousands == 1) {
3577 snprintf(fna,
sizeof(fna),
"digits/h-thousand%s", gender);
3579 snprintf(fn,
sizeof(fn),
"digits/h-thousand%s", gender);
3590 snprintf(fn,
sizeof(fn),
"digits/h-thousand%s", gender);
3594 }
else if (num < 1000000000) {
3595 int millions = num / 1000000;
3596 num = num % 1000000;
3597 if (millions == 1) {
3603 snprintf(fna,
sizeof(fna),
"digits/h-million%s", gender);
3613 snprintf(fn,
sizeof(fn),
"digits/h-million%s", gender);
3617 }
else if (num < INT_MAX) {
3618 int billions = num / 1000000000;
3619 num = num % 1000000000;
3620 if (billions == 1) {
3626 snprintf(fna,
sizeof(fna),
"digits/h-milliard%s", gender);
3635 snprintf(fn,
sizeof(fna),
"digits/h-milliard%s", gender);
3639 }
else if (num == INT_MAX) {
3640 snprintf(fn,
sizeof(fn),
"digits/h-last%s", gender);
3643 ast_debug(1,
"Number '%d' is too big for me\n", num);
3649 if ((audiofd > -1) && (ctrlfd > -1))
3657 if ((audiofd > -1) && (ctrlfd > -1)) {
3676 ast_verb(3,
"ast_say_digits_full: started. num: %d, options=\"%s\"\n", num,
options);
3682 ast_verb(3,
"ast_say_digits_full: num: %d, options=\"%s\", mf=%d\n", num,
options, mf);
3684 while (!res && num) {
3686 snprintf(fn,
sizeof(fn),
"digits/minus");
3687 if (num > INT_MIN) {
3692 }
else if (num < 21) {
3695 snprintf(fn,
sizeof(fn),
"digits/f-0%d", num);
3697 snprintf(fn,
sizeof(fn),
"digits/f-%d", num);
3701 snprintf(fn,
sizeof(fn),
"digits/m-0%d", num);
3703 snprintf(fn,
sizeof(fn),
"digits/m-%d", num);
3707 }
else if ((num < 100) && num >= 20) {
3708 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 10) * 10);
3710 }
else if ((num >= 100) && (num < 1000)) {
3711 int tmpnum = num / 100;
3712 snprintf(fn,
sizeof(fn),
"digits/%d00", tmpnum);
3713 num = num - (tmpnum * 100);
3714 }
else if ((num >= 1000) && (num < 10000)) {
3715 int tmpnum = num / 1000;
3716 snprintf(fn,
sizeof(fn),
"digits/%dk", tmpnum);
3717 num = num - (tmpnum * 1000);
3718 }
else if (num < 20000) {
3719 snprintf(fn,
sizeof(fn),
"digits/m-%d", (num / 1000));
3721 }
else if (num < 1000000) {
3726 snprintf(fn,
sizeof(fn),
"digits/1k");
3728 }
else if (num < 2000000) {
3729 snprintf(fn,
sizeof(fn),
"digits/1m");
3730 num = num % 1000000;
3731 }
else if (num < 3000000) {
3732 snprintf(fn,
sizeof(fn),
"digits/2m");
3733 num = num - 2000000;
3734 }
else if (num < 1000000000) {
3739 snprintf(fn,
sizeof(fn),
"digits/1m");
3740 num = num % 1000000;
3742 ast_debug(1,
"Number '%d' is too big for me\n", num);
3747 if ((audiofd > -1) && (ctrlfd > -1)) {
3764 char fn[256] =
"", fna[256] =
"";
3778 while (!res && num) {
3781 if ( num > INT_MIN ) {
3786 }
else if (num < 100 && t) {
3789 }
else if (num < 20) {
3790 snprintf(fn,
sizeof(fn),
"digits/h-%d%s", num, gender);
3792 }
else if (num < 100) {
3793 int ones = num % 10;
3795 int tens = num - ones;
3796 snprintf(fn,
sizeof(fn),
"digits/h-%d%s", tens, gender);
3801 snprintf(fn,
sizeof(fn),
"digits/and");
3805 snprintf(fn,
sizeof(fn),
"digits/h-%d%s", num, gender);
3809 }
else if (num == 100 && t == 0) {
3810 snprintf(fn,
sizeof(fn),
"digits/h-hundred%s", gender);
3812 }
else if (num < 1000) {
3813 int hundreds = num / 100;
3815 if (hundreds == 1) {
3818 snprintf(fn,
sizeof(fn),
"digits/%d", hundreds);
3823 snprintf(fna,
sizeof(fna),
"digits/h-hundred%s", gender);
3826 }
else if (num < 1000000) {
3827 int thousands = num / 1000;
3829 if (thousands == 1) {
3837 snprintf(fna,
sizeof(fna),
"digits/h-thousand%s", gender);
3839 snprintf(fn,
sizeof(fn),
"digits/h-thousand%s", gender);
3850 snprintf(fn,
sizeof(fn),
"digits/h-thousand%s", gender);
3855 }
else if (num < 1000000000) {
3856 int millions = num / 1000000;
3857 num = num % 1000000;
3858 if (millions == 1) {
3865 snprintf(fna,
sizeof(fna),
"digits/h-million%s", gender);
3875 snprintf(fn,
sizeof(fn),
"digits/h-million%s", gender);
3880 }
else if (num < INT_MAX) {
3881 int billions = num / 1000000000;
3882 num = num % 1000000000;
3883 if (billions == 1) {
3889 snprintf(fna,
sizeof(fna),
"digits/h-milliard%s", gender);
3898 snprintf(fn,
sizeof(fna),
"digits/h-milliard%s", gender);
3903 }
else if (num == INT_MAX) {
3904 snprintf(fn,
sizeof(fn),
"digits/h-last%s", gender);
3907 ast_debug(1,
"Number '%d' is too big for me\n", num);
3913 if ((audiofd > -1) && (ctrlfd > -1))
3921 if ((audiofd > -1) && (ctrlfd > -1)) {
3937 if (!strncasecmp(lang,
"en", 2)) {
3939 }
else if (!strncasecmp(lang,
"da", 2)) {
3941 }
else if (!strncasecmp(lang,
"de", 2)) {
3943 }
else if (!strncasecmp(lang,
"fr", 2)) {
3945 }
else if (!strncasecmp(lang,
"gr", 2)) {
3947 }
else if (!strncasecmp(lang,
"ja", 2)) {
3949 }
else if (!strncasecmp(lang,
"he", 2)) {
3951 }
else if (!strncasecmp(lang,
"hu", 2)) {
3953 }
else if (!strncasecmp(lang,
"is", 2)) {
3955 }
else if (!strncasecmp(lang,
"ka", 2)) {
3957 }
else if (!strncasecmp(lang,
"nl", 2)) {
3959 }
else if (!strncasecmp(lang,
"pt", 2)) {
3961 }
else if (!strncasecmp(lang,
"th", 2)) {
3973 struct timeval when = { t, 0 };
3978 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
3984 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
4001 struct timeval when = { t, 0 };
4007 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
4017 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
4033 snprintf(fn,
sizeof(fn),
"digits/%d", (year / 100));
4036 res =
wait_file(chan, ints,
"digits/hundred", lang);
4037 if (!res && year % 100 != 0) {
4050 struct timeval when = { t, 0 };
4056 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
4066 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
4083 snprintf(fn,
sizeof(fn),
"digits/%d", (year / 100) );
4086 res =
wait_file(chan, ints,
"digits/hundred", lang);
4087 if (!res && year % 100 != 0) {
4100 struct timeval when = { t, 0 };
4111 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
4121 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
4132 struct timeval when = { t, 0 };
4138 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
4148 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
4161 struct timeval when = { t, 0 };
4167 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
4175 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
4190 struct timeval when = { t, 0 };
4196 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
4210 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
4226 struct timeval when = { t, 0 };
4232 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
4238 res =
wait_file(chan, ints,
"digits/pt-de", lang);
4239 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
4243 res =
wait_file(chan, ints,
"digits/pt-de", lang);
4253 struct timeval when = { t, 0 };
4259 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
4266 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
4287 struct timeval when = { t, 0 };
4293 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
4303 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
4319 snprintf(fn,
sizeof(fn),
"digits/%d", (year / 100));
4322 res =
wait_file(chan, ints,
"digits/hundred", lang);
4323 if (!res && year % 100 != 0) {
4335 if (!strncasecmp(lang,
"en", 2)) {
4337 }
else if (!strncasecmp(lang,
"da", 2)) {
4339 }
else if (!strncasecmp(lang,
"de", 2)) {
4341 }
else if (!strncasecmp(lang,
"es", 2)) {
4343 }
else if (!strncasecmp(lang,
"he", 2)) {
4345 }
else if (!strncasecmp(lang,
"fr", 2)) {
4347 }
else if (!strncasecmp(lang,
"gr", 2)) {
4349 }
else if (!strncasecmp(lang,
"is", 2)) {
4351 }
else if (!strncasecmp(lang,
"ja", 2)) {
4353 }
else if (!strncasecmp(lang,
"it", 2)) {
4355 }
else if (!strncasecmp(lang,
"nl", 2)) {
4357 }
else if (!strncasecmp(lang,
"pl", 2)) {
4359 }
else if (!strncasecmp(lang,
"pt", 2)) {
4361 }
else if (!strncasecmp(lang,
"th", 2)) {
4363 }
else if (!strncasecmp(lang,
"zh", 2)) {
4365 }
else if (!strncasecmp(lang,
"vi", 2)) {
4376 struct timeval when = { t, 0 };
4378 int res=0, offset, sndoffset;
4379 char sndfile[256], nextmsg[256];
4382 format =
"ABdY 'digits/at' IMp";
4386 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
4387 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
4388 switch (format[offset]) {
4392 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
4393 sndfile[sndoffset] = format[offset];
4395 sndfile[sndoffset] =
'\0';
4396 res =
wait_file(chan, ints, sndfile, lang);
4401 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
4402 res =
wait_file(chan, ints, nextmsg, lang);
4408 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
4409 res =
wait_file(chan, ints, nextmsg, lang);
4428 res =
wait_file(chan, ints,
"digits/19", lang);
4432 res =
wait_file(chan, ints,
"digits/oh", lang);
4445 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
4447 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
4448 res =
wait_file(chan, ints, nextmsg, lang);
4453 if (format[offset] ==
'H') {
4456 res =
wait_file(chan, ints,
"digits/oh", lang);
4461 res =
wait_file(chan, ints,
"digits/oh", lang);
4468 res =
wait_file(chan, ints,
"digits/20", lang);
4472 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", remaining);
4473 res =
wait_file(chan, ints, nextmsg, lang);
4482 if (format[offset] ==
'M') {
4483 res =
wait_file(chan, ints,
"digits/oclock", lang);
4485 res =
wait_file(chan, ints,
"digits/hundred", lang);
4487 }
else if (tm.
tm_min < 10) {
4488 res =
wait_file(chan, ints,
"digits/oh", lang);
4490 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_min);
4491 res =
wait_file(chan, ints, nextmsg, lang);
4504 res =
wait_file(chan, ints, nextmsg, lang);
4516 gettimeofday(&now,
NULL);
4521 if (beg_today + 15768000 < t) {
4524 }
else if (beg_today + 2628000 < t) {
4527 }
else if (beg_today + 86400 * 6 < t) {
4530 }
else if (beg_today + 172800 < t) {
4533 }
else if (beg_today + 86400 < t) {
4535 res =
wait_file(chan, ints,
"digits/tomorrow", lang);
4536 }
else if (beg_today < t) {
4538 res =
wait_file(chan, ints,
"digits/today", lang);
4539 }
else if (beg_today - 86400 < t) {
4541 res =
wait_file(chan, ints,
"digits/yesterday", lang);
4542 }
else if (beg_today - 86400 * 6 < t) {
4545 }
else if (beg_today - 2628000 < t) {
4548 }
else if (beg_today - 15768000 < t) {
4572 if (beg_today + 15768000 < t) {
4575 }
else if (beg_today + 2628000 < t) {
4578 }
else if (beg_today + 86400 * 6 < t) {
4581 }
else if (beg_today + 172800 < t) {
4584 }
else if (beg_today + 86400 < t) {
4586 res =
wait_file(chan, ints,
"digits/tomorrow", lang);
4587 }
else if (beg_today < t) {
4589 res =
wait_file(chan, ints,
"digits/today", lang);
4590 }
else if (beg_today - 86400 < t) {
4592 res =
wait_file(chan, ints,
"digits/yesterday", lang);
4593 }
else if (beg_today - 86400 * 6 < t) {
4596 }
else if (beg_today - 2628000 < t) {
4599 }
else if (beg_today - 15768000 < t) {
4614 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
4615 res =
wait_file(chan, ints, nextmsg, lang);
4616 }
else if (tm.
tm_sec < 10) {
4617 res =
wait_file(chan, ints,
"digits/oh", lang);
4619 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
4620 res =
wait_file(chan, ints, nextmsg, lang);
4635 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
4654 struct timeval when = { t, 0 };
4656 int res=0, offset, sndoffset;
4657 char sndfile[256], nextmsg[256];
4660 format =
"A dBY HMS";
4664 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
4665 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
4666 switch (format[offset]) {
4670 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
4671 sndfile[sndoffset] = format[offset];
4673 sndfile[sndoffset] =
'\0';
4674 res =
wait_file(chan, ints, sndfile, lang);
4679 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
4680 res =
wait_file(chan, ints, nextmsg, lang);
4686 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
4687 res =
wait_file(chan, ints, nextmsg, lang);
4711 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", (year / 100) );
4712 res =
wait_file(chan, ints, nextmsg, lang);
4714 res =
wait_file(chan, ints,
"digits/hundred", lang);
4715 if (!res && year % 100 != 0) {
4726 res =
wait_file(chan, ints,
"digits/oclock", lang);
4730 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
4732 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
4734 res =
wait_file(chan, ints, nextmsg, lang);
4740 res =
wait_file(chan, ints,
"digits/0", lang);
4752 if (!res &&
next_item(&format[offset + 1]) ==
'S') {
4754 res =
wait_file(chan, ints,
"minute", lang);
4756 res =
wait_file(chan, ints,
"minutes", lang);
4767 res =
wait_file(chan, ints, nextmsg, lang);
4783 if (beg_today < t) {
4785 res =
wait_file(chan, ints,
"digits/today", lang);
4786 }
else if (beg_today - 86400 < t) {
4788 res =
wait_file(chan, ints,
"digits/yesterday", lang);
4808 if (beg_today < t) {
4810 }
else if ((beg_today - 86400) < t) {
4812 res =
wait_file(chan, ints,
"digits/yesterday", lang);
4813 }
else if (beg_today - 86400 * 6 < t) {
4826 res =
wait_file(chan, ints,
"digits/and", lang);
4830 res =
wait_file(chan, ints,
"seconds", lang);
4843 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
4856 struct timeval when = { t, 0 };
4858 int res=0, offset, sndoffset;
4859 char sndfile[256], nextmsg[256];
4862 format =
"A dBY HMS";
4866 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
4867 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
4868 switch (format[offset]) {
4872 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
4873 sndfile[sndoffset] = format[offset];
4875 sndfile[sndoffset] =
'\0';
4876 res =
wait_file(chan, ints, sndfile, lang);
4881 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
4882 res =
wait_file(chan, ints, nextmsg, lang);
4888 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
4889 res =
wait_file(chan, ints, nextmsg, lang);
4913 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", (year / 100) );
4914 res =
wait_file(chan, ints, nextmsg, lang);
4916 res =
wait_file(chan, ints,
"digits/hundred", lang);
4917 if (!res && year % 100 != 0) {
4933 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
4935 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
4936 res =
wait_file(chan, ints, nextmsg, lang);
4938 res =
wait_file(chan, ints,
"digits/oclock", lang);
4945 res =
wait_file(chan, ints,
"digits/1N", lang);
4950 res =
wait_file(chan, ints,
"digits/oclock", lang);
4955 if (
next_item(&format[offset + 1]) ==
'S') {
4957 }
else if (tm.
tm_min > 0) {
4961 if (!res &&
next_item(&format[offset + 1]) ==
'S') {
4963 res =
wait_file(chan, ints,
"minute", lang);
4965 res =
wait_file(chan, ints,
"minutes", lang);
4976 res =
wait_file(chan, ints, nextmsg, lang);
4992 if (beg_today < t) {
4994 res =
wait_file(chan, ints,
"digits/today", lang);
4995 }
else if (beg_today - 86400 < t) {
4997 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5017 if (beg_today < t) {
5019 }
else if ((beg_today - 86400) < t) {
5021 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5022 }
else if (beg_today - 86400 * 6 < t) {
5035 res =
wait_file(chan, ints,
"digits/and", lang);
5039 res =
wait_file(chan, ints, tm.
tm_sec == 1 ?
"second" :
"seconds", lang);
5052 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
5065 struct timeval when = { t, 0 };
5067 int res=0, offset, sndoffset;
5068 char sndfile[256], nextmsg[256];
5071 format =
"A dBY HMS";
5075 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
5076 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
5077 switch (format[offset]) {
5081 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
5082 sndfile[sndoffset] = format[offset];
5084 sndfile[sndoffset] =
'\0';
5085 res =
wait_file(chan, ints, sndfile, lang);
5090 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
5091 res =
wait_file(chan, ints, nextmsg, lang);
5097 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
5098 res =
wait_file(chan, ints, nextmsg, lang);
5122 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", (year / 100) );
5123 res =
wait_file(chan, ints, nextmsg, lang);
5125 res =
wait_file(chan, ints,
"digits/hundred", lang);
5126 if (!res && year % 100 != 0) {
5137 res =
wait_file(chan, ints,
"digits/oclock", lang);
5141 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
5143 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
5145 res =
wait_file(chan, ints, nextmsg, lang);
5151 res =
wait_file(chan, ints,
"digits/0", lang);
5162 res =
wait_file(chan, ints,
"digits/0", lang);
5164 if (
next_item(&format[offset + 1]) ==
'S')
5169 if (!res &&
next_item(&format[offset + 1]) ==
'S') {
5172 res =
wait_file(chan, ints,
"minute", lang);
5174 res =
wait_file(chan, ints,
"minutes", lang);
5185 res =
wait_file(chan, ints, nextmsg, lang);
5201 if (beg_today < t) {
5203 res =
wait_file(chan, ints,
"digits/today", lang);
5204 }
else if (beg_today - 86400 < t) {
5206 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5226 if (beg_today < t) {
5228 }
else if ((beg_today - 86400) < t) {
5230 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5231 }
else if (beg_today - 86400 * 6 < t) {
5244 res =
wait_file(chan, ints,
"digits/and", lang);
5248 if (!res && (tm.
tm_sec % 10 == 1) && (tm.
tm_sec != 11)) {
5249 res =
wait_file(chan, ints,
"second", lang);
5251 res =
wait_file(chan, ints,
"seconds", lang);
5264 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
5277 struct timeval when = { t, 0 };
5279 int res=0, offset, sndoffset;
5280 char sndfile[256], nextmsg[256];
5283 format =
"a 'digits/tee' e 'digits/duan' hY I 'digits/naliga' M 'digits/natee'";
5287 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
5288 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
5289 switch (format[offset]) {
5293 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
5294 sndfile[sndoffset] = format[offset];
5296 sndfile[sndoffset] =
'\0';
5297 res =
wait_file(chan, ints, sndfile, lang);
5302 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
5303 res =
wait_file(chan, ints, nextmsg, lang);
5309 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
5310 res =
wait_file(chan, ints, nextmsg, lang);
5330 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
5331 res =
wait_file(chan, ints, nextmsg, lang);
5338 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
5339 res =
wait_file(chan, ints, nextmsg, lang);
5362 if (beg_today < t) {
5364 res =
wait_file(chan, ints,
"digits/today", lang);
5365 }
else if (beg_today - 86400 < t) {
5367 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5368 }
else if (beg_today - 86400 * 6 < t) {
5371 }
else if (beg_today - 2628000 < t) {
5374 }
else if (beg_today - 15768000 < t) {
5397 if (beg_today < t) {
5399 }
else if ((beg_today - 86400) < t) {
5401 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5402 }
else if (beg_today - 86400 * 6 < t) {
5405 }
else if (beg_today - 2628000 < t) {
5408 }
else if (beg_today - 15768000 < t) {
5432 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
5462#define IL_DATE_STR "AdBY"
5463#define IL_TIME_STR "HM"
5464#define IL_DATE_STR_FULL IL_DATE_STR " 'digits/at' " IL_TIME_STR
5468 struct timeval when = { t, 0 };
5470 int res = 0, offset, sndoffset;
5471 char sndfile[256], nextmsg[256];
5479 for (offset = 0; format[offset] !=
'\0'; offset++) {
5480 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
5481 switch (format[offset]) {
5485 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
5486 sndfile[sndoffset] = format[offset];
5488 sndfile[sndoffset] =
'\0';
5489 res =
wait_file(chan, ints, sndfile, lang);
5494 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
5495 res =
wait_file(chan, ints, nextmsg, lang);
5501 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
5502 res =
wait_file(chan, ints, nextmsg, lang);
5545 char todo = format[offset];
5551 if (beg_today < t) {
5554 res =
wait_file(chan, ints,
"digits/today", lang);
5556 }
else if (beg_today - 86400 < t) {
5558 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5559 }
else if ((todo !=
'Q') && (beg_today - 86400 * 6 < t)) {
5572 ints, lang,
"f", -1, -1
5595 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
5609 struct timeval when = { t, 0 };
5611 int res=0, offset, sndoffset;
5612 char sndfile[256], nextmsg[256];
5615 format =
"'digits/es-el' Ad 'digits/es-de' B 'digits/es-de' Y 'digits/at' IMp";
5619 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
5620 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
5621 switch (format[offset]) {
5625 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
5626 sndfile[sndoffset] = format[offset];
5628 sndfile[sndoffset] =
'\0';
5629 snprintf(nextmsg,
sizeof(nextmsg),
"%s", sndfile);
5630 res =
wait_file(chan, ints, nextmsg, lang);
5635 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
5636 res =
wait_file(chan, ints, nextmsg, lang);
5642 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
5643 res =
wait_file(chan, ints, nextmsg, lang);
5647 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", tm.
tm_mon +1);
5648 res =
wait_file(chan, ints, nextmsg, lang);
5665 snprintf(nextmsg,
sizeof(nextmsg),
"digits/1F");
5667 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
5669 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
5670 res =
wait_file(chan, ints, nextmsg, lang);
5685 res =
wait_file(chan, ints,
"digits/p-m", lang);
5687 res =
wait_file(chan, ints,
"digits/afternoon", lang);
5689 res =
wait_file(chan, ints,
"digits/a-m", lang);
5705 if (beg_today < t) {
5707 res =
wait_file(chan, ints,
"digits/today", lang);
5708 }
else if (beg_today - 86400 < t) {
5710 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5730 if (beg_today < t) {
5732 res =
wait_file(chan, ints,
"digits/today", lang);
5733 }
else if ((beg_today - 86400) < t) {
5735 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5736 }
else if (beg_today - 86400 * 6 < t) {
5750 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
5751 res =
wait_file(chan, ints, nextmsg, lang);
5752 }
else if (tm.
tm_sec < 10) {
5753 res =
wait_file(chan, ints,
"digits/oh", lang);
5755 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
5756 res =
wait_file(chan, ints, nextmsg, lang);
5758 }
else if ((tm.
tm_sec < 21) || (tm.
tm_sec % 10 == 0)) {
5759 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
5760 res =
wait_file(chan, ints, nextmsg, lang);
5763 ten = (tm.
tm_sec / 10) * 10;
5765 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", ten);
5766 res =
wait_file(chan, ints, nextmsg, lang);
5770 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", one);
5771 res =
wait_file(chan, ints, nextmsg, lang);
5785 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
5800 struct timeval when = { t, 0 };
5802 int res=0, offset, sndoffset;
5803 char sndfile[256], nextmsg[256];
5806 format =
"AdBY 'digits/at' IMp";
5810 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
5811 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
5812 switch (format[offset]) {
5816 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
5817 sndfile[sndoffset] = format[offset];
5819 sndfile[sndoffset] =
'\0';
5820 res =
wait_file(chan, ints, sndfile, lang);
5825 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
5826 res =
wait_file(chan, ints, nextmsg, lang);
5832 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
5833 res =
wait_file(chan, ints, nextmsg, lang);
5837 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", tm.
tm_mon +1);
5838 res =
wait_file(chan, ints, nextmsg, lang);
5844 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", tm.
tm_mday);
5845 res =
wait_file(chan, ints, nextmsg, lang);
5853 res =
wait_file(chan, ints,
"digits/2", lang);
5855 res =
wait_file(chan, ints,
"digits/thousand", lang);
5867 res =
wait_file(chan, ints,
"digits/thousand", lang);
5869 wait_file(chan, ints,
"digits/9", lang);
5870 wait_file(chan, ints,
"digits/hundred", lang);
5882 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
5884 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
5885 res =
wait_file(chan, ints, nextmsg, lang);
5887 res =
wait_file(chan, ints,
"digits/oclock", lang);
5894 res =
wait_file(chan, ints,
"digits/oclock", lang);
5910 res =
wait_file(chan, ints, nextmsg, lang);
5926 if (beg_today < t) {
5928 res =
wait_file(chan, ints,
"digits/today", lang);
5929 }
else if (beg_today - 86400 < t) {
5931 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5951 if (beg_today < t) {
5953 }
else if ((beg_today - 86400) < t) {
5955 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5956 }
else if (beg_today - 86400 * 6 < t) {
5971 res =
wait_file(chan, ints,
"second", lang);
5983 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
5996 struct timeval when = { t, 0 };
5998 int res=0, offset, sndoffset;
5999 char sndfile[256], nextmsg[256];
6002 format =
"AdB 'digits/at' IMp";
6006 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
6007 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
6008 switch (format[offset]) {
6012 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
6013 sndfile[sndoffset] = format[offset];
6015 sndfile[sndoffset] =
'\0';
6016 res =
wait_file(chan, ints, sndfile, lang);
6021 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
6022 res =
wait_file(chan, ints, nextmsg, lang);
6028 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
6029 res =
wait_file(chan, ints, nextmsg, lang);
6033 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", tm.
tm_mon +1);
6034 res =
wait_file(chan, ints, nextmsg, lang);
6040 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", tm.
tm_mday);
6041 res =
wait_file(chan, ints, nextmsg, lang);
6051 res =
wait_file(chan, ints,
"digits/ore-2000", lang);
6055 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year - 100);
6056 res =
wait_file(chan, ints, nextmsg, lang);
6064 res =
wait_file(chan, ints,
"digits/ore-1900", lang);
6065 if ((!res) && (tm.
tm_year != 0)) {
6068 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year);
6069 res =
wait_file(chan, ints, nextmsg, lang);
6075 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", ten * 10);
6076 res =
wait_file(chan, ints, nextmsg, lang);
6079 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", one);
6080 res =
wait_file(chan, ints, nextmsg, lang);
6094 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
6096 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
6098 res =
wait_file(chan, ints, nextmsg, lang);
6104 res =
wait_file(chan, ints,
"digits/ore-mezzanotte", lang);
6106 res =
wait_file(chan, ints,
"digits/ore-una", lang);
6123 res =
wait_file(chan, ints, nextmsg, lang);
6139 if (beg_today < t) {
6141 res =
wait_file(chan, ints,
"digits/today", lang);
6142 }
else if (beg_today - 86400 < t) {
6144 res =
wait_file(chan, ints,
"digits/yesterday", lang);
6161 if (beg_today < t) {
6163 }
else if ((beg_today - 86400) < t) {
6165 res =
wait_file(chan, ints,
"digits/yesterday", lang);
6166 }
else if (beg_today - 86400 * 6 < t) {
6180 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
6181 res =
wait_file(chan, ints, nextmsg, lang);
6182 }
else if (tm.
tm_sec < 10) {
6183 res =
wait_file(chan, ints,
"digits/oh", lang);
6185 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
6186 res =
wait_file(chan, ints, nextmsg, lang);
6188 }
else if ((tm.
tm_sec < 21) || (tm.
tm_sec % 10 == 0)) {
6189 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
6190 res =
wait_file(chan, ints, nextmsg, lang);
6193 ten = (tm.
tm_sec / 10) * 10;
6195 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", ten);
6196 res =
wait_file(chan, ints, nextmsg, lang);
6200 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", one);
6201 res =
wait_file(chan, ints, nextmsg, lang);
6215 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
6228 struct timeval when = { t, 0 };
6230 int res=0, offset, sndoffset;
6231 char sndfile[256], nextmsg[256];
6234 format =
"AdBY 'digits/at' IMp";
6238 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
6239 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
6240 switch (format[offset]) {
6244 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
6245 sndfile[sndoffset] = format[offset];
6247 sndfile[sndoffset] =
'\0';
6248 res =
wait_file(chan, ints, sndfile, lang);
6253 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
6254 res =
wait_file(chan, ints, nextmsg, lang);
6260 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
6261 res =
wait_file(chan, ints, nextmsg, lang);
6265 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", tm.
tm_mon +1);
6266 res =
wait_file(chan, ints, nextmsg, lang);
6276 res =
wait_file(chan, ints,
"digits/2", lang);
6278 res =
wait_file(chan, ints,
"digits/thousand", lang);
6290 res =
wait_file(chan, ints,
"digits/19", lang);
6294 res =
wait_file(chan, ints,
"digits/oh", lang);
6296 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year);
6297 res =
wait_file(chan, ints, nextmsg, lang);
6299 }
else if (tm.
tm_year <= 20) {
6301 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year);
6302 res =
wait_file(chan, ints, nextmsg, lang);
6308 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", ten * 10);
6309 res =
wait_file(chan, ints, nextmsg, lang);
6312 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", one);
6313 res =
wait_file(chan, ints, nextmsg, lang);
6327 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
6329 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
6330 res =
wait_file(chan, ints, nextmsg, lang);
6337 res =
wait_file(chan, ints,
"digits/nl-uur", lang);
6351 res =
wait_file(chan, ints, nextmsg, lang);
6367 if (beg_today < t) {
6369 res =
wait_file(chan, ints,
"digits/today", lang);
6370 }
else if (beg_today - 86400 < t) {
6372 res =
wait_file(chan, ints,
"digits/yesterday", lang);
6389 if (beg_today < t) {
6391 }
else if ((beg_today - 86400) < t) {
6393 res =
wait_file(chan, ints,
"digits/yesterday", lang);
6394 }
else if (beg_today - 86400 * 6 < t) {
6418 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
6431 struct timeval when = { thetime, 0 };
6433 int res=0, offset, sndoffset;
6434 char sndfile[256], nextmsg[256];
6438 for (offset = 0 ; format[offset] !=
'\0' ; offset++) {
6440 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
6441 switch (format[offset]) {
6445 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
6446 sndfile[sndoffset] = format[offset];
6448 sndfile[sndoffset] =
'\0';
6449 res =
wait_file(chan, ints, sndfile, lang);
6454 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
6455 res =
wait_file(chan, ints, nextmsg, lang);
6461 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
6462 res =
wait_file(chan, ints, nextmsg, lang);
6473 res =
wait_file(chan, ints,
"digits/h-30", lang);
6477 res =
wait_file(chan, ints,
"digits/h-20", lang);
6481 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", remaining);
6482 res =
wait_file(chan, ints, nextmsg, lang);
6488 res =
wait_file(chan, ints,
"digits/2", lang);
6490 res =
wait_file(chan, ints,
"digits/1000.2", lang);
6495 }
else if (tm.
tm_year == 100) {
6496 res =
wait_file(chan, ints,
"digits/h-2000", lang);
6503 res =
wait_file(chan, ints,
"digits/1000", lang);
6505 wait_file(chan, ints,
"digits/900", lang);
6511 wait_file(chan, ints,
"digits/year", lang);
6519 snprintf(nextmsg,
sizeof(nextmsg),
"digits/t-%d", tm.
tm_hour - 12);
6521 snprintf(nextmsg,
sizeof(nextmsg),
"digits/t-%d", tm.
tm_hour);
6523 res =
wait_file(chan, ints, nextmsg, lang);
6529 snprintf(nextmsg,
sizeof(nextmsg),
"digits/t-%d", tm.
tm_hour);
6530 res =
wait_file(chan, ints, nextmsg, lang);
6532 res =
wait_file(chan, ints,
"digits/t-24", lang);
6538 if (format[offset] ==
'M') {
6539 res =
wait_file(chan, ints,
"digits/oclock", lang);
6541 res =
wait_file(chan, ints,
"digits/100", lang);
6553 res =
wait_file(chan, ints, nextmsg, lang);
6566 if (beg_today < thetime) {
6568 res =
wait_file(chan, ints,
"digits/today", lang);
6569 }
else if (beg_today - 86400 < thetime) {
6571 res =
wait_file(chan, ints,
"digits/yesterday", lang);
6588 if (beg_today < thetime) {
6590 }
else if ((beg_today - 86400) < thetime) {
6592 res =
wait_file(chan, ints,
"digits/yesterday", lang);
6593 }
else if (beg_today - 86400 * 6 < thetime) {
6606 res =
wait_file(chan, ints,
"digits/and", lang);
6609 res =
wait_file(chan, ints,
"digits/1z", lang);
6611 res =
wait_file(chan, ints,
"digits/second-a", lang);
6619 if (one > 1 && one < 5 && ten != 1)
6620 res =
wait_file(chan, ints,
"seconds", lang);
6622 res =
wait_file(chan, ints,
"second", lang);
6636 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
6648 struct timeval when = { t, 0 };
6650 int res=0, offset, sndoffset;
6651 char sndfile[256], nextmsg[256];
6654 format =
"Ad 'digits/pt-de' B 'digits/pt-de' Y I 'digits/pt-e' Mp";
6658 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
6659 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
6660 switch (format[offset]) {
6664 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
6665 sndfile[sndoffset] = format[offset];
6667 sndfile[sndoffset] =
'\0';
6668 snprintf(nextmsg,
sizeof(nextmsg),
"%s", sndfile);
6669 res =
wait_file(chan, ints, nextmsg, lang);
6674 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
6675 res =
wait_file(chan, ints, nextmsg, lang);
6681 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
6682 res =
wait_file(chan, ints, nextmsg, lang);
6686 if (!strcasecmp(lang,
"pt_BR")) {
6689 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", tm.
tm_mon +1);
6690 res =
wait_file(chan, ints, nextmsg, lang);
6705 if (!strcasecmp(lang,
"pt_BR")) {
6707 if (format[offset] ==
'I')
6708 res =
wait_file(chan, ints,
"digits/pt-a", lang);
6710 res =
wait_file(chan, ints,
"digits/pt-meianoite", lang);
6711 }
else if (tm.
tm_hour == 12) {
6712 if (format[offset] ==
'I')
6713 res =
wait_file(chan, ints,
"digits/pt-ao", lang);
6715 res =
wait_file(chan, ints,
"digits/pt-meiodia", lang);
6717 if (format[offset] ==
'I') {
6719 res =
wait_file(chan, ints,
"digits/pt-as", lang);
6721 res =
wait_file(chan, ints,
"digits/pt-a", lang);
6728 if (format[offset] ==
'I')
6729 res =
wait_file(chan, ints,
"digits/pt-ah", lang);
6731 res =
wait_file(chan, ints,
"digits/pt-meianoite", lang);
6734 if (format[offset] ==
'I')
6735 res =
wait_file(chan, ints,
"digits/pt-ao", lang);
6737 res =
wait_file(chan, ints,
"digits/pt-meiodia", lang);
6740 if (format[offset] ==
'I') {
6741 res =
wait_file(chan, ints,
"digits/pt-ah", lang);
6744 res =
wait_file(chan, ints,
"digits/pt-sss", lang);
6754 if (!strcasecmp(lang,
"pt_BR")) {
6756 if ((!res) && (format[offset] ==
'H')) {
6758 res =
wait_file(chan, ints,
"digits/hours", lang);
6760 res =
wait_file(chan, ints,
"digits/hour", lang);
6769 res =
wait_file(chan, ints,
"digits/20", lang);
6773 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", remaining);
6774 res =
wait_file(chan, ints, nextmsg, lang);
6782 if (!strcasecmp(lang,
"pt_BR")) {
6786 res =
wait_file(chan, ints,
"minutes", lang);
6788 res =
wait_file(chan, ints,
"minute", lang);
6793 res =
wait_file(chan, ints,
"digits/pt-hora", lang);
6796 res =
wait_file(chan, ints,
"digits/pt-sss", lang);
6805 if (!strcasecmp(lang,
"pt_BR")) {
6807 res =
wait_file(chan, ints,
"digits/pt-da", lang);
6810 res =
wait_file(chan, ints,
"digits/morning", lang);
6812 res =
wait_file(chan, ints,
"digits/afternoon", lang);
6813 else res =
wait_file(chan, ints,
"digits/night", lang);
6818 res =
wait_file(chan, ints,
"digits/p-m", lang);
6820 res =
wait_file(chan, ints,
"digits/a-m", lang);
6837 if (beg_today < t) {
6839 res =
wait_file(chan, ints,
"digits/today", lang);
6840 }
else if (beg_today - 86400 < t) {
6842 res =
wait_file(chan, ints,
"digits/yesterday", lang);
6862 if (beg_today < t) {
6864 }
else if ((beg_today - 86400) < t) {
6866 res =
wait_file(chan, ints,
"digits/yesterday", lang);
6867 }
else if (beg_today - 86400 * 6 < t) {
6880 if (!strcasecmp(lang,
"pt_BR")) {
6884 res =
wait_file(chan, ints,
"seconds", lang);
6886 res =
wait_file(chan, ints,
"second", lang);
6891 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
6892 res =
wait_file(chan, ints, nextmsg, lang);
6893 }
else if (tm.
tm_sec < 10) {
6894 res =
wait_file(chan, ints,
"digits/oh", lang);
6896 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
6897 res =
wait_file(chan, ints, nextmsg, lang);
6899 }
else if ((tm.
tm_sec < 21) || (tm.
tm_sec % 10 == 0)) {
6900 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
6901 res =
wait_file(chan, ints, nextmsg, lang);
6904 ten = (tm.
tm_sec / 10) * 10;
6906 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", ten);
6907 res =
wait_file(chan, ints, nextmsg, lang);
6911 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", one);
6912 res =
wait_file(chan, ints, nextmsg, lang);
6927 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
6940 struct timeval when = { t, 0 };
6942 int res=0, offset, sndoffset;
6943 char sndfile[256], nextmsg[256];
6950 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
6951 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
6952 switch (format[offset]) {
6956 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
6957 sndfile[sndoffset] = format[offset];
6959 sndfile[sndoffset] =
'\0';
6960 res =
wait_file(chan, ints, sndfile, lang);
6965 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
6966 res =
wait_file(chan, ints, nextmsg, lang);
6973 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
6974 res =
wait_file(chan, ints, nextmsg, lang);
6980 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_mday);
6981 res =
wait_file(chan, ints, nextmsg, lang);
6983 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_mday - (tm.
tm_mday % 10));
6984 res =
wait_file(chan, ints, nextmsg, lang);
6986 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_mday % 10);
6987 res =
wait_file(chan, ints, nextmsg, lang);
6990 if (!res) res =
wait_file(chan, ints,
"digits/day", lang);
6995 res =
wait_file(chan, ints,
"digits/2", lang);
6997 res =
wait_file(chan, ints,
"digits/thousand", lang);
7001 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", (tm.
tm_year - 100) / 10);
7002 res =
wait_file(chan, ints, nextmsg, lang);
7004 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", (tm.
tm_year - 100) % 10);
7005 res =
wait_file(chan, ints, nextmsg, lang);
7010 res =
wait_file(chan, ints,
"digits/year", lang);
7017 res =
wait_file(chan, ints,
"digits/1", lang);
7019 res =
wait_file(chan, ints,
"digits/9", lang);
7024 res =
wait_file(chan, ints,
"digits/0", lang);
7026 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year);
7027 res =
wait_file(chan, ints, nextmsg, lang);
7031 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year / 10);
7032 res =
wait_file(chan, ints, nextmsg, lang);
7034 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year % 10);
7035 res =
wait_file(chan, ints, nextmsg, lang);
7041 res =
wait_file(chan, ints,
"digits/year", lang);
7051 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
7053 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
7054 res =
wait_file(chan, ints, nextmsg, lang);
7056 res =
wait_file(chan, ints,
"digits/oclock", lang);
7061 res =
wait_file(chan, ints,
"digits/0", lang);
7069 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
7070 res =
wait_file(chan, ints, nextmsg, lang);
7072 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - (tm.
tm_hour % 10));
7073 res =
wait_file(chan, ints, nextmsg, lang);
7075 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour % 10);
7076 res =
wait_file(chan, ints, nextmsg, lang);
7080 res =
wait_file(chan, ints,
"digits/oclock", lang);
7087 res =
wait_file(chan, ints,
"digits/0", lang);
7089 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_min);
7090 res =
wait_file(chan, ints, nextmsg, lang);
7092 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_min - (tm.
tm_min % 10));
7093 res =
wait_file(chan, ints, nextmsg, lang);
7095 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_min % 10);
7096 res =
wait_file(chan, ints, nextmsg, lang);
7100 res =
wait_file(chan, ints,
"minute", lang);
7110 res =
wait_file(chan, ints, nextmsg, lang);
7126 if (beg_today < t) {
7128 res =
wait_file(chan, ints,
"digits/today", lang);
7129 }
else if (beg_today - 86400 < t) {
7131 res =
wait_file(chan, ints,
"digits/yesterday", lang);
7151 if (beg_today < t) {
7153 }
else if ((beg_today - 86400) < t) {
7155 res =
wait_file(chan, ints,
"digits/yesterday", lang);
7156 }
else if (beg_today - 86400 * 6 < t) {
7171 res =
wait_file(chan, ints,
"digits/0", lang);
7173 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
7174 res =
wait_file(chan, ints, nextmsg, lang);
7176 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec - (tm.
tm_sec % 10));
7177 res =
wait_file(chan, ints, nextmsg, lang);
7179 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec % 10);
7180 res =
wait_file(chan, ints, nextmsg, lang);
7184 res =
wait_file(chan, ints,
"second", lang);
7196 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
7208 if (!strncasecmp(lang,
"en", 2)) {
7210 }
else if (!strncasecmp(lang,
"de", 2)) {
7212 }
else if (!strncasecmp(lang,
"fr", 2)) {
7214 }
else if (!strncasecmp(lang,
"gr", 2)) {
7216 }
else if (!strncasecmp(lang,
"ja", 2)) {
7218 }
else if (!strncasecmp(lang,
"he", 2)) {
7220 }
else if (!strncasecmp(lang,
"hu", 2)) {
7222 }
else if (!strncasecmp(lang,
"ka", 2)) {
7224 }
else if (!strncasecmp(lang,
"nl", 2)) {
7226 }
else if (!strncasecmp(lang,
"pt_BR", 5)) {
7228 }
else if (!strncasecmp(lang,
"pt", 2)) {
7230 }
else if (!strncasecmp(lang,
"th", 2)) {
7232 }
else if (!strncasecmp(lang,
"zh", 2)) {
7243 struct timeval when = { t, 0 };
7252 else if (hour == 12)
7254 else if (hour > 12) {
7292 struct timeval when = { t, 0 };
7312 struct timeval when = { t, 0 };
7335 struct timeval when = { t, 0 };
7359 struct timeval when = { t, 0 };
7379 struct timeval when = { t, 0 };
7390 res =
wait_file(chan, ints,
"digits/pt-e", lang);
7395 res =
wait_file(chan, ints,
"digits/pt-hora", lang);
7398 res =
wait_file(chan, ints,
"digits/pt-sss", lang);
7408 struct timeval when = { t, 0 };
7417 res =
wait_file(chan, ints,
"digits/hours", lang);
7419 res =
wait_file(chan, ints,
"digits/hour", lang);
7421 if ((!res) && (tm.
tm_min)) {
7422 res =
wait_file(chan, ints,
"digits/pt-e", lang);
7427 res =
wait_file(chan, ints,
"minutes", lang);
7429 res =
wait_file(chan, ints,
"minute", lang);
7438 struct timeval when = { t, 0 };
7456 struct timeval when = { t, 0 };
7465 else if (hour == 12)
7467 else if (hour > 12) {
7498 struct timeval when = { t, 0 };
7534 if (!strncasecmp(lang,
"en", 2)) {
7536 }
else if (!strncasecmp(lang,
"de", 2)) {
7538 }
else if (!strncasecmp(lang,
"fr", 2)) {
7540 }
else if (!strncasecmp(lang,
"gr", 2)) {
7542 }
else if (!strncasecmp(lang,
"ja", 2)) {
7544 }
else if (!strncasecmp(lang,
"he", 2)) {
7546 }
else if (!strncasecmp(lang,
"hu", 2)) {
7548 }
else if (!strncasecmp(lang,
"ka", 2)) {
7550 }
else if (!strncasecmp(lang,
"nl", 2)) {
7552 }
else if (!strncasecmp(lang,
"pt_BR", 5)) {
7554 }
else if (!strncasecmp(lang,
"pt", 2)) {
7556 }
else if (!strncasecmp(lang,
"th", 2)) {
7558 }
else if (!strncasecmp(lang,
"zh", 2)) {
7569 struct timeval when = { t, 0 };
7577 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
7583 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
7594 else if (hour == 12)
7596 else if (hour > 12) {
7636 struct timeval when = { t, 0 };
7651 struct timeval when = { t, 0 };
7665 struct timeval when = { t, 0 };
7676 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
7682 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
7706 struct timeval when = { t, 0 };
7725 struct timeval when = { t, 0 };
7733 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
7739 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
7750 else if (hour == 12)
7752 else if (hour > 12) {
7792 struct timeval when = { t, 0 };
7806 struct timeval when = { t, 0 };
7813 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
7819 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
7849 struct timeval when = { t, 0 };
7859 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
7867 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
7876 else if (hour == 12)
7878 else if (hour > 12) {
7909 struct timeval when = { t, 0 };
7917 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
7924 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
7974 if (!strncasecmp(lang,
"en", 2)) {
7976 }
else if (!strncasecmp(lang,
"fr", 2)) {
7978 }
else if (!strncasecmp(lang,
"he", 2)) {
7980 }
else if (!strncasecmp(lang,
"ka", 2)) {
7982 }
else if (!strncasecmp(lang,
"pt", 2)) {
7994 struct timeval nowtv =
ast_tvnow(), when = { t, 0 };
8003 if ((daydiff < 0) || (daydiff > 6)) {
8006 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
8014 }
else if (daydiff) {
8017 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
8032 struct timeval nowtv =
ast_tvnow(), when = { t, 0 };
8041 if ((daydiff < 0) || (daydiff > 6)) {
8044 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
8052 }
else if (daydiff) {
8055 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
8073 struct timeval nowtv =
ast_tvnow(), when = { t, 0 };
8079 if ((daydiff < 0) || (daydiff > 6)) {
8084 res =
wait_file(chan, ints,
"digits/pt-de", lang);
8085 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
8089 }
else if (daydiff) {
8091 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
8095 if (!strcasecmp(lang,
"pt_BR")) {
8109 res =
wait_file(chan, ints,
"digits/pt-sss", lang);
8120 struct timeval nowt =
ast_tvnow(), when = { t, 0 };
8129 if ((daydiff < 0) || (daydiff > 6)) {
8132 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
8140 }
else if (daydiff) {
8143 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
8169 snprintf(fn,
sizeof(fn),
"digits/female-%d", num);
8171 }
else if (num < 13) {
8173 }
else if (num <100 ) {
8174 tmp = (num/10) * 10;
8176 snprintf(fn,
sizeof(fn),
"digits/%d",
tmp);
8220 while (!res && num ) {
8223 snprintf(fn,
sizeof(fn),
"digits/%d", num);
8225 }
else if (num <= 100) {
8227 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
8229 }
else if (num < 200) {
8231 snprintf(fn,
sizeof(fn),
"digits/hundred-100");
8233 }
else if (num < 1000) {
8235 snprintf(fn,
sizeof(fn),
"digits/hundred-%d", (num/100)*100);
8237 }
else if (num < 2000){
8238 snprintf(fn,
sizeof(fn),
"digits/xilia");
8242 if (num < 1000000) {
8247 snprintf(fn,
sizeof(fn),
"digits/thousands");
8249 if (num < 1000000000) {
8254 snprintf(fn,
sizeof(fn),
"digits/millions");
8256 ast_debug(1,
"Number '%d' is too big for me\n", num);
8263 if ((audiofd > -1) && (ctrlfd > -1))
8284 while (!res && (num || playh)) {
8287 if ( num > INT_MIN ) {
8295 }
else if (num < 20) {
8296 snprintf(fn,
sizeof(fn),
"digits/%d", num);
8298 }
else if (num < 100) {
8299 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
8303 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
8307 if (num < 1000000) {
8312 snprintf(fn,
sizeof(fn),
"digits/thousand");
8314 if (num < 1000000000) {
8321 ast_debug(1,
"Number '%d' is too big for me\n", num);
8329 if ((audiofd > -1) && (ctrlfd > -1))
8353 struct timeval when = { t, 0 };
8362 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
8373 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
8389 struct timeval tv = { t, 0 };
8402 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
8412 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
8433 struct timeval when = { t, 0 };
8443 else if (hour == 12)
8445 else if (hour > 12) {
8480 struct timeval tv = { t, 0 };
8490 else if (hour == 12)
8492 else if (hour > 12) {
8504 if (hour == 9 || hour == 21) {
8527 struct timeval when = { t, 0 };
8536 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
8547 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
8560 struct timeval tv = { t, 0 };
8573 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
8583 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
8592 else if (hour == 12)
8594 else if (hour > 12) {
8605 if (hour == 9 || hour == 21) {
8627 struct timeval when = { t, 0 };
8629 int res=0, offset, sndoffset;
8630 char sndfile[256], nextmsg[256];
8633 format =
"AdBY 'digits/at' IMp";
8637 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
8638 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
8639 switch (format[offset]) {
8643 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
8644 sndfile[sndoffset] = format[offset];
8646 sndfile[sndoffset] =
'\0';
8647 res =
wait_file(chan, ints, sndfile, lang);
8652 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
8653 res =
wait_file(chan, ints, nextmsg, lang);
8659 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
8660 res =
wait_file(chan, ints, nextmsg, lang);
8710 res =
wait_file(chan, ints, nextmsg, lang);
8726 if (beg_today < t) {
8728 res =
wait_file(chan, ints,
"digits/today", lang);
8729 }
else if (beg_today - 86400 < t) {
8731 res =
wait_file(chan, ints,
"digits/yesterday", lang);
8751 if (beg_today < t) {
8753 }
else if ((beg_today - 86400) < t) {
8755 res =
wait_file(chan, ints,
"digits/yesterday", lang);
8756 }
else if (beg_today - 86400 * 6 < t) {
8770 res =
wait_file(chan, ints, nextmsg, lang);
8775 res =
wait_file(chan, ints, nextmsg, lang);
8786 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
8799 struct timeval tv = { time, 0 };
8801 int res = 0, offset, sndoffset;
8802 char sndfile[256], nextmsg[256];
8805 format =
"YbdAPIMS";
8809 for (offset = 0; format[offset] !=
'\0'; offset++) {
8810 ast_log(
LOG_DEBUG,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
8811 switch (format[offset]) {
8815 for (sndoffset = 0; (format[++offset] !=
'\'') && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
8816 sndfile[sndoffset] = format[offset];
8818 sndfile[sndoffset] =
'\0';
8819 res =
wait_file(chan,ints,sndfile,lang);
8824 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
8825 res =
wait_file(chan,ints,nextmsg,lang);
8831 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
8832 res =
wait_file(chan,ints,nextmsg,lang);
8838 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d_2", tm.
tm_mday);
8839 res =
wait_file(chan,ints,nextmsg,lang);
8842 res =
wait_file(chan,ints,
"digits/20",lang);
8844 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_mday - 20);
8845 res =
wait_file(chan,ints,nextmsg,lang);
8847 res =
wait_file(chan,ints,
"digits/nichi",lang);
8848 }
else if (tm.
tm_mday == 30) {
8850 res =
wait_file(chan,ints,
"digits/h-30_2",lang);
8853 res =
wait_file(chan,ints,
"digits/30",lang);
8854 res =
wait_file(chan,ints,
"digits/1",lang);
8855 res =
wait_file(chan,ints,
"digits/nichi",lang);
8861 res =
wait_file(chan,ints,
"digits/2",lang);
8863 res =
wait_file(chan,ints,
"digits/thousand",lang);
8868 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year - 100);
8869 res =
wait_file(chan,ints,nextmsg,lang);
8877 res =
wait_file(chan,ints,
"digits/19",lang);
8881 res =
wait_file(chan,ints,
"digits/oh",lang);
8883 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year);
8884 res =
wait_file(chan,ints,nextmsg,lang);
8886 }
else if (tm.
tm_year <= 20) {
8888 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year);
8889 res =
wait_file(chan,ints,nextmsg,lang);
8895 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", ten * 10);
8896 res =
wait_file(chan,ints,nextmsg,lang);
8899 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", one);
8900 res =
wait_file(chan,ints,nextmsg,lang);
8907 res =
wait_file(chan,ints,
"digits/nen",lang);
8913 snprintf(nextmsg,
sizeof(nextmsg),
"digits/p-m");
8915 snprintf(nextmsg,
sizeof(nextmsg),
"digits/a-m");
8916 res =
wait_file(chan,ints,nextmsg,lang);
8922 snprintf(nextmsg,
sizeof(nextmsg),
"digits/12");
8924 snprintf(nextmsg,
sizeof(nextmsg),
"digits/9_2");
8926 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
8928 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
8929 res =
wait_file(chan,ints,nextmsg,lang);
8930 if(!res) res =
wait_file(chan,ints,
"digits/ji",lang);
8938 res =
wait_file(chan,ints,
"digits/20",lang);
8942 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", remainder);
8943 res =
wait_file(chan,ints,nextmsg,lang);
8947 res =
wait_file(chan,ints,
"digits/ji",lang);
8952 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_min);
8953 res =
wait_file(chan,ints,nextmsg,lang);
8956 ten = (tm.
tm_min / 10) * 10;
8958 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", ten);
8959 res =
wait_file(chan,ints,nextmsg,lang);
8963 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", one);
8964 res =
wait_file(chan,ints,nextmsg,lang);
8968 res =
wait_file(chan,ints,
"digits/fun",lang);
8977 gettimeofday(&now,
NULL);
8982 if (beg_today < time) {
8984 res =
wait_file(chan,ints,
"digits/today",lang);
8985 }
else if (beg_today - 86400 < time) {
8987 res =
wait_file(chan,ints,
"digits/yesterday",lang);
9000 gettimeofday(&now,
NULL);
9005 if (beg_today < time) {
9007 }
else if ((beg_today - 86400) < time) {
9009 res =
wait_file(chan,ints,
"digits/yesterday",lang);
9010 }
else if (beg_today - 86400 * 6 < time) {
9024 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
9025 res =
wait_file(chan,ints,nextmsg,lang);
9026 }
else if ((tm.
tm_sec < 21) || (tm.
tm_sec % 10 == 0)) {
9027 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
9028 res =
wait_file(chan,ints,nextmsg,lang);
9031 ten = (tm.
tm_sec / 10) * 10;
9033 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", ten);
9034 res =
wait_file(chan,ints,nextmsg,lang);
9038 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", one);
9039 res =
wait_file(chan,ints,nextmsg,lang);
9043 res =
wait_file(chan,ints,
"digits/byou",lang);
9054 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
9067 struct timeval when = { t, 0 };
9069 int res = 0, offset, sndoffset;
9070 char sndfile[256], nextmsg[256];
9073 format =
"A 'digits/day' eB 'digits/year' Y 'digits/at' k 'hours' M 'minutes' p";
9077 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
9078 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
9079 switch (format[offset]) {
9083 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
9084 sndfile[sndoffset] = format[offset];
9086 sndfile[sndoffset] =
'\0';
9087 res =
wait_file(chan, ints, sndfile, lang);
9092 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
9093 res =
wait_file(chan, ints, nextmsg, lang);
9099 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
9100 res =
wait_file(chan, ints, nextmsg, lang);
9119 res =
wait_file(chan, ints,
"digits/19", lang);
9123 res =
wait_file(chan, ints,
"digits/odd", lang);
9136 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
9138 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
9139 res =
wait_file(chan, ints, nextmsg, lang);
9144 if (format[offset] ==
'H') {
9147 res =
wait_file(chan, ints,
"digits/0", lang);
9152 res =
wait_file(chan, ints,
"digits/0", lang);
9159 res =
wait_file(chan, ints,
"digits/20", lang);
9163 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", remaining);
9164 res =
wait_file(chan, ints, nextmsg, lang);
9181 res =
wait_file(chan, ints, nextmsg, lang);
9193 gettimeofday(&now,
NULL);
9198 if (beg_today < t) {
9200 res =
wait_file(chan, ints,
"digits/today", lang);
9201 }
else if (beg_today - 86400 < t) {
9203 res =
wait_file(chan, ints,
"digits/yesterday", lang);
9204 }
else if (beg_today - 86400 * 6 < t) {
9207 }
else if (beg_today - 2628000 < t) {
9210 }
else if (beg_today - 15768000 < t) {
9234 if (beg_today < t) {
9236 }
else if ((beg_today - 86400) < t) {
9238 res =
wait_file(chan, ints,
"digits/yesterday", lang);
9239 }
else if (beg_today - 86400 * 6 < t) {
9242 }
else if (beg_today - 2628000 < t) {
9245 }
else if (beg_today - 15768000 < t) {
9270 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
9309 strncat(res,
"minus ", res_len - strlen(res) - 1);
9310 if ( num > INT_MIN ) {
9319 if (num <= 20 || num == 40 || num == 60 || num == 80 || num == 100) {
9320 snprintf(
buf,
sizeof(
buf),
"%d", num);
9321 strncat(res,
buf, res_len - strlen(res) - 1);
9327 strncat(res,
"20_ ", res_len - strlen(res) - 1);
9332 strncat(res,
"40_ ", res_len - strlen(res) - 1);
9337 strncat(res,
"60_ ", res_len - strlen(res) - 1);
9342 strncat(res,
"80_ ", res_len - strlen(res) - 1);
9348 remaining = num % 100;
9349 digit = (num - remaining) / 100;
9351 if (remaining == 0) {
9352 snprintf(
buf,
sizeof(
buf),
"%d", num);
9353 strncat(res,
buf, res_len - strlen(res) - 1);
9357 strncat(res,
buf, res_len - strlen(res) - 1);
9364 strncat(res,
"1000", res_len - strlen(res) - 1);
9369 if (num < 1000000) {
9370 remaining = num % 1000;
9371 digit = (num - remaining) / 1000;
9373 if (remaining == 0) {
9375 strncat(res,
" 1000", res_len - strlen(res) - 1);
9380 strncat(res,
"1000_ ", res_len - strlen(res) - 1);
9385 strncat(res,
" 1000_ ", res_len - strlen(res) - 1);
9390 if (num == 1000000) {
9391 strncat(res,
"1 1000000", res_len - strlen(res) - 1);
9396 if (num < 1000000000) {
9397 remaining = num % 1000000;
9398 digit = (num - remaining) / 1000000;
9400 if (remaining == 0) {
9402 strncat(res,
" 1000000", res_len - strlen(res) - 1);
9407 strncat(res,
" 1000000_ ", res_len - strlen(res) - 1);
9412 if (num == 1000000000) {
9413 strncat(res,
"1 1000000000", res_len - strlen(res) - 1);
9418 if (num > 1000000000) {
9419 remaining = num % 1000000000;
9420 digit = (num - remaining) / 1000000000;
9422 if (remaining == 0) {
9424 strncat(res,
" 1000000000", res_len - strlen(res) - 1);
9429 strncat(res,
" 1000000000_ ", res_len - strlen(res) - 1);
9445 const char* remaining = fn;
9456 while (res == 0 && (s = strstr(remaining,
" "))) {
9457 size_t len = s - remaining;
9460 sprintf(new_string,
"digits/");
9461 strncat(new_string, remaining,
len);
9465 if ((audiofd > -1) && (ctrlfd > -1)) {
9476 while (*remaining ==
' ') {
9483 if (res == 0 && *remaining) {
9485 char* new_string =
ast_malloc(strlen(remaining) + 1 + strlen(
"digits/"));
9486 sprintf(new_string,
"digits/%s", remaining);
9489 if ((audiofd > -1) && (ctrlfd > -1)) {
9520 struct timeval when = { t, 0 };
9531 snprintf(fn,
sizeof(fn),
"digits/tslis %d", tm.
tm_wday);
9546 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
9563 struct timeval when = { t, 0 };
9597 struct timeval when = { t, 0 };
9620 struct timeval when = { t, 0 }, nowt =
ast_tvnow();
9626 if ((daydiff < 0) || (daydiff > 6)) {
9632 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
9639 }
else if (daydiff) {
9642 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
9669 if (num == 1 || num == -1) {
9698 if (num > 0 && num < 5) {
9719 temp =
ast_alloca((temp_len = (strlen(noun) + strlen(ending) + 1)));
9720 snprintf(temp, temp_len,
"%s%s", noun, ending);
9741 return gender ? gender :
"";
9761 temp =
ast_alloca((temp_len = (strlen(adjective) + strlen(ending) + 1)));
9762 snprintf(temp, temp_len,
"%s%s", adjective, ending);
Asterisk main include file. File version handling, generic pbx functions.
#define ast_alloca(size)
call __builtin_alloca to ensure we get gcc builtin semantics
#define ast_malloc(len)
A wrapper for malloc()
static char language[MAX_LANGUAGE]
General Asterisk PBX channel definitions.
const char * ast_channel_name(const struct ast_channel *chan)
const char * ast_channel_language(const struct ast_channel *chan)
Generic File Format Support. Should be included by clients of the file handling routines....
int ast_waitstream_full(struct ast_channel *c, const char *breakon, int audiofd, int monfd)
int ast_stopstream(struct ast_channel *c)
Stops a stream.
int ast_streamfile(struct ast_channel *c, const char *filename, const char *preflang)
Streams a file.
int ast_fileexists(const char *filename, const char *fmt, const char *preflang)
Checks for the existence of a given file.
int ast_waitstream(struct ast_channel *c, const char *breakon)
Waits for a stream to stop or digit to be pressed.
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
Application convenience functions, designed to give consistent look and feel to Asterisk apps.
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.
char * strsep(char **str, const char *delims)
#define ast_debug(level,...)
Log a DEBUG message.
#define ast_verb(level,...)
Custom localtime functions for multiple timezones.
struct ast_tm * ast_localtime(const struct timeval *timep, struct ast_tm *p_tm, const char *zone)
Timezone-independent version of localtime_r(3).
Asterisk locking-related definitions:
static struct ast_str * get_ordinal_str_en(int num, 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_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 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
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 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_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 struct ast_str * get_number_str_en(int num, const char *lang)
static int exp10_int(int power)
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
static int say_datetime_from_now(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
static int ast_say_datetime_pt_BR(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Brazilian Portuguese syntax.
static int say_time(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
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.
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_time_th(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Thai 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 get_lastdigits_ru(int num)
determine last digits for thousands/millions (ru)
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_time_de(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
German syntax.
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_pt(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Portuguese syntax.
static int say_digit_str_full(struct ast_channel *chan, const char *str, const char *ints, const char *lang, int audiofd, int ctrlfd)
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_number_full_ja(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd)
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 say_phonetic_str_full(struct ast_channel *chan, const char *str, const char *ints, const char *lang, int audiofd, int ctrlfd)
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 void __say_init(void)
remap the 'say' functions to use those in this file
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)
struct ast_str * ast_get_ordinal_str(int num, const char *lang)
ast_get_ordinal_str: call language-specific functions
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
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 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_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_time_he(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Hebrew 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_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
static char * pl_rzad_na_tekst(odmiana *odm, int i, int rzad)
static int ast_say_datetime_ja(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
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_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_pl(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
Polish 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 ast_say_date_gr(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Greek support.
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_enumeration_full_vi(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd)
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_fr(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
French syntax.
static int wait_file(struct ast_channel *chan, const char *ints, const char *file, const char *lang)
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_date_de(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
German syntax.
int ast_say_counted_adjective(struct ast_channel *chan, int num, const char adjective[], const char gender[])
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.
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.
static int ast_say_datetime_gr(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Greek support.
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_date_nl(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Dutch syntax.
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.
static int ast_say_datetime_he(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Hebrew 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
static int ast_say_time_nl(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
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_is(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
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)
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_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_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_number_full_he(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
static int say_ordinal_full(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
say_ordinal_full
struct ast_str * ast_get_phonetic_str(const char *str, const char *lang)
Returns an ast_str of files for SayPhonetic playback.
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 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,...
static int ast_say_time_gr(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Greek support.
static int ast_say_time_hu(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Hungarian syntax.
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_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_datetime_from_now_fr(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
French syntax.
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_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.
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_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_time_ja(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
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_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
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_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_datetime_fr(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
French syntax.
static int ast_say_time_zh(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Taiwanese / Chinese syntax.
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_date_hu(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Hungarian syntax.
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 =...
static int say_datetime(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
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
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.
static struct ast_str * ast_get_money_en_dollars_str(const char *str, const char *lang)
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_ja(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
static int ast_say_datetime_de(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
German syntax.
static int ast_say_time_pt(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Portuguese syntax.
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_date_he(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Hebrew syntax.
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_zh(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Taiwanese / Chinese 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 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 char next_item(const char *format)
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_date_th(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Thai syntax.
static int say_money_str_full(struct ast_channel *chan, const char *str, const char *ints, const char *lang, int audiofd, int ctrlfd)
int ast_say_counted_noun(struct ast_channel *chan, int num, const char noun[])
static int ast_say_datetime_from_now_en(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
English syntax.
static char * ast_translate_number_ka(int num, char *res, int res_len)
Georgian support.
static int say_date(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
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 ast_say_number_full_pl(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
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 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_time_pt_BR(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Brazilian Portuguese syntax.
static int say_filenames(struct ast_channel *chan, const char *ints, const char *lang, int audiofd, int ctrlfd, struct ast_str *filenames)
static const char * counted_noun_ending_en(int num)
In English, we use the plural for everything but one. For example:
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.
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_datetime_th(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Thai syntax.
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_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
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".
Say numbers and dates (maybe words one day too)
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)
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)
SAY_EXTERN int(* ast_say_date)(struct ast_channel *chan, time_t t, const char *ints, const char *lang) SAY_INIT(ast_say_date)
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.
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.
SAY_EXTERN int(* ast_say_ordinal_full)(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options, int audiofd, int ctrlfd) SAY_INIT(ast_say_ordinal_full)
Same as ast_say_number() with audiofd for received audio and returns 1 on ctrlfd being readable.
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)
int ast_say_number(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options)
says a number
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)
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.
int ast_say_enumeration(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options)
says an enumeration
ast_say_case_sensitivity
Controls how ast_say_character_str denotes the case of characters in a string.
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.
SAY_EXTERN int(* ast_say_time)(struct ast_channel *chan, time_t t, const char *ints, const char *lang) SAY_INIT(ast_say_time)
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)
SAY_EXTERN int(* ast_say_datetime)(struct ast_channel *chan, time_t t, const char *ints, const char *lang) SAY_INIT(ast_say_datetime)
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
void ast_str_reset(struct ast_str *buf)
Reset the content of a dynamic string. Useful before a series of ast_str_append.
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
size_t ast_str_strlen(const struct ast_str *buf)
Returns the current length of the string stored within buf.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
char * ast_skip_blanks(const char *str)
Gets a pointer to the first non-whitespace character in a string.
Main Channel structure associated with a channel.
Support for dynamic strings.
char * separator_dziesiatek
#define ast_test_suite_event_notify(s, f,...)
Time-related functions and macros.
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().