42#include <netinet/in.h>
48#include <iso/limits_iso.h>
66 char fnbuf[10], asciibuf[20] =
"letters/ascii";
79 while (
str[num] && !res) {
89 fn =
"letters/exclaimation-point";
95 fn =
"letters/dollar";
104 fn =
"letters/equals";
110 fn =
"letters/slash";
113 fn =
"letters/space";
125 strcpy(fnbuf,
"digits/X");
131 if (
'A' <= ltr && ltr <=
'Z') {
133 switch (sensitivity) {
141 }
else if (
'a' <= ltr && ltr <=
'z') {
142 switch (sensitivity) {
153 strcpy(fnbuf,
"uppercase");
155 strcpy(fnbuf,
"lowercase");
157 strcpy(fnbuf,
"letters/X");
163 (snprintf(asciibuf + 13,
sizeof(asciibuf) - 13,
"%d",
str[num]) > 0 &&
ast_fileexists(asciibuf,
NULL, lang) > 0 && (fn = asciibuf))) {
166 if (upper || lower) {
193 while (!res && (fn =
strsep(&files,
"&"))) {
196 if ((audiofd > -1) && (ctrlfd > -1)) {
213 return say_filenames(chan, ints, lang, audiofd, ctrlfd, filenames);
239 fn =
"letters/exclaimation-point";
245 fn =
"letters/dollar";
254 fn =
"letters/equals";
260 fn =
"letters/slash";
263 fn =
"letters/space";
274 strcpy(fnbuf,
"digits/X");
280 if (
'A' <= ltr && ltr <=
'Z') ltr +=
'a' -
'A';
281 strcpy(fnbuf,
"phonetic/X_p");
297 return say_filenames(chan, ints, lang, audiofd, ctrlfd, filenames);
334 strcpy(fnbuf,
"digits/X");
351 return say_filenames(chan, ints, lang, audiofd, ctrlfd, filenames);
357 int amt, dollars = 0, cents = 0;
374 if (sscanf(
str,
".%02u", ¢s) < 1) {
379 const char *period = strchr(
str,
'.');
380 if (period && !isdigit(*(period + 1))) {
385 int res = sscanf(
str,
"%d.%02u", &dollars, ¢s);
388 }
else if (res == 2) {
389 const char *period = strchr(
str,
'.');
390 if (period && !isdigit(*(period + 1))) {
395 amt = dollars * 100 + cents;
397 ast_debug(1,
"Amount is %d (%d dollar%s, %d cent%s)\n", amt, dollars,
ESS(dollars), cents,
ESS(cents));
410 ast_str_append(&filenames, 0,
"&%s", (cents > 0) ?
"letters/dollar_" :
"letters/dollar");
429 ast_str_append(&filenames, 0,
"&%s", (cents == 1) ?
"cent" :
"cents");
430 }
else if (amt == 0) {
451 if (!strncasecmp(lang,
"en", 2)) {
455 ast_log(
LOG_WARNING,
"Language %s not currently supported, defaulting to US Dollars\n", lang);
463 return say_filenames(chan, ints, lang, audiofd, ctrlfd, filenames);
487 while (!res && (num || playh)) {
490 if ( num > INT_MIN ) {
498 }
else if (num < 20) {
499 snprintf(fn,
sizeof(fn),
"digits/%d", num);
501 }
else if (num < 100) {
502 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
506 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
520 snprintf(fn,
sizeof(fn),
"&digits/thousand");
522 if (num < 1000000000) {
568 if (!strncasecmp(lang,
"en", 2)) {
572 ast_log(
LOG_WARNING,
"Language %s not currently supported, defaulting to English\n", lang);
598 while (!res && (num || playh)) {
601 if ( num > INT_MIN ) {
607 ast_copy_string(fn, (num % 100 == 0) ?
"digits/h-hundred" :
"digits/hundred",
sizeof(fn));
609 }
else if (num < 20) {
611 snprintf(fn,
sizeof(fn),
"digits/h-%d", num);
616 }
else if (num < 100) {
617 int base = (num / 10) * 10;
619 snprintf(fn,
sizeof(fn),
"digits/%d", base);
621 snprintf(fn,
sizeof(fn),
"digits/h-%d", base);
626 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
640 snprintf(fn,
sizeof(fn), (num % 1000 == 0) ?
"&digits/h-thousand" :
"&digits/thousand");
642 if (num < 1000000000) {
651 ast_copy_string(fn, (num % 1000000 == 0) ?
"&digits/h-million" :
"&digits/million",
sizeof(fn));
662 ast_copy_string(fn, (num % 1000000000 == 0) ?
"&digits/h-billion" :
"&digits/billion",
sizeof(fn));
688 if (!strncasecmp(lang,
"en", 2)) {
692 ast_log(
LOG_WARNING,
"Language %s not currently supported, defaulting to English\n", lang);
877 if (!strncasecmp(
language,
"en_GB", 5)) {
879 }
else if (!strncasecmp(
language,
"en", 2)) {
881 }
else if (!strncasecmp(
language,
"cs", 2)) {
883 }
else if (!strncasecmp(
language,
"da", 2)) {
885 }
else if (!strncasecmp(
language,
"de", 2)) {
887 }
else if (!strncasecmp(
language,
"es", 2)) {
889 }
else if (!strncasecmp(
language,
"fr", 2)) {
891 }
else if (!strncasecmp(
language,
"gr", 2)) {
893 }
else if (!strncasecmp(
language,
"ja", 2)) {
895 }
else if (!strncasecmp(
language,
"he", 2)) {
897 }
else if (!strncasecmp(
language,
"hu", 2)) {
899 }
else if (!strncasecmp(
language,
"is", 2)) {
901 }
else if (!strncasecmp(
language,
"it", 2)) {
903 }
else if (!strncasecmp(
language,
"ka", 2)) {
905 }
else if (!strncasecmp(
language,
"nl", 2)) {
907 }
else if (!strncasecmp(
language,
"no", 2)) {
909 }
else if (!strncasecmp(
language,
"pl", 2)) {
911 }
else if (!strncasecmp(
language,
"pt", 2)) {
913 }
else if (!strncasecmp(
language,
"ru", 2)) {
915 }
else if (!strncasecmp(
language,
"se", 2)) {
917 }
else if (!strncasecmp(
language,
"th", 2)) {
919 }
else if (!strncasecmp(
language,
"zh", 2)) {
921 }
else if (!strncasecmp(
language,
"ur", 2)) {
923 }
else if (!strncasecmp(
language,
"vi", 2)) {
949 for (x=0;x<power;x++)
993 while (!res && (num || playh)) {
996 if ( num > INT_MIN ) {
1001 }
else if (num < 3 ) {
1002 snprintf(fn,
sizeof(fn),
"digits/%d%c", num,
options[0]);
1005 }
else if (num < 20) {
1006 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1009 }
else if (num < 100) {
1010 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
1012 }
else if (num < 1000) {
1013 hundred = num / 100;
1014 if ( hundred == 1 ) {
1016 }
else if ( hundred == 2 ) {
1022 if (hundred == 3 || hundred == 4) {
1024 }
else if ( hundred > 4 ) {
1028 num -= (hundred * 100);
1030 length = (int)log10(num)+1;
1031 while ( (length % 3 ) != 1 ) {
1048 snprintf(fn,
sizeof(fn),
"digits/5_E%d", length - 1);
1049 }
else if ( left >= 2 && left <= 4 ) {
1050 snprintf(fn,
sizeof(fn),
"digits/2-4_E%d", length - 1);
1052 snprintf(fn,
sizeof(fn),
"digits/1_E%d", length - 1);
1058 if ((audiofd > -1) && (ctrlfd > -1)) {
1086 while (!res && (num || playh || playa )) {
1099 if ( num > INT_MIN ) {
1110 }
else if (num == 1 && cn == -1) {
1113 }
else if (num < 20) {
1114 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1116 }
else if (num < 100) {
1117 int ones = num % 10;
1119 snprintf(fn,
sizeof(fn),
"digits/%d-and", ones);
1122 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1127 int hundreds = num / 100;
1131 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 100));
1134 num -= 100 * hundreds;
1139 if (num < 1000000) {
1146 if (num < 1000000000) {
1147 int millions = num / 1000000;
1155 num = num % 1000000;
1157 ast_debug(1,
"Number '%d' is too big for me\n", num);
1161 if (num && num < 100)
1167 if ((audiofd > -1) && (ctrlfd > -1))
1200 while (!res && num) {
1216 if ( num > INT_MIN ) {
1221 }
else if (num == 1 && mf == -1) {
1222 snprintf(fn,
sizeof(fn),
"digits/%dF", num);
1224 }
else if (num < 20) {
1225 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1227 }
else if (num < 100) {
1228 int ones = num % 10;
1230 snprintf(fn,
sizeof(fn),
"digits/%d-and", ones);
1233 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1236 }
else if (num == 100 && t == 0) {
1239 }
else if (num < 1000) {
1240 int hundreds = num / 100;
1242 if (hundreds == 1) {
1245 snprintf(fn,
sizeof(fn),
"digits/%d", hundreds);
1248 }
else if (num == 1000 && t == 0) {
1251 }
else if (num < 1000000) {
1252 int thousands = num / 1000;
1255 if (thousands == 1) {
1264 }
else if (num < 1000000000) {
1265 int millions = num / 1000000;
1266 num = num % 1000000;
1268 if (millions == 1) {
1277 }
else if (num <= INT_MAX) {
1278 int billions = num / 1000000000;
1279 num = num % 1000000000;
1281 if (billions == 1) {
1292 ast_debug(1,
"Number '%d' is too big for me\n", num);
1297 if ((audiofd > -1) && (ctrlfd > -1))
1305 if ((audiofd > -1) && (ctrlfd > -1))
1331 while (!res && (num || playh || playa )) {
1334 if ( num > INT_MIN ) {
1345 }
else if (num < 20) {
1346 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1348 }
else if (num < 100) {
1349 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
1351 }
else if (num < 1000) {
1352 int hundreds = num / 100;
1353 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 100));
1356 num -= 100 * hundreds;
1359 }
else if (num < 1000000) {
1365 if (num && num < 100)
1367 }
else if (num < 1000000000) {
1368 int millions = num / 1000000;
1374 if (num && num < 100)
1377 ast_debug(1,
"Number '%d' is too big for me\n", num);
1383 if ((audiofd > -1) && (ctrlfd > -1))
1411 if (!strncasecmp(
options,
"f", 1))
1413 else if (!strncasecmp(
options,
"m", 1))
1417 while (!res && num) {
1420 if ( num > INT_MIN ) {
1428 }
else if (num == 1) {
1430 snprintf(fn,
sizeof(fn),
"digits/%dF", num);
1432 snprintf(fn,
sizeof(fn),
"digits/%dM", num);
1434 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1436 }
else if (num < 31) {
1437 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1439 }
else if (num < 100) {
1440 snprintf(fn,
sizeof(fn),
"digits/%d", (num/10)*10);
1444 }
else if (num == 100) {
1447 }
else if (num < 200) {
1452 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100)*100);
1454 }
else if (num < 2000) {
1458 if (num < 1000000) {
1465 if (num < 2147483640) {
1466 if ((num/1000000) == 1) {
1479 ast_debug(1,
"Number '%d' is too big for me\n", num);
1488 if ((audiofd > -1) && (ctrlfd > -1))
1518 while (!res && (num || playh || playa)) {
1521 if ( num > INT_MIN ) {
1532 }
else if (num == 1) {
1534 snprintf(fn,
sizeof(fn),
"digits/%dF", num);
1536 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1538 }
else if (num < 21) {
1539 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1541 }
else if (num < 70) {
1542 snprintf(fn,
sizeof(fn),
"digits/%d", (num/10)*10);
1543 if ((num % 10) == 1) playa++;
1545 }
else if (num < 80) {
1547 if ((num % 10) == 1) playa++;
1549 }
else if (num < 100) {
1552 }
else if (num < 200) {
1555 }
else if (num < 1000) {
1556 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
1559 }
else if (num < 2000) {
1562 }
else if (num < 1000000) {
1568 }
else if (num < 1000000000) {
1573 num = num % 1000000;
1575 ast_debug(1,
"Number '%d' is too big for me\n", num);
1580 if ((audiofd > -1) && (ctrlfd > -1))
1596#define SAY_NUM_BUF_SIZE 256
1606 ast_verb(3,
"ast_say_digits_full: started. num: %d, options=\"%s\"\n", num,
options);
1614 ast_verb(3,
"ast_say_digits_full: num: %d, state=%d, options=\"%s\", mf=%d\n", num,
state,
options, mf);
1617 while (!res && (num || (
state > 0))) {
1625 ast_verb(3,
"ast_say_digits_full: num: %d, state=%d, options=\"%s\", mf=%d, tmpnum=%d\n", num,
state,
options, mf, tmpnum);
1629 }
else if (
state == 2) {
1630 if ((num >= 11) && (num < 21)) {
1632 snprintf(fn,
sizeof(fn),
"digits/ve");
1634 snprintf(fn,
sizeof(fn),
"digits/uu");
1639 snprintf(fn,
sizeof(fn),
"digits/ve");
1642 snprintf(fn,
sizeof(fn),
"digits/uu");
1646 snprintf(fn,
sizeof(fn),
"digits/ve");
1648 snprintf(fn,
sizeof(fn),
"digits/uu");
1652 snprintf(fn,
sizeof(fn),
"digits/ve");
1655 snprintf(fn,
sizeof(fn),
"digits/ve");
1658 snprintf(fn,
sizeof(fn),
"digits/ve");
1661 snprintf(fn,
sizeof(fn),
"digits/ve");
1664 snprintf(fn,
sizeof(fn),
"digits/uu");
1667 snprintf(fn,
sizeof(fn),
"digits/ve");
1670 snprintf(fn,
sizeof(fn),
"digits/ve");
1675 }
else if (
state == 3) {
1676 snprintf(fn,
sizeof(fn),
"digits/1k");
1678 }
else if (num < 0) {
1679 snprintf(fn,
sizeof(fn),
"digits/minus");
1681 }
else if (num < 20) {
1683 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1685 snprintf(fn,
sizeof(fn),
"digits/%dm", num);
1688 }
else if ((num < 100) && (num >= 20)) {
1689 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 10) * 10);
1694 }
else if ((num >= 100) && (num < 1000)) {
1696 snprintf(fn,
sizeof(fn),
"digits/%d00", tmpnum);
1697 num = num - (tmpnum * 100);
1698 if ((num > 0) && (num < 11)) {
1701 }
else if ((num >= 1000) && (num < 10000)) {
1702 tmpnum = num / 1000;
1703 snprintf(fn,
sizeof(fn),
"digits/%dk", tmpnum);
1704 num = num - (tmpnum * 1000);
1705 if ((num > 0) && (num < 11)) {
1708 }
else if (num < 20000) {
1709 snprintf(fn,
sizeof(fn),
"digits/%dm", (num / 1000));
1712 }
else if (num < 1000000) {
1717 snprintf(fn,
sizeof(fn),
"digits/1k");
1719 if ((num > 0) && (num < 11)) {
1722 }
else if (num < 2000000) {
1723 snprintf(fn,
sizeof(fn),
"digits/million");
1724 num = num % 1000000;
1725 if ((num > 0) && (num < 11)) {
1728 }
else if (num < 3000000) {
1729 snprintf(fn,
sizeof(fn),
"digits/twomillion");
1730 num = num - 2000000;
1731 if ((num > 0) && (num < 11)) {
1734 }
else if (num < 1000000000) {
1739 snprintf(fn,
sizeof(fn),
"digits/million");
1740 num = num % 1000000;
1741 if ((num > 0) && (num < 11)) {
1745 ast_debug(1,
"Number '%d' is too big for me\n", num);
1751 if ((audiofd > -1) && (ctrlfd > -1)) {
1783 while(!res && (num || playh)) {
1786 if ( num > INT_MIN ) {
1794 }
else if (num < 11 || num == 20) {
1795 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1797 }
else if (num < 20) {
1800 }
else if (num < 30) {
1803 }
else if (num < 100) {
1804 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
1808 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
1812 if (num < 1000000) {
1819 if (num < 1000000000) {
1826 ast_debug(1,
"Number '%d' is too big for me\n", num);
1834 if ((audiofd > -1) && (ctrlfd > -1))
1865 while (!res && (num || playh || playa )) {
1868 if ( num > INT_MIN ) {
1882 }
else if (num < 5 && cn == 2) {
1883 snprintf(fn,
sizeof(fn),
"digits/%dkvk", num);
1885 }
else if (num < 5 && cn == 3) {
1886 snprintf(fn,
sizeof(fn),
"digits/%dhk", num);
1888 }
else if (num < 20) {
1889 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1891 }
else if (num < 100) {
1892 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
1896 }
else if (num < 1000) {
1897 int hundreds = num / 100;
1900 snprintf(fn,
sizeof(fn),
"digits/%dhk", hundreds);
1902 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 100));
1905 num -= 100 * hundreds;
1906 if (num && num < 20)
1909 if (num && (num % 10) == 0)
1911 }
else if (num < 1000000) {
1914 if ((num % 100) == 0 && (num % 1000 != 0)) {
1921 if (num && (num < 20 || (num % 10 == 0)))
1923 }
else if (num < 1000000000) {
1924 int millions = num / 1000000;
1934 if (num && num < 100)
1936 }
else if (num < INT_MAX) {
1937 int milliards = num / 1000000000;
1947 if (num && num < 100)
1950 ast_debug(1,
"Number '%d' is too big for me\n", num);
1956 if ((audiofd > -1) && (ctrlfd > -1))
2003 while (!res && (num || playh)) {
2006 if ( num > INT_MIN ) {
2014 }
else if (num < 20) {
2015 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2017 }
else if (num == 21) {
2018 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2020 }
else if (num == 28) {
2021 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2023 }
else if (num == 31) {
2024 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2026 }
else if (num == 38) {
2027 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2029 }
else if (num == 41) {
2030 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2032 }
else if (num == 48) {
2033 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2035 }
else if (num == 51) {
2036 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2038 }
else if (num == 58) {
2039 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2041 }
else if (num == 61) {
2042 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2044 }
else if (num == 68) {
2045 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2047 }
else if (num == 71) {
2048 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2050 }
else if (num == 78) {
2051 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2053 }
else if (num == 81) {
2054 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2056 }
else if (num == 88) {
2057 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2059 }
else if (num == 91) {
2060 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2062 }
else if (num == 98) {
2063 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2065 }
else if (num < 100) {
2066 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
2070 if ((num / 100) > 1) {
2071 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
2078 if (num < 1000000) {
2085 if ((tempnum / 1000) < 2)
2090 if (num < 1000000000) {
2091 if ((num / 1000000) > 1)
2097 if ((tempnum / 1000000) < 2)
2102 ast_debug(1,
"Number '%d' is too big for me\n", num);
2110 if ((audiofd > -1) && (ctrlfd > -1))
2132 while (!res && (num || playh )) {
2135 if ( num > INT_MIN ) {
2143 }
else if (num < 20) {
2144 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2146 }
else if (num < 100) {
2155 snprintf(fn,
sizeof(fn),
"digits/%d", num - units);
2158 }
else if (num < 200) {
2162 }
else if (num < 1000) {
2163 snprintf(fn,
sizeof(fn),
"digits/%d", num / 100);
2171 }
else if (num < 10000) {
2178 if (num < 1000000) {
2185 if (num < 1000000000) {
2192 ast_debug(1,
"Number '%d' is too big for me\n", num);
2201 if ((audiofd > -1) && (ctrlfd > -1))
2235 while (!res && (num || playh || playa )) {
2238 if ( num > INT_MIN ) {
2249 }
else if (num == 1 && cn == -1) {
2252 }
else if (num < 20) {
2253 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2255 }
else if (num < 100) {
2256 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
2258 }
else if (num < 1000) {
2259 int hundreds = num / 100;
2263 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 100));
2266 num -= 100 * hundreds;
2269 }
else if (num < 1000000) {
2275 if (num && num < 100)
2277 }
else if (num < 1000000000) {
2278 int millions = num / 1000000;
2284 if (num && num < 100)
2287 ast_debug(1,
"Number '%d' is too big for me\n", num);
2293 if ((audiofd > -1) && (ctrlfd > -1))
2309 char *dziesiatki[10];
2320 return odm->
rzedy[rzad - 1][0];
2321 if ((i > 21 || i < 11) && i%10 > 1 && i%10 < 5)
2322 return odm->
rzedy[rzad - 1][1];
2324 return odm->
rzedy[rzad - 1][2];
2329 strcpy(buffer,
str);
2330 buffer += strlen(
str);
2336 char file_name[255] =
"digits/";
2337 strcat(file_name, fn);
2338 ast_debug(1,
"Trying to play: %s\n", file_name);
2340 if ((audiofd > -1) && (ctrlfd > -1))
2360 if (i == 0 && rzad > 0) {
2368 m1000E6 = i % 1000000000;
2369 i1000E6 = i / 1000000000;
2373 m1000E3 = m1000E6 % 1000000;
2374 i1000E3 = m1000E6 / 1000000;
2378 m1000 = m1000E3 % 1000;
2379 i1000 = m1000E3 / 1000;
2389 if (m100 > 0 && m100 <= 9) {
2394 }
else if (m100 % 10 == 0 && m100 != 0) {
2396 }
else if (m100 > 10 && m100 <= 19) {
2398 }
else if (m100 > 20) {
2511 char *zenski_cyfry[] = {
"0",
"1z",
"2z",
"3",
"4",
"5",
"6",
"7",
"8",
"9"};
2513 char *zenski_cyfry2[] = {
"0",
"1",
"2z",
"3",
"4",
"5",
"6",
"7",
"8",
"9"};
2515 char *meski_cyfry[] = {
"0",
"1",
"2-1m",
"3-1m",
"4-1m",
"5m",
"6m",
"7m",
"8m",
"9m"};
2517 char *meski_cyfry2[] = {
"0",
"1",
"2-2m",
"3-2m",
"4-2m",
"5m",
"6m",
"7m",
"8m",
"9m"};
2519 char *meski_setki[] = {
"",
"100m",
"200m",
"300m",
"400m",
"500m",
"600m",
"700m",
"800m",
"900m"};
2521 char *meski_dziesiatki[] = {
"",
"10m",
"20m",
"30m",
"40m",
"50m",
"60m",
"70m",
"80m",
"90m"};
2523 char *meski_nastki[] = {
"",
"11m",
"12m",
"13m",
"14m",
"15m",
"16m",
"17m",
"18m",
"19m"};
2525 char *nijaki_cyfry[] = {
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9"};
2527 char *nijaki_cyfry2[] = {
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9"};
2529 char *nijaki_setki[] = {
"",
"100",
"200",
"300",
"400",
"500",
"600",
"700",
"800",
"900"};
2531 char *nijaki_dziesiatki[] = {
"",
"10",
"20",
"30",
"40",
"50",
"60",
"70",
"80",
"90"};
2533 char *nijaki_nastki[] = {
"",
"11",
"12",
"13",
"14",
"15",
"16",
"17",
"18",
"19"};
2535 char *rzedy[][3] = { {
"1000",
"1000.2",
"1000.5"}, {
"1000000",
"1000000.2",
"1000000.5"}, {
"1000000000",
"1000000000.2",
"1000000000.5"}};
2544 if (odmiana_nieosobowa ==
NULL) {
2545 odmiana_nieosobowa =
ast_malloc(
sizeof(*odmiana_nieosobowa));
2549 memcpy(odmiana_nieosobowa->
cyfry, nijaki_cyfry,
sizeof(odmiana_nieosobowa->
cyfry));
2550 memcpy(odmiana_nieosobowa->
cyfry2, nijaki_cyfry2,
sizeof(odmiana_nieosobowa->
cyfry));
2551 memcpy(odmiana_nieosobowa->
setki, nijaki_setki,
sizeof(odmiana_nieosobowa->
setki));
2552 memcpy(odmiana_nieosobowa->
dziesiatki, nijaki_dziesiatki,
sizeof(odmiana_nieosobowa->
dziesiatki));
2553 memcpy(odmiana_nieosobowa->
nastki, nijaki_nastki,
sizeof(odmiana_nieosobowa->
nastki));
2554 memcpy(odmiana_nieosobowa->
rzedy, rzedy,
sizeof(odmiana_nieosobowa->
rzedy));
2557 if (odmiana_zenska ==
NULL) {
2558 odmiana_zenska =
ast_malloc(
sizeof(*odmiana_zenska));
2562 memcpy(odmiana_zenska->
cyfry, zenski_cyfry,
sizeof(odmiana_zenska->
cyfry));
2563 memcpy(odmiana_zenska->
cyfry2, zenski_cyfry2,
sizeof(odmiana_zenska->
cyfry));
2564 memcpy(odmiana_zenska->
setki, nijaki_setki,
sizeof(odmiana_zenska->
setki));
2566 memcpy(odmiana_zenska->
nastki, nijaki_nastki,
sizeof(odmiana_zenska->
nastki));
2567 memcpy(odmiana_zenska->
rzedy, rzedy,
sizeof(odmiana_zenska->
rzedy));
2570 if (odmiana_meska ==
NULL) {
2571 odmiana_meska =
ast_malloc(
sizeof(*odmiana_meska));
2575 memcpy(odmiana_meska->
cyfry, meski_cyfry,
sizeof(odmiana_meska->
cyfry));
2576 memcpy(odmiana_meska->
cyfry2, meski_cyfry2,
sizeof(odmiana_meska->
cyfry));
2577 memcpy(odmiana_meska->
setki, meski_setki,
sizeof(odmiana_meska->
setki));
2579 memcpy(odmiana_meska->
nastki, meski_nastki,
sizeof(odmiana_meska->
nastki));
2580 memcpy(odmiana_meska->
rzedy, rzedy,
sizeof(odmiana_meska->
rzedy));
2584 if (strncasecmp(
options,
"f", 1) == 0)
2586 else if (strncasecmp(
options,
"m", 1) == 0)
2589 o = odmiana_nieosobowa;
2591 o = odmiana_nieosobowa;
2618 while (!res && num ) {
2621 if ( num > INT_MIN ) {
2626 }
else if (num < 20) {
2627 if ((num == 1 || num == 2) && (mf < 0))
2628 snprintf(fn,
sizeof(fn),
"digits/%dF", num);
2630 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2632 }
else if (num < 100) {
2633 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 10) * 10);
2637 }
else if (num < 1000) {
2643 if (mf < 0 && num > 199)
2644 snprintf(fn,
sizeof(fn),
"digits/%dF", (num / 100) * 100);
2646 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 100) * 100);
2651 }
else if (num < 1000000) {
2658 if ((num % 1000) && ((num % 1000) < 100 || !(num % 100)))
2661 }
else if (num < 1000000000) {
2670 if ((num % 1000000) &&
2672 ((!((num / 1000) % 1000) && ((num % 1000) < 100 || !(num % 100))) ||
2674 (!(num % 1000) && (((num / 1000) % 1000) < 100 || !((num / 1000) % 100))) ) )
2676 num = num % 1000000;
2684 if ((audiofd > -1) && (ctrlfd > -1))
2691 if (!res && playh) {
2718 while (num || playh) {
2721 if ( num > INT_MIN ) {
2729 }
else if (start && num < 200 && num > 99 && cn == -1) {
2731 snprintf(fn,
sizeof(fn),
"digits/hundred");
2733 }
else if (num == 1 && cn == -1) {
2736 }
else if (num < 20) {
2737 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2739 }
else if (num < 100) {
2740 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
2742 }
else if (num < 1000) {
2744 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
2747 }
else if (num < 1000000) {
2755 }
else if (num < 1000000000) {
2764 ast_debug(1,
"Number '%d' is too big for me\n", num);
2769 if ((audiofd > -1) && (ctrlfd > -1)) {
2791 int last_length = 0;
2797 while (!res && (num || playh || playt || playz)) {
2800 if ( num > INT_MIN ) {
2806 snprintf(fn,
sizeof(fn),
"digits/0");
2813 snprintf(fn,
sizeof(fn),
"digits/thousand");
2815 }
else if (num < 10) {
2816 snprintf(
buf, 12,
"%d", num);
2817 if (last_length - strlen(
buf) > 1 && last_length != 0) {
2818 last_length = strlen(
buf);
2822 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2824 }
else if (num < 100) {
2825 snprintf(
buf, 10,
"%d", num);
2826 if (last_length - strlen(
buf) > 1 && last_length != 0) {
2827 last_length = strlen(
buf);
2831 last_length = strlen(
buf);
2832 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 10) * 10);
2836 snprintf(
buf, 10,
"%d", num);
2837 if (last_length - strlen(
buf) > 1 && last_length != 0) {
2838 last_length = strlen(
buf);
2842 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 100));
2844 snprintf(
buf, 10,
"%d", num);
2845 ast_debug(1,
"Number '%d' %d %d\n", num, (
int)strlen(
buf), last_length);
2846 last_length = strlen(
buf);
2847 num -= ((num / 100) * 100);
2848 }
else if (num < 10000){
2849 snprintf(
buf, 10,
"%d", num);
2850 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 1000));
2852 snprintf(
buf, 10,
"%d", num);
2853 ast_debug(1,
"Number '%d' %d %d\n", num, (
int)strlen(
buf), last_length);
2854 last_length = strlen(
buf);
2855 num -= ((num / 1000) * 1000);
2856 }
else if (num < 100000000) {
2860 snprintf(
buf, 10,
"%d", num);
2861 ast_debug(1,
"Number '%d' %d %d\n", num, (
int)strlen(
buf), last_length);
2862 num -= ((num / 10000) * 10000);
2863 last_length = strlen(
buf);
2864 snprintf(fn,
sizeof(fn),
"digits/wan");
2866 if (num < 1000000000) {
2870 snprintf(
buf, 10,
"%d", num);
2871 ast_debug(1,
"Number '%d' %d %d\n", num, (
int)strlen(
buf), last_length);
2872 last_length = strlen(
buf);
2873 num -= ((num / 100000000) * 100000000);
2874 snprintf(fn,
sizeof(fn),
"digits/yi");
2876 ast_debug(1,
"Number '%d' is too big for me\n", num);
2883 if ((audiofd > -1) && (ctrlfd > -1))
2908 while (!res && (num || playh)) {
2910 snprintf(fn,
sizeof(fn),
"digits/hundred");
2912 }
else if (num < 100) {
2913 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2915 }
else if (num < 1000) {
2916 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 100));
2918 num -= ((num / 100) * 100);
2919 }
else if (num < 100000) {
2924 snprintf(fn,
sizeof(fn),
"digits/thousand");
2925 }
else if (num < 10000000) {
2930 snprintf(fn,
sizeof(fn),
"digits/lac");
2931 }
else if (num < 1000000000) {
2935 num = num % 10000000;
2936 snprintf(fn,
sizeof(fn),
"digits/crore");
2938 ast_debug(1,
"Number '%d' is too big for me\n", num);
2944 if ((audiofd > -1) && (ctrlfd > -1)) {
2960 }
else if (num < 100) {
2962 }
else if (num < 1000) {
2992 while (!res && (num)) {
2995 if ( num > INT_MIN ) {
3000 }
else if (num < 20) {
3002 snprintf(fn,
sizeof(fn),
"digits/%d%s", num,
options);
3004 snprintf(fn,
sizeof(fn),
"digits/%d", num);
3007 }
else if (num < 100) {
3008 snprintf(fn,
sizeof(fn),
"digits/%d", num - (num % 10));
3010 }
else if (num < 1000){
3011 snprintf(fn,
sizeof(fn),
"digits/%d", num - (num % 100));
3013 }
else if (num < 1000000) {
3016 if (lastdigits < 3) {
3023 if (lastdigits == 1) {
3025 }
else if (lastdigits > 1 && lastdigits < 5) {
3031 }
else if (num < 1000000000) {
3037 if (lastdigits == 1) {
3039 }
else if (lastdigits > 1 && lastdigits < 5) {
3046 ast_debug(1,
"Number '%d' is too big for me\n", num);
3051 if ((audiofd > -1) && (ctrlfd > -1))
3071 while(!res && (num || playh)) {
3074 if ( num > INT_MIN ) {
3082 }
else if (num < 100) {
3083 if ((num <= 20) || ((num % 10) == 1)) {
3084 snprintf(fn,
sizeof(fn),
"digits/%d", num);
3087 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 10) * 10);
3090 }
else if (num < 1000) {
3091 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
3094 }
else if (num < 10000) {
3100 }
else if (num < 100000) {
3106 }
else if (num < 1000000) {
3121 if ((audiofd > -1) && (ctrlfd > -1))
3144 while (!res && (num || playh)) {
3147 if ( num > INT_MIN ) {
3153 snprintf(fn,
sizeof(fn),
"digits/%da", num);
3162 }
else if (playoh) {
3165 }
else if (playohz) {
3168 }
else if (num < 20) {
3169 snprintf(fn,
sizeof(fn),
"digits/%d", num);
3171 }
else if (num < 100) {
3172 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
3174 if ((num == 5) || (num == 4) || (num == 1)) playl++;
3177 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
3179 if (num && (num < 10)) {
3186 if (num < 1000000) {
3191 snprintf(fn,
sizeof(fn),
"digits/thousand");
3192 if (num && (num < 10)) {
3194 }
else if (num && (num < 100)){
3202 if (num < 1000000000) {
3216 if ((audiofd > -1) && (ctrlfd > -1))
3231 if (!strncasecmp(
language,
"en", 2)) {
3233 }
else if (!strncasecmp(
language,
"da", 2)) {
3235 }
else if (!strncasecmp(
language,
"de", 2)) {
3237 }
else if (!strncasecmp(
language,
"he", 2)) {
3239 }
else if (!strncasecmp(
language,
"is", 2)) {
3241 }
else if (!strncasecmp(
language,
"vi", 2)) {
3256 while (!res && num) {
3259 if ( num > INT_MIN ) {
3264 }
else if (num < 20) {
3265 snprintf(fn,
sizeof(fn),
"digits/h-%d", num);
3267 }
else if (num < 100) {
3268 int tens = num / 10;
3271 snprintf(fn,
sizeof(fn),
"digits/h-%d", (tens * 10));
3273 snprintf(fn,
sizeof(fn),
"digits/%d", (tens * 10));
3275 }
else if (num < 1000) {
3276 int hundreds = num / 100;
3278 if (hundreds > 1 || t == 1) {
3288 }
else if (num < 1000000) {
3289 int thousands = num / 1000;
3291 if (thousands > 1 || t == 1) {
3302 }
else if (num < 1000000000) {
3303 int millions = num / 1000000;
3304 num = num % 1000000;
3314 }
else if (num < INT_MAX) {
3315 int billions = num / 1000000000;
3316 num = num % 1000000000;
3326 }
else if (num == INT_MAX) {
3330 ast_debug(1,
"Number '%d' is too big for me\n", num);
3336 if ((audiofd > -1) && (ctrlfd > -1)) {
3355 if ((audiofd > -1) && (ctrlfd > -1)) {
3372 char fn[256] =
"", fna[256] =
"";
3386 while (!res && num) {
3389 if ( num > INT_MIN ) {
3394 }
else if (num < 100 && t) {
3397 }
else if (num < 20) {
3398 snprintf(fn,
sizeof(fn),
"digits/h-%d%s", num, gender);
3400 }
else if (num < 100) {
3401 int ones = num % 10;
3403 snprintf(fn,
sizeof(fn),
"digits/%d-and", ones);
3406 snprintf(fn,
sizeof(fn),
"digits/h-%d%s", num, gender);
3409 }
else if (num == 100 && t == 0) {
3410 snprintf(fn,
sizeof(fn),
"digits/h-hundred%s", gender);
3412 }
else if (num < 1000) {
3413 int hundreds = num / 100;
3415 if (hundreds == 1) {
3418 snprintf(fn,
sizeof(fn),
"digits/%d", hundreds);
3423 snprintf(fna,
sizeof(fna),
"digits/h-hundred%s", gender);
3426 }
else if (num < 1000000) {
3427 int thousands = num / 1000;
3429 if (thousands == 1) {
3436 snprintf(fna,
sizeof(fna),
"digits/h-thousand%s", gender);
3438 snprintf(fn,
sizeof(fn),
"digits/h-thousand%s", gender);
3449 snprintf(fn,
sizeof(fn),
"digits/h-thousand%s", gender);
3453 }
else if (num < 1000000000) {
3454 int millions = num / 1000000;
3455 num = num % 1000000;
3456 if (millions == 1) {
3462 snprintf(fna,
sizeof(fna),
"digits/h-million%s", gender);
3472 snprintf(fn,
sizeof(fn),
"digits/h-million%s", gender);
3476 }
else if (num < INT_MAX) {
3477 int billions = num / 1000000000;
3478 num = num % 1000000000;
3479 if (billions == 1) {
3485 snprintf(fna,
sizeof(fna),
"digits/h-milliard%s", gender);
3494 snprintf(fn,
sizeof(fna),
"digits/h-milliard%s", gender);
3498 }
else if (num == INT_MAX) {
3499 snprintf(fn,
sizeof(fn),
"digits/h-last%s", gender);
3502 ast_debug(1,
"Number '%d' is too big for me\n", num);
3508 if ((audiofd > -1) && (ctrlfd > -1))
3516 if ((audiofd > -1) && (ctrlfd > -1)) {
3535 char fn[256] =
"", fna[256] =
"";
3549 while (!res && num) {
3552 if ( num > INT_MIN ) {
3557 }
else if (num < 100 && t) {
3560 }
else if (num < 20) {
3561 snprintf(fn,
sizeof(fn),
"digits/h-%d%s", num, gender);
3563 }
else if (num < 100) {
3564 int ones = num % 10;
3566 snprintf(fn,
sizeof(fn),
"digits/%d-and", ones);
3569 snprintf(fn,
sizeof(fn),
"digits/h-%d%s", num, gender);
3572 }
else if (num == 100 && t == 0) {
3573 snprintf(fn,
sizeof(fn),
"digits/h-hundred%s", gender);
3575 }
else if (num < 1000) {
3576 int hundreds = num / 100;
3578 if (hundreds == 1) {
3581 snprintf(fn,
sizeof(fn),
"digits/%d", hundreds);
3586 snprintf(fna,
sizeof(fna),
"digits/h-hundred%s", gender);
3589 }
else if (num < 1000000) {
3590 int thousands = num / 1000;
3592 if (thousands == 1) {
3599 snprintf(fna,
sizeof(fna),
"digits/h-thousand%s", gender);
3601 snprintf(fn,
sizeof(fn),
"digits/h-thousand%s", gender);
3612 snprintf(fn,
sizeof(fn),
"digits/h-thousand%s", gender);
3616 }
else if (num < 1000000000) {
3617 int millions = num / 1000000;
3618 num = num % 1000000;
3619 if (millions == 1) {
3625 snprintf(fna,
sizeof(fna),
"digits/h-million%s", gender);
3635 snprintf(fn,
sizeof(fn),
"digits/h-million%s", gender);
3639 }
else if (num < INT_MAX) {
3640 int billions = num / 1000000000;
3641 num = num % 1000000000;
3642 if (billions == 1) {
3648 snprintf(fna,
sizeof(fna),
"digits/h-milliard%s", gender);
3657 snprintf(fn,
sizeof(fna),
"digits/h-milliard%s", gender);
3661 }
else if (num == INT_MAX) {
3662 snprintf(fn,
sizeof(fn),
"digits/h-last%s", gender);
3665 ast_debug(1,
"Number '%d' is too big for me\n", num);
3671 if ((audiofd > -1) && (ctrlfd > -1))
3679 if ((audiofd > -1) && (ctrlfd > -1)) {
3698 ast_verb(3,
"ast_say_digits_full: started. num: %d, options=\"%s\"\n", num,
options);
3704 ast_verb(3,
"ast_say_digits_full: num: %d, options=\"%s\", mf=%d\n", num,
options, mf);
3706 while (!res && num) {
3708 snprintf(fn,
sizeof(fn),
"digits/minus");
3709 if (num > INT_MIN) {
3714 }
else if (num < 21) {
3717 snprintf(fn,
sizeof(fn),
"digits/f-0%d", num);
3719 snprintf(fn,
sizeof(fn),
"digits/f-%d", num);
3723 snprintf(fn,
sizeof(fn),
"digits/m-0%d", num);
3725 snprintf(fn,
sizeof(fn),
"digits/m-%d", num);
3729 }
else if ((num < 100) && num >= 20) {
3730 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 10) * 10);
3732 }
else if ((num >= 100) && (num < 1000)) {
3733 int tmpnum = num / 100;
3734 snprintf(fn,
sizeof(fn),
"digits/%d00", tmpnum);
3735 num = num - (tmpnum * 100);
3736 }
else if ((num >= 1000) && (num < 10000)) {
3737 int tmpnum = num / 1000;
3738 snprintf(fn,
sizeof(fn),
"digits/%dk", tmpnum);
3739 num = num - (tmpnum * 1000);
3740 }
else if (num < 20000) {
3741 snprintf(fn,
sizeof(fn),
"digits/m-%d", (num / 1000));
3743 }
else if (num < 1000000) {
3748 snprintf(fn,
sizeof(fn),
"digits/1k");
3750 }
else if (num < 2000000) {
3751 snprintf(fn,
sizeof(fn),
"digits/1m");
3752 num = num % 1000000;
3753 }
else if (num < 3000000) {
3754 snprintf(fn,
sizeof(fn),
"digits/2m");
3755 num = num - 2000000;
3756 }
else if (num < 1000000000) {
3761 snprintf(fn,
sizeof(fn),
"digits/1m");
3762 num = num % 1000000;
3764 ast_debug(1,
"Number '%d' is too big for me\n", num);
3769 if ((audiofd > -1) && (ctrlfd > -1)) {
3786 char fn[256] =
"", fna[256] =
"";
3800 while (!res && num) {
3803 if ( num > INT_MIN ) {
3808 }
else if (num < 100 && t) {
3811 }
else if (num < 20) {
3812 snprintf(fn,
sizeof(fn),
"digits/h-%d%s", num, gender);
3814 }
else if (num < 100) {
3815 int ones = num % 10;
3817 int tens = num - ones;
3818 snprintf(fn,
sizeof(fn),
"digits/h-%d%s", tens, gender);
3823 snprintf(fn,
sizeof(fn),
"digits/and");
3827 snprintf(fn,
sizeof(fn),
"digits/h-%d%s", num, gender);
3831 }
else if (num == 100 && t == 0) {
3832 snprintf(fn,
sizeof(fn),
"digits/h-hundred%s", gender);
3834 }
else if (num < 1000) {
3835 int hundreds = num / 100;
3837 if (hundreds == 1) {
3840 snprintf(fn,
sizeof(fn),
"digits/%d", hundreds);
3845 snprintf(fna,
sizeof(fna),
"digits/h-hundred%s", gender);
3848 }
else if (num < 1000000) {
3849 int thousands = num / 1000;
3851 if (thousands == 1) {
3859 snprintf(fna,
sizeof(fna),
"digits/h-thousand%s", gender);
3861 snprintf(fn,
sizeof(fn),
"digits/h-thousand%s", gender);
3872 snprintf(fn,
sizeof(fn),
"digits/h-thousand%s", gender);
3877 }
else if (num < 1000000000) {
3878 int millions = num / 1000000;
3879 num = num % 1000000;
3880 if (millions == 1) {
3887 snprintf(fna,
sizeof(fna),
"digits/h-million%s", gender);
3897 snprintf(fn,
sizeof(fn),
"digits/h-million%s", gender);
3902 }
else if (num < INT_MAX) {
3903 int billions = num / 1000000000;
3904 num = num % 1000000000;
3905 if (billions == 1) {
3911 snprintf(fna,
sizeof(fna),
"digits/h-milliard%s", gender);
3920 snprintf(fn,
sizeof(fna),
"digits/h-milliard%s", gender);
3925 }
else if (num == INT_MAX) {
3926 snprintf(fn,
sizeof(fn),
"digits/h-last%s", gender);
3929 ast_debug(1,
"Number '%d' is too big for me\n", num);
3935 if ((audiofd > -1) && (ctrlfd > -1))
3943 if ((audiofd > -1) && (ctrlfd > -1)) {
3959 if (!strncasecmp(lang,
"en", 2)) {
3961 }
else if (!strncasecmp(lang,
"da", 2)) {
3963 }
else if (!strncasecmp(lang,
"de", 2)) {
3965 }
else if (!strncasecmp(lang,
"fr", 2)) {
3967 }
else if (!strncasecmp(lang,
"gr", 2)) {
3969 }
else if (!strncasecmp(lang,
"ja", 2)) {
3971 }
else if (!strncasecmp(lang,
"he", 2)) {
3973 }
else if (!strncasecmp(lang,
"hu", 2)) {
3975 }
else if (!strncasecmp(lang,
"is", 2)) {
3977 }
else if (!strncasecmp(lang,
"ka", 2)) {
3979 }
else if (!strncasecmp(lang,
"nl", 2)) {
3981 }
else if (!strncasecmp(lang,
"pt", 2)) {
3983 }
else if (!strncasecmp(lang,
"th", 2)) {
3995 struct timeval when = { t, 0 };
4000 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
4006 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
4023 struct timeval when = { t, 0 };
4029 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
4039 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
4055 snprintf(fn,
sizeof(fn),
"digits/%d", (year / 100));
4058 res =
wait_file(chan, ints,
"digits/hundred", lang);
4059 if (!res && year % 100 != 0) {
4072 struct timeval when = { t, 0 };
4078 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
4088 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
4105 snprintf(fn,
sizeof(fn),
"digits/%d", (year / 100) );
4108 res =
wait_file(chan, ints,
"digits/hundred", lang);
4109 if (!res && year % 100 != 0) {
4122 struct timeval when = { t, 0 };
4133 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
4143 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
4154 struct timeval when = { t, 0 };
4160 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
4170 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
4183 struct timeval when = { t, 0 };
4189 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
4197 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
4212 struct timeval when = { t, 0 };
4218 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
4232 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
4248 struct timeval when = { t, 0 };
4254 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
4260 res =
wait_file(chan, ints,
"digits/pt-de", lang);
4261 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
4265 res =
wait_file(chan, ints,
"digits/pt-de", lang);
4275 struct timeval when = { t, 0 };
4281 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
4288 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
4309 struct timeval when = { t, 0 };
4315 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
4325 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
4341 snprintf(fn,
sizeof(fn),
"digits/%d", (year / 100));
4344 res =
wait_file(chan, ints,
"digits/hundred", lang);
4345 if (!res && year % 100 != 0) {
4357 if (!strncasecmp(lang,
"en", 2)) {
4359 }
else if (!strncasecmp(lang,
"da", 2)) {
4361 }
else if (!strncasecmp(lang,
"de", 2)) {
4363 }
else if (!strncasecmp(lang,
"es", 2)) {
4365 }
else if (!strncasecmp(lang,
"he", 2)) {
4367 }
else if (!strncasecmp(lang,
"fr", 2)) {
4369 }
else if (!strncasecmp(lang,
"gr", 2)) {
4371 }
else if (!strncasecmp(lang,
"is", 2)) {
4373 }
else if (!strncasecmp(lang,
"ja", 2)) {
4375 }
else if (!strncasecmp(lang,
"it", 2)) {
4377 }
else if (!strncasecmp(lang,
"nl", 2)) {
4379 }
else if (!strncasecmp(lang,
"pl", 2)) {
4381 }
else if (!strncasecmp(lang,
"pt", 2)) {
4383 }
else if (!strncasecmp(lang,
"th", 2)) {
4385 }
else if (!strncasecmp(lang,
"zh", 2)) {
4387 }
else if (!strncasecmp(lang,
"vi", 2)) {
4398 struct timeval when = { t, 0 };
4400 int res=0, offset, sndoffset;
4401 char sndfile[256], nextmsg[256];
4404 format =
"ABdY 'digits/at' IMp";
4408 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
4409 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
4410 switch (format[offset]) {
4414 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
4415 sndfile[sndoffset] = format[offset];
4417 sndfile[sndoffset] =
'\0';
4418 res =
wait_file(chan, ints, sndfile, lang);
4423 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
4424 res =
wait_file(chan, ints, nextmsg, lang);
4430 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
4431 res =
wait_file(chan, ints, nextmsg, lang);
4450 res =
wait_file(chan, ints,
"digits/19", lang);
4454 res =
wait_file(chan, ints,
"digits/oh", lang);
4467 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
4469 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
4470 res =
wait_file(chan, ints, nextmsg, lang);
4475 if (format[offset] ==
'H') {
4478 res =
wait_file(chan, ints,
"digits/oh", lang);
4483 res =
wait_file(chan, ints,
"digits/oh", lang);
4490 res =
wait_file(chan, ints,
"digits/20", lang);
4494 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", remaining);
4495 res =
wait_file(chan, ints, nextmsg, lang);
4504 if (format[offset] ==
'M') {
4505 res =
wait_file(chan, ints,
"digits/oclock", lang);
4507 res =
wait_file(chan, ints,
"digits/hundred", lang);
4509 }
else if (tm.
tm_min < 10) {
4510 res =
wait_file(chan, ints,
"digits/oh", lang);
4512 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_min);
4513 res =
wait_file(chan, ints, nextmsg, lang);
4526 res =
wait_file(chan, ints, nextmsg, lang);
4538 gettimeofday(&now,
NULL);
4543 if (beg_today + 15768000 < t) {
4546 }
else if (beg_today + 2628000 < t) {
4549 }
else if (beg_today + 86400 * 6 < t) {
4552 }
else if (beg_today + 172800 < t) {
4555 }
else if (beg_today + 86400 < t) {
4557 res =
wait_file(chan, ints,
"digits/tomorrow", lang);
4558 }
else if (beg_today < t) {
4560 res =
wait_file(chan, ints,
"digits/today", lang);
4561 }
else if (beg_today - 86400 < t) {
4563 res =
wait_file(chan, ints,
"digits/yesterday", lang);
4564 }
else if (beg_today - 86400 * 6 < t) {
4567 }
else if (beg_today - 2628000 < t) {
4570 }
else if (beg_today - 15768000 < t) {
4594 if (beg_today + 15768000 < t) {
4597 }
else if (beg_today + 2628000 < t) {
4600 }
else if (beg_today + 86400 * 6 < t) {
4603 }
else if (beg_today + 172800 < t) {
4606 }
else if (beg_today + 86400 < t) {
4608 res =
wait_file(chan, ints,
"digits/tomorrow", lang);
4609 }
else if (beg_today < t) {
4611 res =
wait_file(chan, ints,
"digits/today", lang);
4612 }
else if (beg_today - 86400 < t) {
4614 res =
wait_file(chan, ints,
"digits/yesterday", lang);
4615 }
else if (beg_today - 86400 * 6 < t) {
4618 }
else if (beg_today - 2628000 < t) {
4621 }
else if (beg_today - 15768000 < t) {
4636 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
4637 res =
wait_file(chan, ints, nextmsg, lang);
4638 }
else if (tm.
tm_sec < 10) {
4639 res =
wait_file(chan, ints,
"digits/oh", lang);
4641 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
4642 res =
wait_file(chan, ints, nextmsg, lang);
4657 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
4676 struct timeval when = { t, 0 };
4678 int res=0, offset, sndoffset;
4679 char sndfile[256], nextmsg[256];
4682 format =
"A dBY HMS";
4686 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
4687 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
4688 switch (format[offset]) {
4692 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
4693 sndfile[sndoffset] = format[offset];
4695 sndfile[sndoffset] =
'\0';
4696 res =
wait_file(chan, ints, sndfile, lang);
4701 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
4702 res =
wait_file(chan, ints, nextmsg, lang);
4708 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
4709 res =
wait_file(chan, ints, nextmsg, lang);
4733 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", (year / 100) );
4734 res =
wait_file(chan, ints, nextmsg, lang);
4736 res =
wait_file(chan, ints,
"digits/hundred", lang);
4737 if (!res && year % 100 != 0) {
4748 res =
wait_file(chan, ints,
"digits/oclock", lang);
4752 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
4754 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
4756 res =
wait_file(chan, ints, nextmsg, lang);
4762 res =
wait_file(chan, ints,
"digits/0", lang);
4774 if (!res &&
next_item(&format[offset + 1]) ==
'S') {
4776 res =
wait_file(chan, ints,
"minute", lang);
4778 res =
wait_file(chan, ints,
"minutes", lang);
4789 res =
wait_file(chan, ints, nextmsg, lang);
4805 if (beg_today < t) {
4807 res =
wait_file(chan, ints,
"digits/today", lang);
4808 }
else if (beg_today - 86400 < t) {
4810 res =
wait_file(chan, ints,
"digits/yesterday", lang);
4830 if (beg_today < t) {
4832 }
else if ((beg_today - 86400) < t) {
4834 res =
wait_file(chan, ints,
"digits/yesterday", lang);
4835 }
else if (beg_today - 86400 * 6 < t) {
4848 res =
wait_file(chan, ints,
"digits/and", lang);
4852 res =
wait_file(chan, ints,
"seconds", lang);
4865 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
4878 struct timeval when = { t, 0 };
4880 int res=0, offset, sndoffset;
4881 char sndfile[256], nextmsg[256];
4884 format =
"A dBY HMS";
4888 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
4889 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
4890 switch (format[offset]) {
4894 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
4895 sndfile[sndoffset] = format[offset];
4897 sndfile[sndoffset] =
'\0';
4898 res =
wait_file(chan, ints, sndfile, lang);
4903 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
4904 res =
wait_file(chan, ints, nextmsg, lang);
4910 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
4911 res =
wait_file(chan, ints, nextmsg, lang);
4935 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", (year / 100) );
4936 res =
wait_file(chan, ints, nextmsg, lang);
4938 res =
wait_file(chan, ints,
"digits/hundred", lang);
4939 if (!res && year % 100 != 0) {
4955 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
4957 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
4958 res =
wait_file(chan, ints, nextmsg, lang);
4960 res =
wait_file(chan, ints,
"digits/oclock", lang);
4967 res =
wait_file(chan, ints,
"digits/1N", lang);
4972 res =
wait_file(chan, ints,
"digits/oclock", lang);
4977 if (
next_item(&format[offset + 1]) ==
'S') {
4979 }
else if (tm.
tm_min > 0) {
4983 if (!res &&
next_item(&format[offset + 1]) ==
'S') {
4985 res =
wait_file(chan, ints,
"minute", lang);
4987 res =
wait_file(chan, ints,
"minutes", lang);
4998 res =
wait_file(chan, ints, nextmsg, lang);
5014 if (beg_today < t) {
5016 res =
wait_file(chan, ints,
"digits/today", lang);
5017 }
else if (beg_today - 86400 < t) {
5019 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5039 if (beg_today < t) {
5041 }
else if ((beg_today - 86400) < t) {
5043 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5044 }
else if (beg_today - 86400 * 6 < t) {
5057 res =
wait_file(chan, ints,
"digits/and", lang);
5061 res =
wait_file(chan, ints, tm.
tm_sec == 1 ?
"second" :
"seconds", lang);
5074 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
5087 struct timeval when = { t, 0 };
5089 int res=0, offset, sndoffset;
5090 char sndfile[256], nextmsg[256];
5093 format =
"A dBY HMS";
5097 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
5098 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
5099 switch (format[offset]) {
5103 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
5104 sndfile[sndoffset] = format[offset];
5106 sndfile[sndoffset] =
'\0';
5107 res =
wait_file(chan, ints, sndfile, lang);
5112 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
5113 res =
wait_file(chan, ints, nextmsg, lang);
5119 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
5120 res =
wait_file(chan, ints, nextmsg, lang);
5144 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", (year / 100) );
5145 res =
wait_file(chan, ints, nextmsg, lang);
5147 res =
wait_file(chan, ints,
"digits/hundred", lang);
5148 if (!res && year % 100 != 0) {
5159 res =
wait_file(chan, ints,
"digits/oclock", lang);
5163 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
5165 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
5167 res =
wait_file(chan, ints, nextmsg, lang);
5173 res =
wait_file(chan, ints,
"digits/0", lang);
5184 res =
wait_file(chan, ints,
"digits/0", lang);
5186 if (
next_item(&format[offset + 1]) ==
'S')
5191 if (!res &&
next_item(&format[offset + 1]) ==
'S') {
5194 res =
wait_file(chan, ints,
"minute", lang);
5196 res =
wait_file(chan, ints,
"minutes", lang);
5207 res =
wait_file(chan, ints, nextmsg, lang);
5223 if (beg_today < t) {
5225 res =
wait_file(chan, ints,
"digits/today", lang);
5226 }
else if (beg_today - 86400 < t) {
5228 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5248 if (beg_today < t) {
5250 }
else if ((beg_today - 86400) < t) {
5252 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5253 }
else if (beg_today - 86400 * 6 < t) {
5266 res =
wait_file(chan, ints,
"digits/and", lang);
5270 if (!res && (tm.
tm_sec % 10 == 1) && (tm.
tm_sec != 11)) {
5271 res =
wait_file(chan, ints,
"second", lang);
5273 res =
wait_file(chan, ints,
"seconds", lang);
5286 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
5299 struct timeval when = { t, 0 };
5301 int res=0, offset, sndoffset;
5302 char sndfile[256], nextmsg[256];
5305 format =
"a 'digits/tee' e 'digits/duan' hY I 'digits/naliga' M 'digits/natee'";
5309 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
5310 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
5311 switch (format[offset]) {
5315 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
5316 sndfile[sndoffset] = format[offset];
5318 sndfile[sndoffset] =
'\0';
5319 res =
wait_file(chan, ints, sndfile, lang);
5324 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
5325 res =
wait_file(chan, ints, nextmsg, lang);
5331 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
5332 res =
wait_file(chan, ints, nextmsg, lang);
5352 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
5353 res =
wait_file(chan, ints, nextmsg, lang);
5360 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
5361 res =
wait_file(chan, ints, nextmsg, lang);
5384 if (beg_today < t) {
5386 res =
wait_file(chan, ints,
"digits/today", lang);
5387 }
else if (beg_today - 86400 < t) {
5389 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5390 }
else if (beg_today - 86400 * 6 < t) {
5393 }
else if (beg_today - 2628000 < t) {
5396 }
else if (beg_today - 15768000 < t) {
5419 if (beg_today < t) {
5421 }
else if ((beg_today - 86400) < t) {
5423 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5424 }
else if (beg_today - 86400 * 6 < t) {
5427 }
else if (beg_today - 2628000 < t) {
5430 }
else if (beg_today - 15768000 < t) {
5454 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
5484#define IL_DATE_STR "AdBY"
5485#define IL_TIME_STR "HM"
5486#define IL_DATE_STR_FULL IL_DATE_STR " 'digits/at' " IL_TIME_STR
5490 struct timeval when = { t, 0 };
5492 int res = 0, offset, sndoffset;
5493 char sndfile[256], nextmsg[256];
5501 for (offset = 0; format[offset] !=
'\0'; offset++) {
5502 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
5503 switch (format[offset]) {
5507 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
5508 sndfile[sndoffset] = format[offset];
5510 sndfile[sndoffset] =
'\0';
5511 res =
wait_file(chan, ints, sndfile, lang);
5516 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
5517 res =
wait_file(chan, ints, nextmsg, lang);
5523 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
5524 res =
wait_file(chan, ints, nextmsg, lang);
5567 char todo = format[offset];
5573 if (beg_today < t) {
5576 res =
wait_file(chan, ints,
"digits/today", lang);
5578 }
else if (beg_today - 86400 < t) {
5580 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5581 }
else if ((todo !=
'Q') && (beg_today - 86400 * 6 < t)) {
5594 ints, lang,
"f", -1, -1
5617 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
5631 struct timeval when = { t, 0 };
5633 int res=0, offset, sndoffset;
5634 char sndfile[256], nextmsg[256];
5637 format =
"'digits/es-el' Ad 'digits/es-de' B 'digits/es-de' Y 'digits/at' IMp";
5641 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
5642 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
5643 switch (format[offset]) {
5647 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
5648 sndfile[sndoffset] = format[offset];
5650 sndfile[sndoffset] =
'\0';
5651 snprintf(nextmsg,
sizeof(nextmsg),
"%s", sndfile);
5652 res =
wait_file(chan, ints, nextmsg, lang);
5657 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
5658 res =
wait_file(chan, ints, nextmsg, lang);
5664 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
5665 res =
wait_file(chan, ints, nextmsg, lang);
5669 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", tm.
tm_mon +1);
5670 res =
wait_file(chan, ints, nextmsg, lang);
5687 snprintf(nextmsg,
sizeof(nextmsg),
"digits/1F");
5689 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
5691 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
5692 res =
wait_file(chan, ints, nextmsg, lang);
5707 res =
wait_file(chan, ints,
"digits/p-m", lang);
5709 res =
wait_file(chan, ints,
"digits/afternoon", lang);
5711 res =
wait_file(chan, ints,
"digits/a-m", lang);
5727 if (beg_today < t) {
5729 res =
wait_file(chan, ints,
"digits/today", lang);
5730 }
else if (beg_today - 86400 < t) {
5732 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5752 if (beg_today < t) {
5754 res =
wait_file(chan, ints,
"digits/today", lang);
5755 }
else if ((beg_today - 86400) < t) {
5757 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5758 }
else if (beg_today - 86400 * 6 < t) {
5772 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
5773 res =
wait_file(chan, ints, nextmsg, lang);
5774 }
else if (tm.
tm_sec < 10) {
5775 res =
wait_file(chan, ints,
"digits/oh", lang);
5777 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
5778 res =
wait_file(chan, ints, nextmsg, lang);
5780 }
else if ((tm.
tm_sec < 21) || (tm.
tm_sec % 10 == 0)) {
5781 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
5782 res =
wait_file(chan, ints, nextmsg, lang);
5785 ten = (tm.
tm_sec / 10) * 10;
5787 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", ten);
5788 res =
wait_file(chan, ints, nextmsg, lang);
5792 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", one);
5793 res =
wait_file(chan, ints, nextmsg, lang);
5807 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
5822 struct timeval when = { t, 0 };
5824 int res=0, offset, sndoffset;
5825 char sndfile[256], nextmsg[256];
5828 format =
"AdBY 'digits/at' IMp";
5832 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
5833 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
5834 switch (format[offset]) {
5838 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
5839 sndfile[sndoffset] = format[offset];
5841 sndfile[sndoffset] =
'\0';
5842 res =
wait_file(chan, ints, sndfile, lang);
5847 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
5848 res =
wait_file(chan, ints, nextmsg, lang);
5854 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
5855 res =
wait_file(chan, ints, nextmsg, lang);
5859 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", tm.
tm_mon +1);
5860 res =
wait_file(chan, ints, nextmsg, lang);
5866 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", tm.
tm_mday);
5867 res =
wait_file(chan, ints, nextmsg, lang);
5875 res =
wait_file(chan, ints,
"digits/2", lang);
5877 res =
wait_file(chan, ints,
"digits/thousand", lang);
5889 res =
wait_file(chan, ints,
"digits/thousand", lang);
5891 wait_file(chan, ints,
"digits/9", lang);
5892 wait_file(chan, ints,
"digits/hundred", lang);
5904 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
5906 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
5907 res =
wait_file(chan, ints, nextmsg, lang);
5909 res =
wait_file(chan, ints,
"digits/oclock", lang);
5916 res =
wait_file(chan, ints,
"digits/oclock", lang);
5932 res =
wait_file(chan, ints, nextmsg, lang);
5948 if (beg_today < t) {
5950 res =
wait_file(chan, ints,
"digits/today", lang);
5951 }
else if (beg_today - 86400 < t) {
5953 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5973 if (beg_today < t) {
5975 }
else if ((beg_today - 86400) < t) {
5977 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5978 }
else if (beg_today - 86400 * 6 < t) {
5993 res =
wait_file(chan, ints,
"second", lang);
6005 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
6018 struct timeval when = { t, 0 };
6020 int res=0, offset, sndoffset;
6021 char sndfile[256], nextmsg[256];
6024 format =
"AdB 'digits/at' IMp";
6028 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
6029 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
6030 switch (format[offset]) {
6034 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
6035 sndfile[sndoffset] = format[offset];
6037 sndfile[sndoffset] =
'\0';
6038 res =
wait_file(chan, ints, sndfile, lang);
6043 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
6044 res =
wait_file(chan, ints, nextmsg, lang);
6050 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
6051 res =
wait_file(chan, ints, nextmsg, lang);
6055 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", tm.
tm_mon +1);
6056 res =
wait_file(chan, ints, nextmsg, lang);
6062 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", tm.
tm_mday);
6063 res =
wait_file(chan, ints, nextmsg, lang);
6073 res =
wait_file(chan, ints,
"digits/ore-2000", lang);
6077 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year - 100);
6078 res =
wait_file(chan, ints, nextmsg, lang);
6086 res =
wait_file(chan, ints,
"digits/ore-1900", lang);
6087 if ((!res) && (tm.
tm_year != 0)) {
6090 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year);
6091 res =
wait_file(chan, ints, nextmsg, lang);
6097 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", ten * 10);
6098 res =
wait_file(chan, ints, nextmsg, lang);
6101 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", one);
6102 res =
wait_file(chan, ints, nextmsg, lang);
6116 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
6118 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
6120 res =
wait_file(chan, ints, nextmsg, lang);
6126 res =
wait_file(chan, ints,
"digits/ore-mezzanotte", lang);
6128 res =
wait_file(chan, ints,
"digits/ore-una", lang);
6145 res =
wait_file(chan, ints, nextmsg, lang);
6161 if (beg_today < t) {
6163 res =
wait_file(chan, ints,
"digits/today", lang);
6164 }
else if (beg_today - 86400 < t) {
6166 res =
wait_file(chan, ints,
"digits/yesterday", lang);
6183 if (beg_today < t) {
6185 }
else if ((beg_today - 86400) < t) {
6187 res =
wait_file(chan, ints,
"digits/yesterday", lang);
6188 }
else if (beg_today - 86400 * 6 < t) {
6202 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
6203 res =
wait_file(chan, ints, nextmsg, lang);
6204 }
else if (tm.
tm_sec < 10) {
6205 res =
wait_file(chan, ints,
"digits/oh", lang);
6207 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
6208 res =
wait_file(chan, ints, nextmsg, lang);
6210 }
else if ((tm.
tm_sec < 21) || (tm.
tm_sec % 10 == 0)) {
6211 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
6212 res =
wait_file(chan, ints, nextmsg, lang);
6215 ten = (tm.
tm_sec / 10) * 10;
6217 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", ten);
6218 res =
wait_file(chan, ints, nextmsg, lang);
6222 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", one);
6223 res =
wait_file(chan, ints, nextmsg, lang);
6237 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
6250 struct timeval when = { t, 0 };
6252 int res=0, offset, sndoffset;
6253 char sndfile[256], nextmsg[256];
6256 format =
"AdBY 'digits/at' IMp";
6260 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
6261 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
6262 switch (format[offset]) {
6266 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
6267 sndfile[sndoffset] = format[offset];
6269 sndfile[sndoffset] =
'\0';
6270 res =
wait_file(chan, ints, sndfile, lang);
6275 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
6276 res =
wait_file(chan, ints, nextmsg, lang);
6282 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
6283 res =
wait_file(chan, ints, nextmsg, lang);
6287 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", tm.
tm_mon +1);
6288 res =
wait_file(chan, ints, nextmsg, lang);
6298 res =
wait_file(chan, ints,
"digits/2", lang);
6300 res =
wait_file(chan, ints,
"digits/thousand", lang);
6312 res =
wait_file(chan, ints,
"digits/19", lang);
6316 res =
wait_file(chan, ints,
"digits/oh", lang);
6318 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year);
6319 res =
wait_file(chan, ints, nextmsg, lang);
6321 }
else if (tm.
tm_year <= 20) {
6323 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year);
6324 res =
wait_file(chan, ints, nextmsg, lang);
6330 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", ten * 10);
6331 res =
wait_file(chan, ints, nextmsg, lang);
6334 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", one);
6335 res =
wait_file(chan, ints, nextmsg, lang);
6349 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
6351 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
6352 res =
wait_file(chan, ints, nextmsg, lang);
6359 res =
wait_file(chan, ints,
"digits/nl-uur", lang);
6373 res =
wait_file(chan, ints, nextmsg, lang);
6389 if (beg_today < t) {
6391 res =
wait_file(chan, ints,
"digits/today", lang);
6392 }
else if (beg_today - 86400 < t) {
6394 res =
wait_file(chan, ints,
"digits/yesterday", lang);
6411 if (beg_today < t) {
6413 }
else if ((beg_today - 86400) < t) {
6415 res =
wait_file(chan, ints,
"digits/yesterday", lang);
6416 }
else if (beg_today - 86400 * 6 < t) {
6440 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
6453 struct timeval when = { thetime, 0 };
6455 int res=0, offset, sndoffset;
6456 char sndfile[256], nextmsg[256];
6460 for (offset = 0 ; format[offset] !=
'\0' ; offset++) {
6462 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
6463 switch (format[offset]) {
6467 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
6468 sndfile[sndoffset] = format[offset];
6470 sndfile[sndoffset] =
'\0';
6471 res =
wait_file(chan, ints, sndfile, lang);
6476 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
6477 res =
wait_file(chan, ints, nextmsg, lang);
6483 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
6484 res =
wait_file(chan, ints, nextmsg, lang);
6495 res =
wait_file(chan, ints,
"digits/h-30", lang);
6499 res =
wait_file(chan, ints,
"digits/h-20", lang);
6503 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", remaining);
6504 res =
wait_file(chan, ints, nextmsg, lang);
6510 res =
wait_file(chan, ints,
"digits/2", lang);
6512 res =
wait_file(chan, ints,
"digits/1000.2", lang);
6517 }
else if (tm.
tm_year == 100) {
6518 res =
wait_file(chan, ints,
"digits/h-2000", lang);
6525 res =
wait_file(chan, ints,
"digits/1000", lang);
6527 wait_file(chan, ints,
"digits/900", lang);
6533 wait_file(chan, ints,
"digits/year", lang);
6541 snprintf(nextmsg,
sizeof(nextmsg),
"digits/t-%d", tm.
tm_hour - 12);
6543 snprintf(nextmsg,
sizeof(nextmsg),
"digits/t-%d", tm.
tm_hour);
6545 res =
wait_file(chan, ints, nextmsg, lang);
6551 snprintf(nextmsg,
sizeof(nextmsg),
"digits/t-%d", tm.
tm_hour);
6552 res =
wait_file(chan, ints, nextmsg, lang);
6554 res =
wait_file(chan, ints,
"digits/t-24", lang);
6560 if (format[offset] ==
'M') {
6561 res =
wait_file(chan, ints,
"digits/oclock", lang);
6563 res =
wait_file(chan, ints,
"digits/100", lang);
6575 res =
wait_file(chan, ints, nextmsg, lang);
6588 if (beg_today < thetime) {
6590 res =
wait_file(chan, ints,
"digits/today", lang);
6591 }
else if (beg_today - 86400 < thetime) {
6593 res =
wait_file(chan, ints,
"digits/yesterday", lang);
6610 if (beg_today < thetime) {
6612 }
else if ((beg_today - 86400) < thetime) {
6614 res =
wait_file(chan, ints,
"digits/yesterday", lang);
6615 }
else if (beg_today - 86400 * 6 < thetime) {
6628 res =
wait_file(chan, ints,
"digits/and", lang);
6631 res =
wait_file(chan, ints,
"digits/1z", lang);
6633 res =
wait_file(chan, ints,
"digits/second-a", lang);
6641 if (one > 1 && one < 5 && ten != 1)
6642 res =
wait_file(chan, ints,
"seconds", lang);
6644 res =
wait_file(chan, ints,
"second", lang);
6658 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
6670 struct timeval when = { t, 0 };
6672 int res=0, offset, sndoffset;
6673 char sndfile[256], nextmsg[256];
6676 format =
"Ad 'digits/pt-de' B 'digits/pt-de' Y I 'digits/pt-e' Mp";
6680 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
6681 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
6682 switch (format[offset]) {
6686 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
6687 sndfile[sndoffset] = format[offset];
6689 sndfile[sndoffset] =
'\0';
6690 snprintf(nextmsg,
sizeof(nextmsg),
"%s", sndfile);
6691 res =
wait_file(chan, ints, nextmsg, lang);
6696 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
6697 res =
wait_file(chan, ints, nextmsg, lang);
6703 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
6704 res =
wait_file(chan, ints, nextmsg, lang);
6708 if (!strcasecmp(lang,
"pt_BR")) {
6711 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", tm.
tm_mon +1);
6712 res =
wait_file(chan, ints, nextmsg, lang);
6727 if (!strcasecmp(lang,
"pt_BR")) {
6729 if (format[offset] ==
'I')
6730 res =
wait_file(chan, ints,
"digits/pt-a", lang);
6732 res =
wait_file(chan, ints,
"digits/pt-meianoite", lang);
6733 }
else if (tm.
tm_hour == 12) {
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);
6739 if (format[offset] ==
'I') {
6741 res =
wait_file(chan, ints,
"digits/pt-as", lang);
6743 res =
wait_file(chan, ints,
"digits/pt-a", lang);
6750 if (format[offset] ==
'I')
6751 res =
wait_file(chan, ints,
"digits/pt-ah", lang);
6753 res =
wait_file(chan, ints,
"digits/pt-meianoite", lang);
6756 if (format[offset] ==
'I')
6757 res =
wait_file(chan, ints,
"digits/pt-ao", lang);
6759 res =
wait_file(chan, ints,
"digits/pt-meiodia", lang);
6762 if (format[offset] ==
'I') {
6763 res =
wait_file(chan, ints,
"digits/pt-ah", lang);
6766 res =
wait_file(chan, ints,
"digits/pt-sss", lang);
6776 if (!strcasecmp(lang,
"pt_BR")) {
6778 if ((!res) && (format[offset] ==
'H')) {
6780 res =
wait_file(chan, ints,
"digits/hours", lang);
6782 res =
wait_file(chan, ints,
"digits/hour", lang);
6791 res =
wait_file(chan, ints,
"digits/20", lang);
6795 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", remaining);
6796 res =
wait_file(chan, ints, nextmsg, lang);
6804 if (!strcasecmp(lang,
"pt_BR")) {
6808 res =
wait_file(chan, ints,
"minutes", lang);
6810 res =
wait_file(chan, ints,
"minute", lang);
6815 res =
wait_file(chan, ints,
"digits/pt-hora", lang);
6818 res =
wait_file(chan, ints,
"digits/pt-sss", lang);
6827 if (!strcasecmp(lang,
"pt_BR")) {
6829 res =
wait_file(chan, ints,
"digits/pt-da", lang);
6832 res =
wait_file(chan, ints,
"digits/morning", lang);
6834 res =
wait_file(chan, ints,
"digits/afternoon", lang);
6835 else res =
wait_file(chan, ints,
"digits/night", lang);
6840 res =
wait_file(chan, ints,
"digits/p-m", lang);
6842 res =
wait_file(chan, ints,
"digits/a-m", lang);
6859 if (beg_today < t) {
6861 res =
wait_file(chan, ints,
"digits/today", lang);
6862 }
else if (beg_today - 86400 < t) {
6864 res =
wait_file(chan, ints,
"digits/yesterday", lang);
6884 if (beg_today < t) {
6886 }
else if ((beg_today - 86400) < t) {
6888 res =
wait_file(chan, ints,
"digits/yesterday", lang);
6889 }
else if (beg_today - 86400 * 6 < t) {
6902 if (!strcasecmp(lang,
"pt_BR")) {
6906 res =
wait_file(chan, ints,
"seconds", lang);
6908 res =
wait_file(chan, ints,
"second", lang);
6913 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
6914 res =
wait_file(chan, ints, nextmsg, lang);
6915 }
else if (tm.
tm_sec < 10) {
6916 res =
wait_file(chan, ints,
"digits/oh", lang);
6918 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
6919 res =
wait_file(chan, ints, nextmsg, lang);
6921 }
else if ((tm.
tm_sec < 21) || (tm.
tm_sec % 10 == 0)) {
6922 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
6923 res =
wait_file(chan, ints, nextmsg, lang);
6926 ten = (tm.
tm_sec / 10) * 10;
6928 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", ten);
6929 res =
wait_file(chan, ints, nextmsg, lang);
6933 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", one);
6934 res =
wait_file(chan, ints, nextmsg, lang);
6949 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
6962 struct timeval when = { t, 0 };
6964 int res=0, offset, sndoffset;
6965 char sndfile[256], nextmsg[256];
6972 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
6973 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
6974 switch (format[offset]) {
6978 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
6979 sndfile[sndoffset] = format[offset];
6981 sndfile[sndoffset] =
'\0';
6982 res =
wait_file(chan, ints, sndfile, lang);
6987 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
6988 res =
wait_file(chan, ints, nextmsg, lang);
6995 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
6996 res =
wait_file(chan, ints, nextmsg, lang);
7002 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_mday);
7003 res =
wait_file(chan, ints, nextmsg, lang);
7005 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_mday - (tm.
tm_mday % 10));
7006 res =
wait_file(chan, ints, nextmsg, lang);
7008 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_mday % 10);
7009 res =
wait_file(chan, ints, nextmsg, lang);
7012 if (!res) res =
wait_file(chan, ints,
"digits/day", lang);
7017 res =
wait_file(chan, ints,
"digits/2", lang);
7019 res =
wait_file(chan, ints,
"digits/thousand", lang);
7023 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", (tm.
tm_year - 100) / 10);
7024 res =
wait_file(chan, ints, nextmsg, lang);
7026 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", (tm.
tm_year - 100) % 10);
7027 res =
wait_file(chan, ints, nextmsg, lang);
7032 res =
wait_file(chan, ints,
"digits/year", lang);
7039 res =
wait_file(chan, ints,
"digits/1", lang);
7041 res =
wait_file(chan, ints,
"digits/9", lang);
7046 res =
wait_file(chan, ints,
"digits/0", lang);
7048 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year);
7049 res =
wait_file(chan, ints, nextmsg, lang);
7053 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year / 10);
7054 res =
wait_file(chan, ints, nextmsg, lang);
7056 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year % 10);
7057 res =
wait_file(chan, ints, nextmsg, lang);
7063 res =
wait_file(chan, ints,
"digits/year", lang);
7073 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
7075 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
7076 res =
wait_file(chan, ints, nextmsg, lang);
7078 res =
wait_file(chan, ints,
"digits/oclock", lang);
7083 res =
wait_file(chan, ints,
"digits/0", lang);
7091 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
7092 res =
wait_file(chan, ints, nextmsg, lang);
7094 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - (tm.
tm_hour % 10));
7095 res =
wait_file(chan, ints, nextmsg, lang);
7097 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour % 10);
7098 res =
wait_file(chan, ints, nextmsg, lang);
7102 res =
wait_file(chan, ints,
"digits/oclock", lang);
7109 res =
wait_file(chan, ints,
"digits/0", lang);
7111 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_min);
7112 res =
wait_file(chan, ints, nextmsg, lang);
7114 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_min - (tm.
tm_min % 10));
7115 res =
wait_file(chan, ints, nextmsg, lang);
7117 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_min % 10);
7118 res =
wait_file(chan, ints, nextmsg, lang);
7122 res =
wait_file(chan, ints,
"minute", lang);
7132 res =
wait_file(chan, ints, nextmsg, lang);
7148 if (beg_today < t) {
7150 res =
wait_file(chan, ints,
"digits/today", lang);
7151 }
else if (beg_today - 86400 < t) {
7153 res =
wait_file(chan, ints,
"digits/yesterday", lang);
7173 if (beg_today < t) {
7175 }
else if ((beg_today - 86400) < t) {
7177 res =
wait_file(chan, ints,
"digits/yesterday", lang);
7178 }
else if (beg_today - 86400 * 6 < t) {
7193 res =
wait_file(chan, ints,
"digits/0", lang);
7195 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
7196 res =
wait_file(chan, ints, nextmsg, lang);
7198 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec - (tm.
tm_sec % 10));
7199 res =
wait_file(chan, ints, nextmsg, lang);
7201 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec % 10);
7202 res =
wait_file(chan, ints, nextmsg, lang);
7206 res =
wait_file(chan, ints,
"second", lang);
7218 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
7230 if (!strncasecmp(lang,
"en", 2)) {
7232 }
else if (!strncasecmp(lang,
"de", 2)) {
7234 }
else if (!strncasecmp(lang,
"fr", 2)) {
7236 }
else if (!strncasecmp(lang,
"gr", 2)) {
7238 }
else if (!strncasecmp(lang,
"ja", 2)) {
7240 }
else if (!strncasecmp(lang,
"he", 2)) {
7242 }
else if (!strncasecmp(lang,
"hu", 2)) {
7244 }
else if (!strncasecmp(lang,
"ka", 2)) {
7246 }
else if (!strncasecmp(lang,
"nl", 2)) {
7248 }
else if (!strncasecmp(lang,
"pt_BR", 5)) {
7250 }
else if (!strncasecmp(lang,
"pt", 2)) {
7252 }
else if (!strncasecmp(lang,
"th", 2)) {
7254 }
else if (!strncasecmp(lang,
"zh", 2)) {
7265 struct timeval when = { t, 0 };
7274 else if (hour == 12)
7276 else if (hour > 12) {
7314 struct timeval when = { t, 0 };
7334 struct timeval when = { t, 0 };
7357 struct timeval when = { t, 0 };
7381 struct timeval when = { t, 0 };
7401 struct timeval when = { t, 0 };
7412 res =
wait_file(chan, ints,
"digits/pt-e", lang);
7417 res =
wait_file(chan, ints,
"digits/pt-hora", lang);
7420 res =
wait_file(chan, ints,
"digits/pt-sss", lang);
7430 struct timeval when = { t, 0 };
7439 res =
wait_file(chan, ints,
"digits/hours", lang);
7441 res =
wait_file(chan, ints,
"digits/hour", lang);
7443 if ((!res) && (tm.
tm_min)) {
7444 res =
wait_file(chan, ints,
"digits/pt-e", lang);
7449 res =
wait_file(chan, ints,
"minutes", lang);
7451 res =
wait_file(chan, ints,
"minute", lang);
7460 struct timeval when = { t, 0 };
7478 struct timeval when = { t, 0 };
7487 else if (hour == 12)
7489 else if (hour > 12) {
7520 struct timeval when = { t, 0 };
7556 if (!strncasecmp(lang,
"en", 2)) {
7558 }
else if (!strncasecmp(lang,
"de", 2)) {
7560 }
else if (!strncasecmp(lang,
"fr", 2)) {
7562 }
else if (!strncasecmp(lang,
"gr", 2)) {
7564 }
else if (!strncasecmp(lang,
"ja", 2)) {
7566 }
else if (!strncasecmp(lang,
"he", 2)) {
7568 }
else if (!strncasecmp(lang,
"hu", 2)) {
7570 }
else if (!strncasecmp(lang,
"ka", 2)) {
7572 }
else if (!strncasecmp(lang,
"nl", 2)) {
7574 }
else if (!strncasecmp(lang,
"pt_BR", 5)) {
7576 }
else if (!strncasecmp(lang,
"pt", 2)) {
7578 }
else if (!strncasecmp(lang,
"th", 2)) {
7580 }
else if (!strncasecmp(lang,
"zh", 2)) {
7591 struct timeval when = { t, 0 };
7599 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
7605 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
7616 else if (hour == 12)
7618 else if (hour > 12) {
7658 struct timeval when = { t, 0 };
7673 struct timeval when = { t, 0 };
7687 struct timeval when = { t, 0 };
7698 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
7704 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
7728 struct timeval when = { t, 0 };
7747 struct timeval when = { t, 0 };
7755 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
7761 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
7772 else if (hour == 12)
7774 else if (hour > 12) {
7814 struct timeval when = { t, 0 };
7828 struct timeval when = { t, 0 };
7835 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
7841 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
7871 struct timeval when = { t, 0 };
7881 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
7889 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
7898 else if (hour == 12)
7900 else if (hour > 12) {
7931 struct timeval when = { t, 0 };
7939 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
7946 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
7996 if (!strncasecmp(lang,
"en", 2)) {
7998 }
else if (!strncasecmp(lang,
"fr", 2)) {
8000 }
else if (!strncasecmp(lang,
"he", 2)) {
8002 }
else if (!strncasecmp(lang,
"ka", 2)) {
8004 }
else if (!strncasecmp(lang,
"pt", 2)) {
8016 struct timeval nowtv =
ast_tvnow(), when = { t, 0 };
8025 if ((daydiff < 0) || (daydiff > 6)) {
8028 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
8036 }
else if (daydiff) {
8039 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
8054 struct timeval nowtv =
ast_tvnow(), when = { t, 0 };
8063 if ((daydiff < 0) || (daydiff > 6)) {
8066 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
8074 }
else if (daydiff) {
8077 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
8095 struct timeval nowtv =
ast_tvnow(), when = { t, 0 };
8101 if ((daydiff < 0) || (daydiff > 6)) {
8106 res =
wait_file(chan, ints,
"digits/pt-de", lang);
8107 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
8111 }
else if (daydiff) {
8113 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
8117 if (!strcasecmp(lang,
"pt_BR")) {
8131 res =
wait_file(chan, ints,
"digits/pt-sss", lang);
8142 struct timeval nowt =
ast_tvnow(), when = { t, 0 };
8151 if ((daydiff < 0) || (daydiff > 6)) {
8154 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
8162 }
else if (daydiff) {
8165 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
8191 snprintf(fn,
sizeof(fn),
"digits/female-%d", num);
8193 }
else if (num < 13) {
8195 }
else if (num <100 ) {
8196 tmp = (num/10) * 10;
8198 snprintf(fn,
sizeof(fn),
"digits/%d",
tmp);
8242 while (!res && num ) {
8245 snprintf(fn,
sizeof(fn),
"digits/%d", num);
8247 }
else if (num <= 100) {
8249 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
8251 }
else if (num < 200) {
8253 snprintf(fn,
sizeof(fn),
"digits/hundred-100");
8255 }
else if (num < 1000) {
8257 snprintf(fn,
sizeof(fn),
"digits/hundred-%d", (num/100)*100);
8259 }
else if (num < 2000){
8260 snprintf(fn,
sizeof(fn),
"digits/xilia");
8264 if (num < 1000000) {
8269 snprintf(fn,
sizeof(fn),
"digits/thousands");
8271 if (num < 1000000000) {
8276 snprintf(fn,
sizeof(fn),
"digits/millions");
8278 ast_debug(1,
"Number '%d' is too big for me\n", num);
8285 if ((audiofd > -1) && (ctrlfd > -1))
8306 while (!res && (num || playh)) {
8309 if ( num > INT_MIN ) {
8317 }
else if (num < 20) {
8318 snprintf(fn,
sizeof(fn),
"digits/%d", num);
8320 }
else if (num < 100) {
8321 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
8325 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
8329 if (num < 1000000) {
8334 snprintf(fn,
sizeof(fn),
"digits/thousand");
8336 if (num < 1000000000) {
8343 ast_debug(1,
"Number '%d' is too big for me\n", num);
8351 if ((audiofd > -1) && (ctrlfd > -1))
8375 struct timeval when = { t, 0 };
8384 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
8395 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
8411 struct timeval tv = { t, 0 };
8424 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
8434 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
8455 struct timeval when = { t, 0 };
8465 else if (hour == 12)
8467 else if (hour > 12) {
8502 struct timeval tv = { t, 0 };
8512 else if (hour == 12)
8514 else if (hour > 12) {
8526 if (hour == 9 || hour == 21) {
8549 struct timeval when = { t, 0 };
8558 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
8569 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
8582 struct timeval tv = { t, 0 };
8595 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
8605 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
8614 else if (hour == 12)
8616 else if (hour > 12) {
8627 if (hour == 9 || hour == 21) {
8649 struct timeval when = { t, 0 };
8651 int res=0, offset, sndoffset;
8652 char sndfile[256], nextmsg[256];
8655 format =
"AdBY 'digits/at' IMp";
8659 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
8660 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
8661 switch (format[offset]) {
8665 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
8666 sndfile[sndoffset] = format[offset];
8668 sndfile[sndoffset] =
'\0';
8669 res =
wait_file(chan, ints, sndfile, lang);
8674 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
8675 res =
wait_file(chan, ints, nextmsg, lang);
8681 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
8682 res =
wait_file(chan, ints, nextmsg, lang);
8732 res =
wait_file(chan, ints, nextmsg, lang);
8748 if (beg_today < t) {
8750 res =
wait_file(chan, ints,
"digits/today", lang);
8751 }
else if (beg_today - 86400 < t) {
8753 res =
wait_file(chan, ints,
"digits/yesterday", lang);
8773 if (beg_today < t) {
8775 }
else if ((beg_today - 86400) < t) {
8777 res =
wait_file(chan, ints,
"digits/yesterday", lang);
8778 }
else if (beg_today - 86400 * 6 < t) {
8792 res =
wait_file(chan, ints, nextmsg, lang);
8797 res =
wait_file(chan, ints, nextmsg, lang);
8808 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
8821 struct timeval tv = { time, 0 };
8823 int res = 0, offset, sndoffset;
8824 char sndfile[256], nextmsg[256];
8827 format =
"YbdAPIMS";
8831 for (offset = 0; format[offset] !=
'\0'; offset++) {
8832 ast_log(
LOG_DEBUG,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
8833 switch (format[offset]) {
8837 for (sndoffset = 0; (format[++offset] !=
'\'') && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
8838 sndfile[sndoffset] = format[offset];
8840 sndfile[sndoffset] =
'\0';
8841 res =
wait_file(chan,ints,sndfile,lang);
8846 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
8847 res =
wait_file(chan,ints,nextmsg,lang);
8853 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
8854 res =
wait_file(chan,ints,nextmsg,lang);
8860 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d_2", tm.
tm_mday);
8861 res =
wait_file(chan,ints,nextmsg,lang);
8864 res =
wait_file(chan,ints,
"digits/20",lang);
8866 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_mday - 20);
8867 res =
wait_file(chan,ints,nextmsg,lang);
8869 res =
wait_file(chan,ints,
"digits/nichi",lang);
8870 }
else if (tm.
tm_mday == 30) {
8872 res =
wait_file(chan,ints,
"digits/h-30_2",lang);
8875 res =
wait_file(chan,ints,
"digits/30",lang);
8876 res =
wait_file(chan,ints,
"digits/1",lang);
8877 res =
wait_file(chan,ints,
"digits/nichi",lang);
8883 res =
wait_file(chan,ints,
"digits/2",lang);
8885 res =
wait_file(chan,ints,
"digits/thousand",lang);
8890 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year - 100);
8891 res =
wait_file(chan,ints,nextmsg,lang);
8899 res =
wait_file(chan,ints,
"digits/19",lang);
8903 res =
wait_file(chan,ints,
"digits/oh",lang);
8905 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year);
8906 res =
wait_file(chan,ints,nextmsg,lang);
8908 }
else if (tm.
tm_year <= 20) {
8910 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year);
8911 res =
wait_file(chan,ints,nextmsg,lang);
8917 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", ten * 10);
8918 res =
wait_file(chan,ints,nextmsg,lang);
8921 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", one);
8922 res =
wait_file(chan,ints,nextmsg,lang);
8929 res =
wait_file(chan,ints,
"digits/nen",lang);
8935 snprintf(nextmsg,
sizeof(nextmsg),
"digits/p-m");
8937 snprintf(nextmsg,
sizeof(nextmsg),
"digits/a-m");
8938 res =
wait_file(chan,ints,nextmsg,lang);
8944 snprintf(nextmsg,
sizeof(nextmsg),
"digits/12");
8946 snprintf(nextmsg,
sizeof(nextmsg),
"digits/9_2");
8948 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
8950 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
8951 res =
wait_file(chan,ints,nextmsg,lang);
8952 if(!res) res =
wait_file(chan,ints,
"digits/ji",lang);
8960 res =
wait_file(chan,ints,
"digits/20",lang);
8964 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", remainder);
8965 res =
wait_file(chan,ints,nextmsg,lang);
8969 res =
wait_file(chan,ints,
"digits/ji",lang);
8974 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_min);
8975 res =
wait_file(chan,ints,nextmsg,lang);
8978 ten = (tm.
tm_min / 10) * 10;
8980 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", ten);
8981 res =
wait_file(chan,ints,nextmsg,lang);
8985 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", one);
8986 res =
wait_file(chan,ints,nextmsg,lang);
8990 res =
wait_file(chan,ints,
"digits/fun",lang);
8999 gettimeofday(&now,
NULL);
9004 if (beg_today < time) {
9006 res =
wait_file(chan,ints,
"digits/today",lang);
9007 }
else if (beg_today - 86400 < time) {
9009 res =
wait_file(chan,ints,
"digits/yesterday",lang);
9022 gettimeofday(&now,
NULL);
9027 if (beg_today < time) {
9029 }
else if ((beg_today - 86400) < time) {
9031 res =
wait_file(chan,ints,
"digits/yesterday",lang);
9032 }
else if (beg_today - 86400 * 6 < time) {
9046 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
9047 res =
wait_file(chan,ints,nextmsg,lang);
9048 }
else if ((tm.
tm_sec < 21) || (tm.
tm_sec % 10 == 0)) {
9049 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
9050 res =
wait_file(chan,ints,nextmsg,lang);
9053 ten = (tm.
tm_sec / 10) * 10;
9055 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", ten);
9056 res =
wait_file(chan,ints,nextmsg,lang);
9060 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", one);
9061 res =
wait_file(chan,ints,nextmsg,lang);
9065 res =
wait_file(chan,ints,
"digits/byou",lang);
9076 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
9089 struct timeval when = { t, 0 };
9091 int res = 0, offset, sndoffset;
9092 char sndfile[256], nextmsg[256];
9095 format =
"A 'digits/day' eB 'digits/year' Y 'digits/at' k 'hours' M 'minutes' p";
9099 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
9100 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
9101 switch (format[offset]) {
9105 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
9106 sndfile[sndoffset] = format[offset];
9108 sndfile[sndoffset] =
'\0';
9109 res =
wait_file(chan, ints, sndfile, lang);
9114 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
9115 res =
wait_file(chan, ints, nextmsg, lang);
9121 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
9122 res =
wait_file(chan, ints, nextmsg, lang);
9141 res =
wait_file(chan, ints,
"digits/19", lang);
9145 res =
wait_file(chan, ints,
"digits/odd", lang);
9158 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
9160 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
9161 res =
wait_file(chan, ints, nextmsg, lang);
9166 if (format[offset] ==
'H') {
9169 res =
wait_file(chan, ints,
"digits/0", lang);
9174 res =
wait_file(chan, ints,
"digits/0", lang);
9181 res =
wait_file(chan, ints,
"digits/20", lang);
9185 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", remaining);
9186 res =
wait_file(chan, ints, nextmsg, lang);
9203 res =
wait_file(chan, ints, nextmsg, lang);
9215 gettimeofday(&now,
NULL);
9220 if (beg_today < t) {
9222 res =
wait_file(chan, ints,
"digits/today", lang);
9223 }
else if (beg_today - 86400 < t) {
9225 res =
wait_file(chan, ints,
"digits/yesterday", lang);
9226 }
else if (beg_today - 86400 * 6 < t) {
9229 }
else if (beg_today - 2628000 < t) {
9232 }
else if (beg_today - 15768000 < t) {
9256 if (beg_today < t) {
9258 }
else if ((beg_today - 86400) < t) {
9260 res =
wait_file(chan, ints,
"digits/yesterday", lang);
9261 }
else if (beg_today - 86400 * 6 < t) {
9264 }
else if (beg_today - 2628000 < t) {
9267 }
else if (beg_today - 15768000 < t) {
9292 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
9331 strncat(res,
"minus ", res_len - strlen(res) - 1);
9332 if ( num > INT_MIN ) {
9341 if (num <= 20 || num == 40 || num == 60 || num == 80 || num == 100) {
9342 snprintf(
buf,
sizeof(
buf),
"%d", num);
9343 strncat(res,
buf, res_len - strlen(res) - 1);
9349 strncat(res,
"20_ ", res_len - strlen(res) - 1);
9354 strncat(res,
"40_ ", res_len - strlen(res) - 1);
9359 strncat(res,
"60_ ", res_len - strlen(res) - 1);
9364 strncat(res,
"80_ ", res_len - strlen(res) - 1);
9370 remaining = num % 100;
9371 digit = (num - remaining) / 100;
9373 if (remaining == 0) {
9374 snprintf(
buf,
sizeof(
buf),
"%d", num);
9375 strncat(res,
buf, res_len - strlen(res) - 1);
9379 strncat(res,
buf, res_len - strlen(res) - 1);
9386 strncat(res,
"1000", res_len - strlen(res) - 1);
9391 if (num < 1000000) {
9392 remaining = num % 1000;
9393 digit = (num - remaining) / 1000;
9395 if (remaining == 0) {
9397 strncat(res,
" 1000", res_len - strlen(res) - 1);
9402 strncat(res,
"1000_ ", res_len - strlen(res) - 1);
9407 strncat(res,
" 1000_ ", res_len - strlen(res) - 1);
9412 if (num == 1000000) {
9413 strncat(res,
"1 1000000", res_len - strlen(res) - 1);
9418 if (num < 1000000000) {
9419 remaining = num % 1000000;
9420 digit = (num - remaining) / 1000000;
9422 if (remaining == 0) {
9424 strncat(res,
" 1000000", res_len - strlen(res) - 1);
9429 strncat(res,
" 1000000_ ", res_len - strlen(res) - 1);
9434 if (num == 1000000000) {
9435 strncat(res,
"1 1000000000", res_len - strlen(res) - 1);
9440 if (num > 1000000000) {
9441 remaining = num % 1000000000;
9442 digit = (num - remaining) / 1000000000;
9444 if (remaining == 0) {
9446 strncat(res,
" 1000000000", res_len - strlen(res) - 1);
9451 strncat(res,
" 1000000000_ ", res_len - strlen(res) - 1);
9467 const char* remaining = fn;
9478 while (res == 0 && (s = strstr(remaining,
" "))) {
9479 size_t len = s - remaining;
9482 sprintf(new_string,
"digits/");
9483 strncat(new_string, remaining,
len);
9487 if ((audiofd > -1) && (ctrlfd > -1)) {
9498 while (*remaining ==
' ') {
9505 if (res == 0 && *remaining) {
9507 char* new_string =
ast_malloc(strlen(remaining) + 1 + strlen(
"digits/"));
9508 sprintf(new_string,
"digits/%s", remaining);
9511 if ((audiofd > -1) && (ctrlfd > -1)) {
9542 struct timeval when = { t, 0 };
9553 snprintf(fn,
sizeof(fn),
"digits/tslis %d", tm.
tm_wday);
9568 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
9585 struct timeval when = { t, 0 };
9619 struct timeval when = { t, 0 };
9642 struct timeval when = { t, 0 }, nowt =
ast_tvnow();
9648 if ((daydiff < 0) || (daydiff > 6)) {
9654 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
9661 }
else if (daydiff) {
9664 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
9691 if (num == 1 || num == -1) {
9720 if (num > 0 && num < 5) {
9741 temp =
ast_alloca((temp_len = (strlen(noun) + strlen(ending) + 1)));
9742 snprintf(temp, temp_len,
"%s%s", noun, ending);
9763 return gender ? gender :
"";
9783 temp =
ast_alloca((temp_len = (strlen(adjective) + strlen(ending) + 1)));
9784 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)
Standard Command Line Interface.
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.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
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().