42 #include <netinet/in.h>
48 #include <iso/limits_iso.h>
60 static int wait_file(
struct ast_channel *chan,
const char *ints,
const char *file,
const char *lang);
66 char fnbuf[10], asciibuf[20] =
"letters/ascii";
71 while (str[num] && !res) {
81 fn =
"letters/exclaimation-point";
87 fn =
"letters/dollar";
96 fn =
"letters/equals";
102 fn =
"letters/slash";
105 fn =
"letters/space";
117 snprintf(fnbuf,
sizeof(fnbuf),
"digits/X%s", ((!strncasecmp(lang,
"es", 2) && (str[num] ==
'1')) ?
"M" :
""));
123 if (
'A' <= ltr && ltr <=
'Z') ltr +=
'a' -
'A';
124 strcpy(fnbuf,
"letters/X");
129 (snprintf(asciibuf + 13,
sizeof(asciibuf) - 13,
"%d", str[num]) > 0 &&
ast_fileexists(asciibuf, NULL, lang) > 0 && (fn = asciibuf))) {
132 if ((audiofd > -1) && (ctrlfd > -1))
153 while (str[num] && !res) {
163 fn =
"letters/exclaimation-point";
169 fn =
"letters/dollar";
178 fn =
"letters/equals";
184 fn =
"letters/slash";
187 fn =
"letters/space";
198 snprintf(fnbuf,
sizeof(fnbuf),
"digits/X%s", ((!strncasecmp(lang,
"es", 2) && (str[num] ==
'1')) ?
"M" :
""));
204 if (
'A' <= ltr && ltr <=
'Z') ltr +=
'a' -
'A';
205 strcpy(fnbuf,
"phonetic/X_p");
212 if ((audiofd > -1) && (ctrlfd > -1))
232 while (str[num] && !res) {
254 snprintf(fnbuf,
sizeof(fnbuf),
"digits/X%s", ((!strncasecmp(lang,
"es", 2) && (str[num] ==
'1')) ?
"M" :
""));
262 if ((audiofd > -1) && (ctrlfd > -1))
442 if (!strncasecmp(language,
"en_GB", 5)) {
444 }
else if (!strncasecmp(language,
"en", 2)) {
446 }
else if (!strncasecmp(language,
"cs", 2)) {
448 }
else if (!strncasecmp(language,
"cz", 2)) {
449 static int deprecation_warning = 0;
450 if (deprecation_warning++ % 10 == 0) {
451 ast_log(
LOG_WARNING,
"cz is not a standard language code. Please switch to using cs instead.\n");
454 }
else if (!strncasecmp(language,
"da", 2)) {
456 }
else if (!strncasecmp(language,
"de", 2)) {
458 }
else if (!strncasecmp(language,
"es", 2)) {
460 }
else if (!strncasecmp(language,
"fr", 2)) {
462 }
else if (!strncasecmp(language,
"ge", 2)) {
463 static int deprecation_warning = 0;
464 if (deprecation_warning++ % 10 == 0) {
465 ast_log(
LOG_WARNING,
"ge is not a standard language code. Please switch to using ka instead.\n");
468 }
else if (!strncasecmp(language,
"gr", 2)) {
470 }
else if (!strncasecmp(language,
"he", 2)) {
472 }
else if (!strncasecmp(language,
"hu", 2)) {
474 }
else if (!strncasecmp(language,
"it", 2)) {
476 }
else if (!strncasecmp(language,
"ka", 2)) {
478 }
else if (!strncasecmp(language,
"mx", 2)) {
479 static int deprecation_warning = 0;
480 if (deprecation_warning++ % 10 == 0) {
481 ast_log(
LOG_WARNING,
"mx is not a standard language code. Please switch to using es_MX instead.\n");
484 }
else if (!strncasecmp(language,
"nl", 2)) {
486 }
else if (!strncasecmp(language,
"no", 2)) {
488 }
else if (!strncasecmp(language,
"pl", 2)) {
490 }
else if (!strncasecmp(language,
"pt", 2)) {
492 }
else if (!strncasecmp(language,
"ru", 2)) {
494 }
else if (!strncasecmp(language,
"se", 2)) {
496 }
else if (!strncasecmp(language,
"th", 2)) {
498 }
else if (!strncasecmp(language,
"tw", 2)) {
499 static int deprecation_warning = 0;
500 if (deprecation_warning++ % 10 == 0) {
501 ast_log(
LOG_WARNING,
"tw is a standard language code for Twi, not Taiwanese. Please switch to using zh_TW instead.\n");
504 }
else if (!strncasecmp(language,
"zh", 2)) {
506 }
else if (!strncasecmp(language,
"ur", 2)) {
508 }
else if (!strncasecmp(language,
"vi", 2)) {
526 while (!res && (num || playh)) {
529 if ( num > INT_MIN ) {
537 }
else if (num < 20) {
538 snprintf(fn,
sizeof(fn),
"digits/%d", num);
540 }
else if (num < 100) {
541 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
545 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
554 snprintf(fn,
sizeof(fn),
"digits/thousand");
556 if (num < 1000000000) {
563 ast_debug(1,
"Number '%d' is too big for me\n", num);
571 if ((audiofd > -1) && (ctrlfd > -1))
585 for (x=0;x<power;x++)
628 while (!res && (num || playh)) {
631 if ( num > INT_MIN ) {
636 }
else if (num < 3 ) {
637 snprintf(fn,
sizeof(fn),
"digits/%d%c", num, options[0]);
640 }
else if (num < 20) {
641 snprintf(fn,
sizeof(fn),
"digits/%d", num);
644 }
else if (num < 100) {
645 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
647 }
else if (num < 1000) {
648 hundered = num / 100;
649 if ( hundered == 1 ) {
651 }
else if ( hundered == 2 ) {
657 if (hundered == 3 || hundered == 4) {
659 }
else if ( hundered > 4 ) {
663 num -= (hundered * 100);
665 length = (int)log10(num)+1;
666 while ( (length % 3 ) != 1 ) {
672 case 9: options =
"w";
674 default : options =
"m";
683 snprintf(fn,
sizeof(fn),
"digits/5_E%d", length - 1);
684 }
else if ( left >= 2 && left <= 4 ) {
685 snprintf(fn,
sizeof(fn),
"digits/2-4_E%d", length - 1);
687 snprintf(fn,
sizeof(fn),
"digits/1_E%d", length - 1);
693 if ((audiofd > -1) && (ctrlfd > -1)) {
719 if (options && !strncasecmp(options,
"n", 1)) cn = -1;
721 while (!res && (num || playh || playa )) {
734 if ( num > INT_MIN ) {
745 }
else if (num == 1 && cn == -1) {
748 }
else if (num < 20) {
749 snprintf(fn,
sizeof(fn),
"digits/%d", num);
751 }
else if (num < 100) {
754 snprintf(fn,
sizeof(fn),
"digits/%d-and", ones);
757 snprintf(fn,
sizeof(fn),
"digits/%d", num);
762 int hundreds = num / 100;
766 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 100));
769 num -= 100 * hundreds;
781 if (num < 1000000000) {
782 int millions = num / 1000000;
792 ast_debug(1,
"Number '%d' is too big for me\n", num);
796 if (num && num < 100)
802 if ((audiofd > -1) && (ctrlfd > -1))
831 if (options && (!strncasecmp(options,
"f", 1)))
834 while (!res && num) {
850 if ( num > INT_MIN ) {
855 }
else if (num == 1 && mf == -1) {
856 snprintf(fn,
sizeof(fn),
"digits/%dF", num);
858 }
else if (num < 20) {
859 snprintf(fn,
sizeof(fn),
"digits/%d", num);
861 }
else if (num < 100) {
864 snprintf(fn,
sizeof(fn),
"digits/%d-and", ones);
867 snprintf(fn,
sizeof(fn),
"digits/%d", num);
870 }
else if (num == 100 && t == 0) {
873 }
else if (num < 1000) {
874 int hundreds = num / 100;
879 snprintf(fn,
sizeof(fn),
"digits/%d", hundreds);
882 }
else if (num == 1000 && t == 0) {
885 }
else if (num < 1000000) {
886 int thousands = num / 1000;
889 if (thousands == 1) {
898 }
else if (num < 1000000000) {
899 int millions = num / 1000000;
911 }
else if (num <= INT_MAX) {
912 int billions = num / 1000000000;
913 num = num % 1000000000;
926 ast_debug(1,
"Number '%d' is too big for me\n", num);
931 if ((audiofd > -1) && (ctrlfd > -1))
939 if ((audiofd > -1) && (ctrlfd > -1))
965 while (!res && (num || playh || playa )) {
968 if ( num > INT_MIN ) {
979 }
else if (num < 20) {
980 snprintf(fn,
sizeof(fn),
"digits/%d", num);
982 }
else if (num < 100) {
983 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
985 }
else if (num < 1000) {
986 int hundreds = num / 100;
987 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 100));
990 num -= 100 * hundreds;
993 }
else if (num < 1000000) {
999 if (num && num < 100)
1001 }
else if (num < 1000000000) {
1002 int millions = num / 1000000;
1008 if (num && num < 100)
1011 ast_debug(1,
"Number '%d' is too big for me\n", num);
1017 if ((audiofd > -1) && (ctrlfd > -1))
1044 if (!strncasecmp(options,
"f", 1))
1046 else if (!strncasecmp(options,
"m", 1))
1050 while (!res && num) {
1053 if ( num > INT_MIN ) {
1061 }
else if (num == 1) {
1063 snprintf(fn,
sizeof(fn),
"digits/%dF", num);
1065 snprintf(fn,
sizeof(fn),
"digits/%dM", num);
1067 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1069 }
else if (num < 31) {
1070 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1072 }
else if (num < 100) {
1073 snprintf(fn,
sizeof(fn),
"digits/%d", (num/10)*10);
1077 }
else if (num == 100) {
1080 }
else if (num < 200) {
1085 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100)*100);
1087 }
else if (num < 2000) {
1091 if (num < 1000000) {
1098 if (num < 2147483640) {
1099 if ((num/1000000) == 1) {
1112 ast_debug(1,
"Number '%d' is too big for me\n", num);
1121 if ((audiofd > -1) && (ctrlfd > -1))
1148 if (options && !strncasecmp(options,
"f", 1))
1151 while (!res && (num || playh || playa)) {
1154 if ( num > INT_MIN ) {
1165 }
else if (num == 1) {
1167 snprintf(fn,
sizeof(fn),
"digits/%dF", num);
1169 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1171 }
else if (num < 21) {
1172 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1174 }
else if (num < 70) {
1175 snprintf(fn,
sizeof(fn),
"digits/%d", (num/10)*10);
1176 if ((num % 10) == 1) playa++;
1178 }
else if (num < 80) {
1180 if ((num % 10) == 1) playa++;
1182 }
else if (num < 100) {
1185 }
else if (num < 200) {
1188 }
else if (num < 1000) {
1189 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
1192 }
else if (num < 2000) {
1195 }
else if (num < 1000000) {
1201 }
else if (num < 1000000000) {
1206 num = num % 1000000;
1208 ast_debug(1,
"Number '%d' is too big for me\n", num);
1213 if ((audiofd > -1) && (ctrlfd > -1))
1229 #define SAY_NUM_BUF_SIZE 256
1244 if (options && !strncasecmp(options,
"m", 1)) {
1250 while (!res && (num || (state > 0))) {
1258 ast_verbose(
VERBOSE_PREFIX_3 "ast_say_digits_full: num: %d, state=%d, options=\"%s\", mf=%d, tmpnum=%d\n", num, state, options, mf, tmpnum);
1262 }
else if (state == 2) {
1263 if ((num >= 11) && (num < 21)) {
1265 snprintf(fn,
sizeof(fn),
"digits/ve");
1267 snprintf(fn,
sizeof(fn),
"digits/uu");
1272 snprintf(fn,
sizeof(fn),
"digits/ve");
1275 snprintf(fn,
sizeof(fn),
"digits/uu");
1279 snprintf(fn,
sizeof(fn),
"digits/ve");
1281 snprintf(fn,
sizeof(fn),
"digits/uu");
1285 snprintf(fn,
sizeof(fn),
"digits/ve");
1288 snprintf(fn,
sizeof(fn),
"digits/ve");
1291 snprintf(fn,
sizeof(fn),
"digits/ve");
1294 snprintf(fn,
sizeof(fn),
"digits/ve");
1297 snprintf(fn,
sizeof(fn),
"digits/uu");
1300 snprintf(fn,
sizeof(fn),
"digits/ve");
1303 snprintf(fn,
sizeof(fn),
"digits/ve");
1308 }
else if (state == 3) {
1309 snprintf(fn,
sizeof(fn),
"digits/1k");
1311 }
else if (num < 0) {
1312 snprintf(fn,
sizeof(fn),
"digits/minus");
1314 }
else if (num < 20) {
1316 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1318 snprintf(fn,
sizeof(fn),
"digits/%dm", num);
1321 }
else if ((num < 100) && (num >= 20)) {
1322 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 10) * 10);
1327 }
else if ((num >= 100) && (num < 1000)) {
1329 snprintf(fn,
sizeof(fn),
"digits/%d00", tmpnum);
1330 num = num - (tmpnum * 100);
1331 if ((num > 0) && (num < 11)) {
1334 }
else if ((num >= 1000) && (num < 10000)) {
1335 tmpnum = num / 1000;
1336 snprintf(fn,
sizeof(fn),
"digits/%dk", tmpnum);
1337 num = num - (tmpnum * 1000);
1338 if ((num > 0) && (num < 11)) {
1341 }
else if (num < 20000) {
1342 snprintf(fn,
sizeof(fn),
"digits/%dm", (num / 1000));
1345 }
else if (num < 1000000) {
1350 snprintf(fn,
sizeof(fn),
"digits/1k");
1352 if ((num > 0) && (num < 11)) {
1355 }
else if (num < 2000000) {
1356 snprintf(fn,
sizeof(fn),
"digits/million");
1357 num = num % 1000000;
1358 if ((num > 0) && (num < 11)) {
1361 }
else if (num < 3000000) {
1362 snprintf(fn,
sizeof(fn),
"digits/twomillion");
1363 num = num - 2000000;
1364 if ((num > 0) && (num < 11)) {
1367 }
else if (num < 1000000000) {
1372 snprintf(fn,
sizeof(fn),
"digits/million");
1373 num = num % 1000000;
1374 if ((num > 0) && (num < 11)) {
1378 ast_debug(1,
"Number '%d' is too big for me\n", num);
1384 if ((audiofd > -1) && (ctrlfd > -1)) {
1415 while(!res && (num || playh)) {
1418 if ( num > INT_MIN ) {
1426 }
else if (num < 11 || num == 20) {
1427 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1429 }
else if (num < 20) {
1432 }
else if (num < 30) {
1435 }
else if (num < 100) {
1436 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
1440 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
1444 if (num < 1000000) {
1451 if (num < 1000000000) {
1458 ast_debug(1,
"Number '%d' is too big for me\n", num);
1466 if ((audiofd > -1) && (ctrlfd > -1))
1512 while (!res && (num || playh)) {
1515 if ( num > INT_MIN ) {
1523 }
else if (num < 20) {
1524 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1526 }
else if (num == 21) {
1527 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1529 }
else if (num == 28) {
1530 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1532 }
else if (num == 31) {
1533 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1535 }
else if (num == 38) {
1536 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1538 }
else if (num == 41) {
1539 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1541 }
else if (num == 48) {
1542 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1544 }
else if (num == 51) {
1545 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1547 }
else if (num == 58) {
1548 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1550 }
else if (num == 61) {
1551 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1553 }
else if (num == 68) {
1554 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1556 }
else if (num == 71) {
1557 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1559 }
else if (num == 78) {
1560 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1562 }
else if (num == 81) {
1563 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1565 }
else if (num == 88) {
1566 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1568 }
else if (num == 91) {
1569 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1571 }
else if (num == 98) {
1572 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1574 }
else if (num < 100) {
1575 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
1579 if ((num / 100) > 1) {
1580 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
1587 if (num < 1000000) {
1594 if ((tempnum / 1000) < 2)
1599 if (num < 1000000000) {
1600 if ((num / 1000000) > 1)
1606 if ((tempnum / 1000000) < 2)
1611 ast_debug(1,
"Number '%d' is too big for me\n", num);
1619 if ((audiofd > -1) && (ctrlfd > -1))
1641 while (!res && (num || playh )) {
1644 if ( num > INT_MIN ) {
1652 }
else if (num < 20) {
1653 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1655 }
else if (num < 100) {
1664 snprintf(fn,
sizeof(fn),
"digits/%d", num - units);
1667 }
else if (num < 200) {
1671 }
else if (num < 1000) {
1672 snprintf(fn,
sizeof(fn),
"digits/%d", num / 100);
1680 }
else if (num < 10000) {
1687 if (num < 1000000) {
1694 if (num < 1000000000) {
1701 ast_debug(1,
"Number '%d' is too big for me\n", num);
1710 if ((audiofd > -1) && (ctrlfd > -1))
1736 if (options && !strncasecmp(options,
"n", 1)) cn = -1;
1738 while (!res && (num || playh || playa )) {
1747 if ( num > INT_MIN ) {
1758 }
else if (num == 1 && cn == -1) {
1761 }
else if (num < 20) {
1762 snprintf(fn,
sizeof(fn),
"digits/%d", num);
1764 }
else if (num < 100) {
1765 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
1767 }
else if (num < 1000) {
1768 int hundreds = num / 100;
1772 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 100));
1775 num -= 100 * hundreds;
1778 }
else if (num < 1000000) {
1784 if (num && num < 100)
1786 }
else if (num < 1000000000) {
1787 int millions = num / 1000000;
1793 if (num && num < 100)
1796 ast_debug(1,
"Number '%d' is too big for me\n", num);
1802 if ((audiofd > -1) && (ctrlfd > -1))
1818 char *dziesiatki[10];
1829 return odm->
rzedy[rzad - 1][0];
1830 if ((i > 21 || i < 11) && i%10 > 1 && i%10 < 5)
1831 return odm->
rzedy[rzad - 1][1];
1833 return odm->
rzedy[rzad - 1][2];
1838 strcpy(buffer, str);
1839 buffer += strlen(str);
1845 char file_name[255] =
"digits/";
1846 strcat(file_name, fn);
1847 ast_debug(1,
"Trying to play: %s\n", file_name);
1849 if ((audiofd > -1) && (ctrlfd > -1))
1869 if (i == 0 && rzad > 0) {
1877 m1000E6 = i % 1000000000;
1878 i1000E6 = i / 1000000000;
1880 powiedz(chan, language, audiofd, ctrlfd, ints, odm, rzad+3, i1000E6);
1882 m1000E3 = m1000E6 % 1000000;
1883 i1000E3 = m1000E6 / 1000000;
1885 powiedz(chan, language, audiofd, ctrlfd, ints, odm, rzad+2, i1000E3);
1887 m1000 = m1000E3 % 1000;
1888 i1000 = m1000E3 / 1000;
1890 powiedz(chan, language, audiofd, ctrlfd, ints, odm, rzad+1, i1000);
1898 if (m100 > 0 && m100 <= 9) {
1903 }
else if (m100 % 10 == 0 && m100 != 0) {
1905 }
else if (m100 > 10 && m100 <= 19) {
1907 }
else if (m100 > 20) {
2020 char *zenski_cyfry[] = {
"0",
"1z",
"2z",
"3",
"4",
"5",
"6",
"7",
"8",
"9"};
2022 char *zenski_cyfry2[] = {
"0",
"1",
"2z",
"3",
"4",
"5",
"6",
"7",
"8",
"9"};
2024 char *meski_cyfry[] = {
"0",
"1",
"2-1m",
"3-1m",
"4-1m",
"5m",
"6m",
"7m",
"8m",
"9m"};
2026 char *meski_cyfry2[] = {
"0",
"1",
"2-2m",
"3-2m",
"4-2m",
"5m",
"6m",
"7m",
"8m",
"9m"};
2028 char *meski_setki[] = {
"",
"100m",
"200m",
"300m",
"400m",
"500m",
"600m",
"700m",
"800m",
"900m"};
2030 char *meski_dziesiatki[] = {
"",
"10m",
"20m",
"30m",
"40m",
"50m",
"60m",
"70m",
"80m",
"90m"};
2032 char *meski_nastki[] = {
"",
"11m",
"12m",
"13m",
"14m",
"15m",
"16m",
"17m",
"18m",
"19m"};
2034 char *nijaki_cyfry[] = {
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9"};
2036 char *nijaki_cyfry2[] = {
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9"};
2038 char *nijaki_setki[] = {
"",
"100",
"200",
"300",
"400",
"500",
"600",
"700",
"800",
"900"};
2040 char *nijaki_dziesiatki[] = {
"",
"10",
"20",
"30",
"40",
"50",
"60",
"70",
"80",
"90"};
2042 char *nijaki_nastki[] = {
"",
"11",
"12",
"13",
"14",
"15",
"16",
"17",
"18",
"19"};
2044 char *rzedy[][3] = { {
"1000",
"1000.2",
"1000.5"}, {
"1000000",
"1000000.2",
"1000000.5"}, {
"1000000000",
"1000000000.2",
"1000000000.5"}};
2049 static odmiana *odmiana_nieosobowa = NULL;
2050 static odmiana *odmiana_meska = NULL;
2051 static odmiana *odmiana_zenska = NULL;
2053 if (odmiana_nieosobowa == NULL) {
2054 odmiana_nieosobowa =
ast_malloc(
sizeof(*odmiana_nieosobowa));
2058 memcpy(odmiana_nieosobowa->
cyfry, nijaki_cyfry,
sizeof(odmiana_nieosobowa->
cyfry));
2059 memcpy(odmiana_nieosobowa->
cyfry2, nijaki_cyfry2,
sizeof(odmiana_nieosobowa->
cyfry));
2060 memcpy(odmiana_nieosobowa->
setki, nijaki_setki,
sizeof(odmiana_nieosobowa->
setki));
2061 memcpy(odmiana_nieosobowa->
dziesiatki, nijaki_dziesiatki,
sizeof(odmiana_nieosobowa->
dziesiatki));
2062 memcpy(odmiana_nieosobowa->
nastki, nijaki_nastki,
sizeof(odmiana_nieosobowa->
nastki));
2063 memcpy(odmiana_nieosobowa->
rzedy, rzedy,
sizeof(odmiana_nieosobowa->
rzedy));
2066 if (odmiana_zenska == NULL) {
2067 odmiana_zenska =
ast_malloc(
sizeof(*odmiana_zenska));
2071 memcpy(odmiana_zenska->
cyfry, zenski_cyfry,
sizeof(odmiana_zenska->
cyfry));
2072 memcpy(odmiana_zenska->
cyfry2, zenski_cyfry2,
sizeof(odmiana_zenska->
cyfry));
2073 memcpy(odmiana_zenska->
setki, nijaki_setki,
sizeof(odmiana_zenska->
setki));
2075 memcpy(odmiana_zenska->
nastki, nijaki_nastki,
sizeof(odmiana_zenska->
nastki));
2076 memcpy(odmiana_zenska->
rzedy, rzedy,
sizeof(odmiana_zenska->
rzedy));
2079 if (odmiana_meska == NULL) {
2080 odmiana_meska =
ast_malloc(
sizeof(*odmiana_meska));
2084 memcpy(odmiana_meska->
cyfry, meski_cyfry,
sizeof(odmiana_meska->
cyfry));
2085 memcpy(odmiana_meska->
cyfry2, meski_cyfry2,
sizeof(odmiana_meska->
cyfry));
2086 memcpy(odmiana_meska->
setki, meski_setki,
sizeof(odmiana_meska->
setki));
2088 memcpy(odmiana_meska->
nastki, meski_nastki,
sizeof(odmiana_meska->
nastki));
2089 memcpy(odmiana_meska->
rzedy, rzedy,
sizeof(odmiana_meska->
rzedy));
2093 if (strncasecmp(options,
"f", 1) == 0)
2095 else if (strncasecmp(options,
"m", 1) == 0)
2098 o = odmiana_nieosobowa;
2100 o = odmiana_nieosobowa;
2102 powiedz(chan, language, audiofd, ctrlfd, ints, o, 0, num);
2122 if (options && !strncasecmp(options,
"f", 1))
2125 while (!res && num ) {
2128 if ( num > INT_MIN ) {
2133 }
else if (num < 20) {
2134 if ((num == 1 || num == 2) && (mf < 0))
2135 snprintf(fn,
sizeof(fn),
"digits/%dF", num);
2137 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2139 }
else if (num < 100) {
2140 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 10) * 10);
2144 }
else if (num < 1000) {
2150 if (mf < 0 && num > 199)
2151 snprintf(fn,
sizeof(fn),
"digits/%dF", (num / 100) * 100);
2153 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 100) * 100);
2158 }
else if (num < 1000000) {
2165 if ((num % 1000) && ((num % 1000) < 100 || !(num % 100)))
2168 }
else if (num < 1000000000) {
2177 if ((num % 1000000) &&
2179 ((!((num / 1000) % 1000) && ((num % 1000) < 100 || !(num % 100))) ||
2181 (!(num % 1000) && (((num / 1000) % 1000) < 100 || !((num / 1000) % 100))) ) )
2183 num = num % 1000000;
2191 if ((audiofd > -1) && (ctrlfd > -1))
2198 if (!res && playh) {
2199 res =
wait_file(chan, ints,
"digits/and", language);
2220 if (options && !strncasecmp(options,
"n", 1)) cn = -1;
2222 while (num || playh) {
2225 if ( num > INT_MIN ) {
2233 }
else if (start && num < 200 && num > 99 && cn == -1) {
2235 snprintf(fn,
sizeof(fn),
"digits/hundred");
2237 }
else if (num == 1 && cn == -1) {
2240 }
else if (num < 20) {
2241 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2243 }
else if (num < 100) {
2244 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
2246 }
else if (num < 1000) {
2248 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
2251 }
else if (num < 1000000) {
2259 }
else if (num < 1000000000) {
2273 if ((audiofd > -1) && (ctrlfd > -1)) {
2295 int last_length = 0;
2301 while (!res && (num || playh || playt || playz)) {
2304 if ( num > INT_MIN ) {
2310 snprintf(fn,
sizeof(fn),
"digits/0");
2317 snprintf(fn,
sizeof(fn),
"digits/thousand");
2319 }
else if (num < 10) {
2320 snprintf(buf, 10,
"%d", num);
2321 if (last_length - strlen(buf) > 1 && last_length != 0) {
2322 last_length = strlen(buf);
2326 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2328 }
else if (num < 100) {
2329 snprintf(buf, 10,
"%d", num);
2330 if (last_length - strlen(buf) > 1 && last_length != 0) {
2331 last_length = strlen(buf);
2335 last_length = strlen(buf);
2336 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 10) * 10);
2340 snprintf(buf, 10,
"%d", num);
2341 if (last_length - strlen(buf) > 1 && last_length != 0) {
2342 last_length = strlen(buf);
2346 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 100));
2348 snprintf(buf, 10,
"%d", num);
2349 ast_log(
LOG_DEBUG,
"Number '%d' %d %d\n", num, (
int)strlen(buf), last_length);
2350 last_length = strlen(buf);
2351 num -= ((num / 100) * 100);
2352 }
else if (num < 10000){
2353 snprintf(buf, 10,
"%d", num);
2354 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 1000));
2356 snprintf(buf, 10,
"%d", num);
2357 ast_log(
LOG_DEBUG,
"Number '%d' %d %d\n", num, (
int)strlen(buf), last_length);
2358 last_length = strlen(buf);
2359 num -= ((num / 1000) * 1000);
2360 }
else if (num < 100000000) {
2364 snprintf(buf, 10,
"%d", num);
2365 ast_log(
LOG_DEBUG,
"Number '%d' %d %d\n", num, (
int)strlen(buf), last_length);
2366 num -= ((num / 10000) * 10000);
2367 last_length = strlen(buf);
2368 snprintf(fn,
sizeof(fn),
"digits/wan");
2370 if (num < 1000000000) {
2374 snprintf(buf, 10,
"%d", num);
2375 ast_log(
LOG_DEBUG,
"Number '%d' %d %d\n", num, (
int)strlen(buf), last_length);
2376 last_length = strlen(buf);
2377 num -= ((num / 100000000) * 100000000);
2378 snprintf(fn,
sizeof(fn),
"digits/yi");
2380 ast_debug(1,
"Number '%d' is too big for me\n", num);
2387 if ((audiofd > -1) && (ctrlfd > -1))
2412 while (!res && (num || playh)) {
2414 snprintf(fn,
sizeof(fn),
"digits/hundred");
2416 }
else if (num < 100) {
2417 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2419 }
else if (num < 1000) {
2420 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 100));
2422 num -= ((num / 100) * 100);
2423 }
else if (num < 100000) {
2428 snprintf(fn,
sizeof(fn),
"digits/thousand");
2429 }
else if (num < 10000000) {
2434 snprintf(fn,
sizeof(fn),
"digits/lac");
2435 }
else if (num < 1000000000) {
2439 num = num % 10000000;
2440 snprintf(fn,
sizeof(fn),
"digits/crore");
2448 if ((audiofd > -1) && (ctrlfd > -1)) {
2464 }
else if (num < 100) {
2466 }
else if (num < 1000) {
2495 while (!res && (num)) {
2498 if ( num > INT_MIN ) {
2503 }
else if (num < 20) {
2504 if (options && strlen(options) == 1 && num < 3) {
2505 snprintf(fn,
sizeof(fn),
"digits/%d%s", num, options);
2507 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2510 }
else if (num < 100) {
2511 snprintf(fn,
sizeof(fn),
"digits/%d", num - (num % 10));
2513 }
else if (num < 1000){
2514 snprintf(fn,
sizeof(fn),
"digits/%d", num - (num % 100));
2516 }
else if (num < 1000000) {
2519 if (lastdigits < 3) {
2526 if (lastdigits == 1) {
2528 }
else if (lastdigits > 1 && lastdigits < 5) {
2534 }
else if (num < 1000000000) {
2540 if (lastdigits == 1) {
2542 }
else if (lastdigits > 1 && lastdigits < 5) {
2549 ast_debug(1,
"Number '%d' is too big for me\n", num);
2554 if ((audiofd > -1) && (ctrlfd > -1))
2573 while(!res && (num || playh)) {
2576 if ( num > INT_MIN ) {
2584 }
else if (num < 100) {
2585 if ((num <= 20) || ((num % 10) == 1)) {
2586 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2589 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 10) * 10);
2592 }
else if (num < 1000) {
2593 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
2596 }
else if (num < 10000) {
2602 }
else if (num < 100000) {
2608 }
else if (num < 1000000) {
2623 if ((audiofd > -1) && (ctrlfd > -1))
2646 while (!res && (num || playh)) {
2649 if ( num > INT_MIN ) {
2655 snprintf(fn,
sizeof(fn),
"digits/%da", num);
2664 }
else if (playoh) {
2667 }
else if (playohz) {
2670 }
else if (num < 20) {
2671 snprintf(fn,
sizeof(fn),
"digits/%d", num);
2673 }
else if (num < 100) {
2674 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
2676 if ((num == 5) || (num == 4) || (num == 1)) playl++;
2679 snprintf(fn,
sizeof(fn),
"digits/%d", (num/100));
2681 if (num && (num < 10)) {
2688 if (num < 1000000) {
2693 snprintf(fn,
sizeof(fn),
"digits/thousand");
2694 if (num && (num < 10)) {
2696 }
else if (num && (num < 100)){
2704 if (num < 1000000000) {
2718 if ((audiofd > -1) && (ctrlfd > -1))
2733 if (!strncasecmp(language,
"en", 2)) {
2735 }
else if (!strncasecmp(language,
"da", 2)) {
2737 }
else if (!strncasecmp(language,
"de", 2)) {
2739 }
else if (!strncasecmp(language,
"he", 2)) {
2741 }
else if (!strncasecmp(language,
"vi", 2)) {
2756 while (!res && num) {
2759 if ( num > INT_MIN ) {
2764 }
else if (num < 20) {
2765 snprintf(fn,
sizeof(fn),
"digits/h-%d", num);
2767 }
else if (num < 100) {
2768 int tens = num / 10;
2771 snprintf(fn,
sizeof(fn),
"digits/h-%d", (tens * 10));
2773 snprintf(fn,
sizeof(fn),
"digits/%d", (tens * 10));
2775 }
else if (num < 1000) {
2776 int hundreds = num / 100;
2778 if (hundreds > 1 || t == 1) {
2788 }
else if (num < 1000000) {
2789 int thousands = num / 1000;
2791 if (thousands > 1 || t == 1) {
2802 }
else if (num < 1000000000) {
2803 int millions = num / 1000000;
2804 num = num % 1000000;
2814 }
else if (num < INT_MAX) {
2815 int billions = num / 1000000000;
2816 num = num % 1000000000;
2826 }
else if (num == INT_MAX) {
2830 ast_debug(1,
"Number '%d' is too big for me\n", num);
2836 if ((audiofd > -1) && (ctrlfd > -1)) {
2855 if ((audiofd > -1) && (ctrlfd > -1)) {
2872 char fn[256] =
"", fna[256] =
"";
2875 if (options && !strncasecmp(options,
"f", 1)) {
2877 }
else if (options && !strncasecmp(options,
"n", 1)) {
2886 while (!res && num) {
2889 if ( num > INT_MIN ) {
2894 }
else if (num < 100 && t) {
2897 }
else if (num < 20) {
2898 snprintf(fn,
sizeof(fn),
"digits/h-%d%s", num, gender);
2900 }
else if (num < 100) {
2901 int ones = num % 10;
2903 snprintf(fn,
sizeof(fn),
"digits/%d-and", ones);
2906 snprintf(fn,
sizeof(fn),
"digits/h-%d%s", num, gender);
2909 }
else if (num == 100 && t == 0) {
2910 snprintf(fn,
sizeof(fn),
"digits/h-hundred%s", gender);
2912 }
else if (num < 1000) {
2913 int hundreds = num / 100;
2915 if (hundreds == 1) {
2918 snprintf(fn,
sizeof(fn),
"digits/%d", hundreds);
2923 snprintf(fna,
sizeof(fna),
"digits/h-hundred%s", gender);
2926 }
else if (num < 1000000) {
2927 int thousands = num / 1000;
2929 if (thousands == 1) {
2936 snprintf(fna,
sizeof(fna),
"digits/h-thousand%s", gender);
2938 snprintf(fn,
sizeof(fn),
"digits/h-thousand%s", gender);
2949 snprintf(fn,
sizeof(fn),
"digits/h-thousand%s", gender);
2953 }
else if (num < 1000000000) {
2954 int millions = num / 1000000;
2955 num = num % 1000000;
2956 if (millions == 1) {
2962 snprintf(fna,
sizeof(fna),
"digits/h-million%s", gender);
2972 snprintf(fn,
sizeof(fn),
"digits/h-million%s", gender);
2976 }
else if (num < INT_MAX) {
2977 int billions = num / 1000000000;
2978 num = num % 1000000000;
2979 if (billions == 1) {
2985 snprintf(fna,
sizeof(fna),
"digits/h-milliard%s", gender);
2994 snprintf(fn,
sizeof(fna),
"digits/h-milliard%s", gender);
2998 }
else if (num == INT_MAX) {
2999 snprintf(fn,
sizeof(fn),
"digits/h-last%s", gender);
3002 ast_debug(1,
"Number '%d' is too big for me\n", num);
3008 if ((audiofd > -1) && (ctrlfd > -1))
3016 if ((audiofd > -1) && (ctrlfd > -1)) {
3035 char fn[256] =
"", fna[256] =
"";
3038 if (options && !strncasecmp(options,
"f", 1)) {
3040 }
else if (options && !strncasecmp(options,
"n", 1)) {
3049 while (!res && num) {
3052 if ( num > INT_MIN ) {
3057 }
else if (num < 100 && t) {
3060 }
else if (num < 20) {
3061 snprintf(fn,
sizeof(fn),
"digits/h-%d%s", num, gender);
3063 }
else if (num < 100) {
3064 int ones = num % 10;
3066 snprintf(fn,
sizeof(fn),
"digits/%d-and", ones);
3069 snprintf(fn,
sizeof(fn),
"digits/h-%d%s", num, gender);
3072 }
else if (num == 100 && t == 0) {
3073 snprintf(fn,
sizeof(fn),
"digits/h-hundred%s", gender);
3075 }
else if (num < 1000) {
3076 int hundreds = num / 100;
3078 if (hundreds == 1) {
3081 snprintf(fn,
sizeof(fn),
"digits/%d", hundreds);
3086 snprintf(fna,
sizeof(fna),
"digits/h-hundred%s", gender);
3089 }
else if (num < 1000000) {
3090 int thousands = num / 1000;
3092 if (thousands == 1) {
3099 snprintf(fna,
sizeof(fna),
"digits/h-thousand%s", gender);
3101 snprintf(fn,
sizeof(fn),
"digits/h-thousand%s", gender);
3112 snprintf(fn,
sizeof(fn),
"digits/h-thousand%s", gender);
3116 }
else if (num < 1000000000) {
3117 int millions = num / 1000000;
3118 num = num % 1000000;
3119 if (millions == 1) {
3125 snprintf(fna,
sizeof(fna),
"digits/h-million%s", gender);
3135 snprintf(fn,
sizeof(fn),
"digits/h-million%s", gender);
3139 }
else if (num < INT_MAX) {
3140 int billions = num / 1000000000;
3141 num = num % 1000000000;
3142 if (billions == 1) {
3148 snprintf(fna,
sizeof(fna),
"digits/h-milliard%s", gender);
3157 snprintf(fn,
sizeof(fna),
"digits/h-milliard%s", gender);
3161 }
else if (num == INT_MAX) {
3162 snprintf(fn,
sizeof(fn),
"digits/h-last%s", gender);
3165 ast_debug(1,
"Number '%d' is too big for me\n", num);
3171 if ((audiofd > -1) && (ctrlfd > -1))
3179 if ((audiofd > -1) && (ctrlfd > -1)) {
3200 if (options && !strncasecmp(options,
"m", 1)) {
3206 while (!res && num) {
3208 snprintf(fn,
sizeof(fn),
"digits/minus");
3209 if (num > INT_MIN) {
3214 }
else if (num < 21) {
3217 snprintf(fn,
sizeof(fn),
"digits/f-0%d", num);
3219 snprintf(fn,
sizeof(fn),
"digits/f-%d", num);
3223 snprintf(fn,
sizeof(fn),
"digits/m-0%d", num);
3225 snprintf(fn,
sizeof(fn),
"digits/m-%d", num);
3229 }
else if ((num < 100) && num >= 20) {
3230 snprintf(fn,
sizeof(fn),
"digits/%d", (num / 10) * 10);
3232 }
else if ((num >= 100) && (num < 1000)) {
3233 int tmpnum = num / 100;
3234 snprintf(fn,
sizeof(fn),
"digits/%d00", tmpnum);
3235 num = num - (tmpnum * 100);
3236 }
else if ((num >= 1000) && (num < 10000)) {
3237 int tmpnum = num / 1000;
3238 snprintf(fn,
sizeof(fn),
"digits/%dk", tmpnum);
3239 num = num - (tmpnum * 1000);
3240 }
else if (num < 20000) {
3241 snprintf(fn,
sizeof(fn),
"digits/m-%d", (num / 1000));
3243 }
else if (num < 1000000) {
3248 snprintf(fn,
sizeof(fn),
"digits/1k");
3250 }
else if (num < 2000000) {
3251 snprintf(fn,
sizeof(fn),
"digits/1m");
3252 num = num % 1000000;
3253 }
else if (num < 3000000) {
3254 snprintf(fn,
sizeof(fn),
"digits/2m");
3255 num = num - 2000000;
3256 }
else if (num < 1000000000) {
3261 snprintf(fn,
sizeof(fn),
"digits/1m");
3262 num = num % 1000000;
3269 if ((audiofd > -1) && (ctrlfd > -1)) {
3283 if (!strncasecmp(lang,
"en", 2)) {
3285 }
else if (!strncasecmp(lang,
"da", 2)) {
3287 }
else if (!strncasecmp(lang,
"de", 2)) {
3289 }
else if (!strncasecmp(lang,
"es", 2)) {
3291 }
else if (!strncasecmp(lang,
"fr", 2)) {
3293 }
else if (!strncasecmp(lang,
"ge", 2)) {
3294 static int deprecation_warning = 0;
3295 if (deprecation_warning++ % 10 == 0) {
3296 ast_log(
LOG_WARNING,
"ge is not a standard language code. Please switch to using ka instead.\n");
3299 }
else if (!strncasecmp(lang,
"gr", 2)) {
3301 }
else if (!strncasecmp(lang,
"he", 2)) {
3303 }
else if (!strncasecmp(lang,
"hu", 2)) {
3305 }
else if (!strncasecmp(lang,
"ka", 2)) {
3307 }
else if (!strncasecmp(lang,
"nl", 2)) {
3309 }
else if (!strncasecmp(lang,
"pt", 2)) {
3311 }
else if (!strncasecmp(lang,
"th", 2)) {
3323 struct timeval when = { t, 0 };
3328 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
3334 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
3351 struct timeval when = { t, 0 };
3357 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
3367 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
3383 snprintf(fn,
sizeof(fn),
"digits/%d", (year / 100));
3386 res =
wait_file(chan, ints,
"digits/hundred", lang);
3387 if (!res && year % 100 != 0) {
3388 res =
ast_say_number(chan, (year % 100), ints, lang, (
char *) NULL);
3400 struct timeval when = { t, 0 };
3406 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
3416 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
3433 snprintf(fn,
sizeof(fn),
"digits/%d", (year / 100) );
3436 res =
wait_file(chan, ints,
"digits/hundred", lang);
3437 if (!res && year % 100 != 0) {
3438 res =
ast_say_number(chan, (year % 100), ints, lang, (
char *) NULL);
3450 struct timeval when = { t, 0 };
3455 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
3463 res =
wait_file(chan, ints,
"digits/es-de", lang);
3465 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
3469 res =
wait_file(chan, ints,
"digits/es-de", lang);
3481 struct timeval when = { t, 0 };
3492 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
3502 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
3513 struct timeval when = { t, 0 };
3519 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
3529 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
3542 struct timeval when = { t, 0 };
3548 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
3556 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
3571 struct timeval when = { t, 0 };
3577 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
3591 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
3607 struct timeval when = { t, 0 };
3613 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
3619 res =
wait_file(chan, ints,
"digits/pt-de", lang);
3620 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
3624 res =
wait_file(chan, ints,
"digits/pt-de", lang);
3634 struct timeval when = { t, 0 };
3640 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
3647 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
3667 if (!strncasecmp(lang,
"en", 2)) {
3669 }
else if (!strncasecmp(lang,
"da", 2)) {
3671 }
else if (!strncasecmp(lang,
"de", 2)) {
3673 }
else if (!strncasecmp(lang,
"es", 2)) {
3675 }
else if (!strncasecmp(lang,
"he", 2)) {
3677 }
else if (!strncasecmp(lang,
"fr", 2)) {
3679 }
else if (!strncasecmp(lang,
"gr", 2)) {
3681 }
else if (!strncasecmp(lang,
"it", 2)) {
3683 }
else if (!strncasecmp(lang,
"mx", 2)) {
3684 static int deprecation_warning = 0;
3685 if (deprecation_warning++ % 10 == 0) {
3686 ast_log(
LOG_WARNING,
"mx is not a standard language code. Please switch to using es_MX instead.\n");
3689 }
else if (!strncasecmp(lang,
"nl", 2)) {
3691 }
else if (!strncasecmp(lang,
"pl", 2)) {
3693 }
else if (!strncasecmp(lang,
"pt", 2)) {
3695 }
else if (!strncasecmp(lang,
"th", 2)) {
3697 }
else if (!strncasecmp(lang,
"tw", 2)) {
3698 static int deprecation_warning = 0;
3699 if (deprecation_warning++ % 10 == 0) {
3700 ast_log(
LOG_WARNING,
"tw is a standard language code for Twi, not Taiwanese. Please switch to using zh_TW instead.\n");
3703 }
else if (!strncasecmp(lang,
"zh", 2)) {
3705 }
else if (!strncasecmp(lang,
"vi", 2)) {
3716 struct timeval when = { t, 0 };
3718 int res=0, offset, sndoffset;
3719 char sndfile[256], nextmsg[256];
3722 format =
"ABdY 'digits/at' IMp";
3726 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
3727 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
3728 switch (format[offset]) {
3732 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
3733 sndfile[sndoffset] = format[offset];
3735 sndfile[sndoffset] =
'\0';
3736 res =
wait_file(chan, ints, sndfile, lang);
3741 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
3742 res =
wait_file(chan, ints, nextmsg, lang);
3748 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
3749 res =
wait_file(chan, ints, nextmsg, lang);
3768 res =
wait_file(chan, ints,
"digits/19", lang);
3772 res =
wait_file(chan, ints,
"digits/oh", lang);
3785 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
3787 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
3788 res =
wait_file(chan, ints, nextmsg, lang);
3793 if (format[offset] ==
'H') {
3796 res =
wait_file(chan, ints,
"digits/oh", lang);
3801 res =
wait_file(chan, ints,
"digits/oh", lang);
3808 res =
wait_file(chan, ints,
"digits/20", lang);
3812 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", remaining);
3813 res =
wait_file(chan, ints, nextmsg, lang);
3822 if (format[offset] ==
'M') {
3823 res =
wait_file(chan, ints,
"digits/oclock", lang);
3825 res =
wait_file(chan, ints,
"digits/hundred", lang);
3827 }
else if (tm.
tm_min < 10) {
3828 res =
wait_file(chan, ints,
"digits/oh", lang);
3830 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_min);
3831 res =
wait_file(chan, ints, nextmsg, lang);
3844 res =
wait_file(chan, ints, nextmsg, lang);
3856 gettimeofday(&now, NULL);
3861 if (beg_today < t) {
3863 res =
wait_file(chan, ints,
"digits/today", lang);
3864 }
else if (beg_today - 86400 < t) {
3866 res =
wait_file(chan, ints,
"digits/yesterday", lang);
3867 }
else if (beg_today - 86400 * 6 < t) {
3870 }
else if (beg_today - 2628000 < t) {
3873 }
else if (beg_today - 15768000 < t) {
3897 if (beg_today < t) {
3899 }
else if ((beg_today - 86400) < t) {
3901 res =
wait_file(chan, ints,
"digits/yesterday", lang);
3902 }
else if (beg_today - 86400 * 6 < t) {
3905 }
else if (beg_today - 2628000 < t) {
3908 }
else if (beg_today - 15768000 < t) {
3923 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
3924 res =
wait_file(chan, ints, nextmsg, lang);
3925 }
else if (tm.
tm_sec < 10) {
3926 res =
wait_file(chan, ints,
"digits/oh", lang);
3928 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
3929 res =
wait_file(chan, ints, nextmsg, lang);
3944 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
3963 struct timeval when = { t, 0 };
3965 int res=0, offset, sndoffset;
3966 char sndfile[256], nextmsg[256];
3969 format =
"A dBY HMS";
3973 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
3974 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
3975 switch (format[offset]) {
3979 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
3980 sndfile[sndoffset] = format[offset];
3982 sndfile[sndoffset] =
'\0';
3983 res =
wait_file(chan, ints, sndfile, lang);
3988 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
3989 res =
wait_file(chan, ints, nextmsg, lang);
3995 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
3996 res =
wait_file(chan, ints, nextmsg, lang);
4020 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", (year / 100) );
4021 res =
wait_file(chan, ints, nextmsg, lang);
4023 res =
wait_file(chan, ints,
"digits/hundred", lang);
4024 if (!res && year % 100 != 0) {
4025 res =
ast_say_number(chan, (year % 100), ints, lang, (
char *) NULL);
4035 res =
wait_file(chan, ints,
"digits/oclock", lang);
4039 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
4041 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
4043 res =
wait_file(chan, ints, nextmsg, lang);
4049 res =
wait_file(chan, ints,
"digits/0", lang);
4061 if (!res &&
next_item(&format[offset + 1]) ==
'S') {
4063 res =
wait_file(chan, ints,
"digits/minute", lang);
4065 res =
wait_file(chan, ints,
"digits/minutes", lang);
4076 res =
wait_file(chan, ints, nextmsg, lang);
4092 if (beg_today < t) {
4094 res =
wait_file(chan, ints,
"digits/today", lang);
4095 }
else if (beg_today - 86400 < t) {
4097 res =
wait_file(chan, ints,
"digits/yesterday", lang);
4117 if (beg_today < t) {
4119 }
else if ((beg_today - 86400) < t) {
4121 res =
wait_file(chan, ints,
"digits/yesterday", lang);
4122 }
else if (beg_today - 86400 * 6 < t) {
4135 res =
wait_file(chan, ints,
"digits/and", lang);
4139 res =
wait_file(chan, ints,
"digits/seconds", lang);
4152 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
4165 struct timeval when = { t, 0 };
4167 int res=0, offset, sndoffset;
4168 char sndfile[256], nextmsg[256];
4171 format =
"A dBY HMS";
4175 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
4176 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
4177 switch (format[offset]) {
4181 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
4182 sndfile[sndoffset] = format[offset];
4184 sndfile[sndoffset] =
'\0';
4185 res =
wait_file(chan, ints, sndfile, lang);
4190 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
4191 res =
wait_file(chan, ints, nextmsg, lang);
4197 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
4198 res =
wait_file(chan, ints, nextmsg, lang);
4222 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", (year / 100) );
4223 res =
wait_file(chan, ints, nextmsg, lang);
4225 res =
wait_file(chan, ints,
"digits/hundred", lang);
4226 if (!res && year % 100 != 0) {
4227 res =
ast_say_number(chan, (year % 100), ints, lang, (
char *) NULL);
4240 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
4242 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
4243 res =
wait_file(chan, ints, nextmsg, lang);
4245 res =
wait_file(chan, ints,
"digits/oclock", lang);
4253 res =
wait_file(chan, ints,
"digits/oclock", lang);
4258 if (
next_item(&format[offset + 1]) ==
'S') {
4260 }
else if (tm.
tm_min > 0) {
4264 if (!res &&
next_item(&format[offset + 1]) ==
'S') {
4266 res =
wait_file(chan, ints,
"digits/minute", lang);
4268 res =
wait_file(chan, ints,
"digits/minutes", lang);
4279 res =
wait_file(chan, ints, nextmsg, lang);
4295 if (beg_today < t) {
4297 res =
wait_file(chan, ints,
"digits/today", lang);
4298 }
else if (beg_today - 86400 < t) {
4300 res =
wait_file(chan, ints,
"digits/yesterday", lang);
4320 if (beg_today < t) {
4322 }
else if ((beg_today - 86400) < t) {
4324 res =
wait_file(chan, ints,
"digits/yesterday", lang);
4325 }
else if (beg_today - 86400 * 6 < t) {
4338 res =
wait_file(chan, ints,
"digits/and", lang);
4342 res =
wait_file(chan, ints, tm.
tm_sec == 1 ?
"digits/second" :
"digits/seconds", lang);
4355 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
4368 struct timeval when = { t, 0 };
4370 int res=0, offset, sndoffset;
4371 char sndfile[256], nextmsg[256];
4374 format =
"a 'digits/tee' e 'digits/duan' hY I 'digits/naliga' M 'digits/natee'";
4378 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
4379 ast_log(
LOG_DEBUG,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
4380 switch (format[offset]) {
4384 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
4385 sndfile[sndoffset] = format[offset];
4387 sndfile[sndoffset] =
'\0';
4388 res =
wait_file(chan, ints, sndfile, lang);
4393 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
4394 res =
wait_file(chan, ints, nextmsg, lang);
4400 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
4401 res =
wait_file(chan, ints, nextmsg, lang);
4421 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
4422 res =
wait_file(chan, ints, nextmsg, lang);
4429 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
4430 res =
wait_file(chan, ints, nextmsg, lang);
4453 if (beg_today < t) {
4455 res =
wait_file(chan, ints,
"digits/today", lang);
4456 }
else if (beg_today - 86400 < t) {
4458 res =
wait_file(chan, ints,
"digits/yesterday", lang);
4459 }
else if (beg_today - 86400 * 6 < t) {
4462 }
else if (beg_today - 2628000 < t) {
4465 }
else if (beg_today - 15768000 < t) {
4488 if (beg_today < t) {
4490 }
else if ((beg_today - 86400) < t) {
4492 res =
wait_file(chan, ints,
"digits/yesterday", lang);
4493 }
else if (beg_today - 86400 * 6 < t) {
4496 }
else if (beg_today - 2628000 < t) {
4499 }
else if (beg_today - 15768000 < t) {
4523 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
4553 #define IL_DATE_STR "AdBY"
4554 #define IL_TIME_STR "HM"
4555 #define IL_DATE_STR_FULL IL_DATE_STR " 'digits/at' " IL_TIME_STR
4561 struct timeval when = { t, 0 };
4563 int res = 0, offset, sndoffset;
4564 char sndfile[256], nextmsg[256];
4572 for (offset = 0; format[offset] !=
'\0'; offset++) {
4573 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
4574 switch (format[offset]) {
4578 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
4579 sndfile[sndoffset] = format[offset];
4581 sndfile[sndoffset] =
'\0';
4582 res =
wait_file(chan, ints, sndfile, lang);
4587 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
4588 res =
wait_file(chan, ints, nextmsg, lang);
4594 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
4595 res =
wait_file(chan, ints, nextmsg, lang);
4638 char todo = format[offset];
4644 if (beg_today < t) {
4647 res =
wait_file(chan, ints,
"digits/today", lang);
4649 }
else if (beg_today - 86400 < t) {
4651 res =
wait_file(chan, ints,
"digits/yesterday", lang);
4652 }
else if ((todo !=
'Q') && (beg_today - 86400 * 6 < t)) {
4665 ints, lang,
"f", -1, -1
4688 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
4702 struct timeval when = { t, 0 };
4704 int res=0, offset, sndoffset;
4705 char sndfile[256], nextmsg[256];
4708 format =
"'digits/es-el' Ad 'digits/es-de' B 'digits/es-de' Y 'digits/at' IMp";
4712 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
4713 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
4714 switch (format[offset]) {
4718 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
4719 sndfile[sndoffset] = format[offset];
4721 sndfile[sndoffset] =
'\0';
4722 snprintf(nextmsg,
sizeof(nextmsg),
"%s", sndfile);
4723 res =
wait_file(chan, ints, nextmsg, lang);
4728 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
4729 res =
wait_file(chan, ints, nextmsg, lang);
4735 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
4736 res =
wait_file(chan, ints, nextmsg, lang);
4740 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", tm.
tm_mon +1);
4741 res =
wait_file(chan, ints, nextmsg, lang);
4758 snprintf(nextmsg,
sizeof(nextmsg),
"digits/1F");
4760 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
4762 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
4763 res =
wait_file(chan, ints, nextmsg, lang);
4769 if ((!res) && (format[offset] ==
'H')) {
4771 res =
wait_file(chan,ints,
"digits/hour",lang);
4773 res =
wait_file(chan,ints,
"digits/hours",lang);
4782 res =
wait_file(chan,ints,
"digits/minute",lang);
4784 res =
wait_file(chan,ints,
"digits/minutes",lang);
4792 res =
wait_file(chan, ints,
"digits/p-m", lang);
4794 res =
wait_file(chan, ints,
"digits/afternoon", lang);
4796 res =
wait_file(chan, ints,
"digits/a-m", lang);
4812 if (beg_today < t) {
4814 res =
wait_file(chan, ints,
"digits/today", lang);
4815 }
else if (beg_today - 86400 < t) {
4817 res =
wait_file(chan, ints,
"digits/yesterday", lang);
4837 if (beg_today < t) {
4839 res =
wait_file(chan, ints,
"digits/today", lang);
4840 }
else if ((beg_today - 86400) < t) {
4842 res =
wait_file(chan, ints,
"digits/yesterday", lang);
4843 }
else if (beg_today - 86400 * 6 < t) {
4859 res =
wait_file(chan,ints,
"digits/second",lang);
4861 res =
wait_file(chan,ints,
"digits/seconds",lang);
4874 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
4889 struct timeval when = { t, 0 };
4891 int res=0, offset, sndoffset;
4892 char sndfile[256], nextmsg[256];
4895 format =
"AdBY 'digits/at' IMp";
4899 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
4900 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
4901 switch (format[offset]) {
4905 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
4906 sndfile[sndoffset] = format[offset];
4908 sndfile[sndoffset] =
'\0';
4909 res =
wait_file(chan, ints, sndfile, lang);
4914 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
4915 res =
wait_file(chan, ints, nextmsg, lang);
4921 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
4922 res =
wait_file(chan, ints, nextmsg, lang);
4926 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", tm.
tm_mon +1);
4927 res =
wait_file(chan, ints, nextmsg, lang);
4933 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", tm.
tm_mday);
4934 res =
wait_file(chan, ints, nextmsg, lang);
4942 res =
wait_file(chan, ints,
"digits/2", lang);
4944 res =
wait_file(chan, ints,
"digits/thousand", lang);
4956 res =
wait_file(chan, ints,
"digits/thousand", lang);
4958 wait_file(chan, ints,
"digits/9", lang);
4959 wait_file(chan, ints,
"digits/hundred", lang);
4971 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
4973 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
4974 res =
wait_file(chan, ints, nextmsg, lang);
4976 res =
wait_file(chan, ints,
"digits/oclock", lang);
4983 res =
wait_file(chan, ints,
"digits/oclock", lang);
4999 res =
wait_file(chan, ints, nextmsg, lang);
5015 if (beg_today < t) {
5017 res =
wait_file(chan, ints,
"digits/today", lang);
5018 }
else if (beg_today - 86400 < t) {
5020 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5040 if (beg_today < t) {
5042 }
else if ((beg_today - 86400) < t) {
5044 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5045 }
else if (beg_today - 86400 * 6 < t) {
5060 res =
wait_file(chan, ints,
"digits/second", lang);
5072 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
5084 struct timeval when = { t, 0 };
5086 int res=0, offset, sndoffset;
5087 char sndfile[256], nextmsg[256];
5090 format =
"AdB 'digits/at' IMp";
5094 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
5095 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
5096 switch (format[offset]) {
5100 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
5101 sndfile[sndoffset] = format[offset];
5103 sndfile[sndoffset] =
'\0';
5104 res =
wait_file(chan, ints, sndfile, lang);
5109 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
5110 res =
wait_file(chan, ints, nextmsg, lang);
5116 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
5117 res =
wait_file(chan, ints, nextmsg, lang);
5121 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", tm.
tm_mon +1);
5122 res =
wait_file(chan, ints, nextmsg, lang);
5128 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", tm.
tm_mday);
5129 res =
wait_file(chan, ints, nextmsg, lang);
5139 res =
wait_file(chan, ints,
"digits/ore-2000", lang);
5143 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year - 100);
5144 res =
wait_file(chan, ints, nextmsg, lang);
5152 res =
wait_file(chan, ints,
"digits/ore-1900", lang);
5153 if ((!res) && (tm.
tm_year != 0)) {
5156 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year);
5157 res =
wait_file(chan, ints, nextmsg, lang);
5163 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", ten * 10);
5164 res =
wait_file(chan, ints, nextmsg, lang);
5167 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", one);
5168 res =
wait_file(chan, ints, nextmsg, lang);
5182 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
5184 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
5185 res =
wait_file(chan, ints, nextmsg, lang);
5191 res =
wait_file(chan, ints,
"digits/ore-mezzanotte", lang);
5193 res =
wait_file(chan, ints,
"digits/ore-una", lang);
5209 res =
wait_file(chan, ints, nextmsg, lang);
5225 if (beg_today < t) {
5227 res =
wait_file(chan, ints,
"digits/today", lang);
5228 }
else if (beg_today - 86400 < t) {
5230 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5247 if (beg_today < t) {
5249 }
else if ((beg_today - 86400) < t) {
5251 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5252 }
else if (beg_today - 86400 * 6 < t) {
5266 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
5267 res =
wait_file(chan, ints, nextmsg, lang);
5268 }
else if (tm.
tm_sec < 10) {
5269 res =
wait_file(chan, ints,
"digits/oh", lang);
5271 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
5272 res =
wait_file(chan, ints, nextmsg, lang);
5274 }
else if ((tm.
tm_sec < 21) || (tm.
tm_sec % 10 == 0)) {
5275 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
5276 res =
wait_file(chan, ints, nextmsg, lang);
5279 ten = (tm.
tm_sec / 10) * 10;
5281 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", ten);
5282 res =
wait_file(chan, ints, nextmsg, lang);
5286 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", one);
5287 res =
wait_file(chan, ints, nextmsg, lang);
5301 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
5314 struct timeval when = { t, 0 };
5316 int res=0, offset, sndoffset;
5317 char sndfile[256], nextmsg[256];
5320 format =
"AdBY 'digits/at' IMp";
5324 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
5325 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
5326 switch (format[offset]) {
5330 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
5331 sndfile[sndoffset] = format[offset];
5333 sndfile[sndoffset] =
'\0';
5334 res =
wait_file(chan, ints, sndfile, lang);
5339 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
5340 res =
wait_file(chan, ints, nextmsg, lang);
5346 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
5347 res =
wait_file(chan, ints, nextmsg, lang);
5351 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", tm.
tm_mon +1);
5352 res =
wait_file(chan, ints, nextmsg, lang);
5362 res =
wait_file(chan, ints,
"digits/2", lang);
5364 res =
wait_file(chan, ints,
"digits/thousand", lang);
5369 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year - 100);
5370 res =
wait_file(chan, ints, nextmsg, lang);
5378 res =
wait_file(chan, ints,
"digits/19", lang);
5382 res =
wait_file(chan, ints,
"digits/oh", lang);
5384 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year);
5385 res =
wait_file(chan, ints, nextmsg, lang);
5387 }
else if (tm.
tm_year <= 20) {
5389 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year);
5390 res =
wait_file(chan, ints, nextmsg, lang);
5396 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", ten * 10);
5397 res =
wait_file(chan, ints, nextmsg, lang);
5400 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", one);
5401 res =
wait_file(chan, ints, nextmsg, lang);
5415 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
5417 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
5418 res =
wait_file(chan, ints, nextmsg, lang);
5425 res =
wait_file(chan, ints,
"digits/nl-uur", lang);
5439 res =
wait_file(chan, ints, nextmsg, lang);
5455 if (beg_today < t) {
5457 res =
wait_file(chan, ints,
"digits/today", lang);
5458 }
else if (beg_today - 86400 < t) {
5460 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5477 if (beg_today < t) {
5479 }
else if ((beg_today - 86400) < t) {
5481 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5482 }
else if (beg_today - 86400 * 6 < t) {
5506 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
5519 struct timeval when = { thetime, 0 };
5521 int res=0, offset, sndoffset;
5522 char sndfile[256], nextmsg[256];
5526 for (offset = 0 ; format[offset] !=
'\0' ; offset++) {
5528 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
5529 switch (format[offset]) {
5533 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
5534 sndfile[sndoffset] = format[offset];
5536 sndfile[sndoffset] =
'\0';
5537 res =
wait_file(chan, ints, sndfile, lang);
5542 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
5543 res =
wait_file(chan, ints, nextmsg, lang);
5549 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
5550 res =
wait_file(chan, ints, nextmsg, lang);
5561 res =
wait_file(chan, ints,
"digits/h-30", lang);
5565 res =
wait_file(chan, ints,
"digits/h-20", lang);
5569 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", remaining);
5570 res =
wait_file(chan, ints, nextmsg, lang);
5576 res =
wait_file(chan, ints,
"digits/2", lang);
5578 res =
wait_file(chan, ints,
"digits/1000.2", lang);
5583 }
else if (tm.
tm_year == 100) {
5584 res =
wait_file(chan, ints,
"digits/h-2000", lang);
5591 res =
wait_file(chan, ints,
"digits/1000", lang);
5593 wait_file(chan, ints,
"digits/900", lang);
5599 wait_file(chan, ints,
"digits/year", lang);
5607 snprintf(nextmsg,
sizeof(nextmsg),
"digits/t-%d", tm.
tm_hour - 12);
5609 snprintf(nextmsg,
sizeof(nextmsg),
"digits/t-%d", tm.
tm_hour);
5611 res =
wait_file(chan, ints, nextmsg, lang);
5617 snprintf(nextmsg,
sizeof(nextmsg),
"digits/t-%d", tm.
tm_hour);
5618 res =
wait_file(chan, ints, nextmsg, lang);
5620 res =
wait_file(chan, ints,
"digits/t-24", lang);
5626 if (format[offset] ==
'M') {
5627 res =
wait_file(chan, ints,
"digits/oclock", lang);
5629 res =
wait_file(chan, ints,
"digits/100", lang);
5641 res =
wait_file(chan, ints, nextmsg, lang);
5654 if (beg_today < thetime) {
5656 res =
wait_file(chan, ints,
"digits/today", lang);
5657 }
else if (beg_today - 86400 < thetime) {
5659 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5676 if (beg_today < thetime) {
5678 }
else if ((beg_today - 86400) < thetime) {
5680 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5681 }
else if (beg_today - 86400 * 6 < thetime) {
5694 res =
wait_file(chan, ints,
"digits/and", lang);
5697 res =
wait_file(chan, ints,
"digits/1z", lang);
5699 res =
wait_file(chan, ints,
"digits/second-a", lang);
5707 if (one > 1 && one < 5 && ten != 1)
5708 res =
wait_file(chan, ints,
"digits/seconds", lang);
5710 res =
wait_file(chan, ints,
"digits/second", lang);
5724 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
5736 struct timeval when = { t, 0 };
5738 int res=0, offset, sndoffset;
5739 char sndfile[256], nextmsg[256];
5742 format =
"Ad 'digits/pt-de' B 'digits/pt-de' Y I 'digits/pt-e' Mp";
5746 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
5747 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
5748 switch (format[offset]) {
5752 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
5753 sndfile[sndoffset] = format[offset];
5755 sndfile[sndoffset] =
'\0';
5756 snprintf(nextmsg,
sizeof(nextmsg),
"%s", sndfile);
5757 res =
wait_file(chan, ints, nextmsg, lang);
5762 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
5763 res =
wait_file(chan, ints, nextmsg, lang);
5769 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
5770 res =
wait_file(chan, ints, nextmsg, lang);
5774 if (!strcasecmp(lang,
"pt_BR")) {
5777 snprintf(nextmsg,
sizeof(nextmsg),
"digits/h-%d", tm.
tm_mon +1);
5778 res =
wait_file(chan, ints, nextmsg, lang);
5794 if (format[offset] ==
'I')
5795 res =
wait_file(chan, ints,
"digits/pt-a", lang);
5797 res =
wait_file(chan, ints,
"digits/pt-meianoite", lang);
5798 }
else if (tm.
tm_hour == 12) {
5799 if (format[offset] ==
'I')
5800 res =
wait_file(chan, ints,
"digits/pt-ao", lang);
5802 res =
wait_file(chan, ints,
"digits/pt-meiodia", lang);
5804 if (format[offset] ==
'I') {
5806 res =
wait_file(chan, ints,
"digits/pt-as", lang);
5808 res =
wait_file(chan, ints,
"digits/pt-a", lang);
5818 if ((!res) && (format[offset] ==
'H')) {
5820 res =
wait_file(chan,ints,
"digits/hours",lang);
5822 res =
wait_file(chan,ints,
"digits/hour",lang);
5831 res =
wait_file(chan,ints,
"digits/minutes",lang);
5833 res =
wait_file(chan,ints,
"digits/minute",lang);
5840 if (!strcasecmp(lang,
"pt_BR")) {
5842 res =
wait_file(chan, ints,
"digits/pt-da", lang);
5845 res =
wait_file(chan, ints,
"digits/morning", lang);
5847 res =
wait_file(chan, ints,
"digits/afternoon", lang);
5848 else res =
wait_file(chan, ints,
"digits/night", lang);
5853 res =
wait_file(chan, ints,
"digits/p-m", lang);
5855 res =
wait_file(chan, ints,
"digits/a-m", lang);
5872 if (beg_today < t) {
5874 res =
wait_file(chan, ints,
"digits/today", lang);
5875 }
else if (beg_today - 86400 < t) {
5877 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5897 if (beg_today < t) {
5899 }
else if ((beg_today - 86400) < t) {
5901 res =
wait_file(chan, ints,
"digits/yesterday", lang);
5902 }
else if (beg_today - 86400 * 6 < t) {
5918 res =
wait_file(chan,ints,
"digits/seconds",lang);
5920 res =
wait_file(chan,ints,
"digits/second",lang);
5933 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
5946 struct timeval when = { t, 0 };
5948 int res=0, offset, sndoffset;
5949 char sndfile[256], nextmsg[256];
5956 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
5957 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
5958 switch (format[offset]) {
5962 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
5963 sndfile[sndoffset] = format[offset];
5965 sndfile[sndoffset] =
'\0';
5966 res =
wait_file(chan, ints, sndfile, lang);
5971 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
5972 res =
wait_file(chan, ints, nextmsg, lang);
5979 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
5980 res =
wait_file(chan, ints, nextmsg, lang);
5986 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_mday);
5987 res =
wait_file(chan, ints, nextmsg, lang);
5989 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_mday - (tm.
tm_mday % 10));
5990 res =
wait_file(chan, ints, nextmsg, lang);
5992 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_mday % 10);
5993 res =
wait_file(chan, ints, nextmsg, lang);
5996 if (!res) res =
wait_file(chan, ints,
"digits/day", lang);
6001 res =
wait_file(chan, ints,
"digits/2", lang);
6003 res =
wait_file(chan, ints,
"digits/thousand", lang);
6007 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", (tm.
tm_year - 100) / 10);
6008 res =
wait_file(chan, ints, nextmsg, lang);
6010 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", (tm.
tm_year - 100) % 10);
6011 res =
wait_file(chan, ints, nextmsg, lang);
6016 res =
wait_file(chan, ints,
"digits/year", lang);
6023 res =
wait_file(chan, ints,
"digits/1", lang);
6025 res =
wait_file(chan, ints,
"digits/9", lang);
6030 res =
wait_file(chan, ints,
"digits/0", lang);
6032 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year);
6033 res =
wait_file(chan, ints, nextmsg, lang);
6037 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year / 10);
6038 res =
wait_file(chan, ints, nextmsg, lang);
6040 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_year % 10);
6041 res =
wait_file(chan, ints, nextmsg, lang);
6047 res =
wait_file(chan, ints,
"digits/year", lang);
6057 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
6059 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
6060 res =
wait_file(chan, ints, nextmsg, lang);
6062 res =
wait_file(chan, ints,
"digits/oclock", lang);
6067 res =
wait_file(chan, ints,
"digits/0", lang);
6075 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
6076 res =
wait_file(chan, ints, nextmsg, lang);
6078 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - (tm.
tm_hour % 10));
6079 res =
wait_file(chan, ints, nextmsg, lang);
6081 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour % 10);
6082 res =
wait_file(chan, ints, nextmsg, lang);
6086 res =
wait_file(chan, ints,
"digits/oclock", lang);
6093 res =
wait_file(chan, ints,
"digits/0", lang);
6095 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_min);
6096 res =
wait_file(chan, ints, nextmsg, lang);
6098 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_min - (tm.
tm_min % 10));
6099 res =
wait_file(chan, ints, nextmsg, lang);
6101 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_min % 10);
6102 res =
wait_file(chan, ints, nextmsg, lang);
6106 res =
wait_file(chan, ints,
"digits/minute", lang);
6116 res =
wait_file(chan, ints, nextmsg, lang);
6132 if (beg_today < t) {
6134 res =
wait_file(chan, ints,
"digits/today", lang);
6135 }
else if (beg_today - 86400 < t) {
6137 res =
wait_file(chan, ints,
"digits/yesterday", lang);
6157 if (beg_today < t) {
6159 }
else if ((beg_today - 86400) < t) {
6161 res =
wait_file(chan, ints,
"digits/yesterday", lang);
6162 }
else if (beg_today - 86400 * 6 < t) {
6177 res =
wait_file(chan, ints,
"digits/0", lang);
6179 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec);
6180 res =
wait_file(chan, ints, nextmsg, lang);
6182 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec - (tm.
tm_sec % 10));
6183 res =
wait_file(chan, ints, nextmsg, lang);
6185 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_sec % 10);
6186 res =
wait_file(chan, ints, nextmsg, lang);
6190 res =
wait_file(chan, ints,
"digits/second", lang);
6202 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
6214 if (!strncasecmp(lang,
"en", 2)) {
6216 }
else if (!strncasecmp(lang,
"de", 2)) {
6218 }
else if (!strncasecmp(lang,
"es", 2)) {
6220 }
else if (!strncasecmp(lang,
"fr", 2)) {
6222 }
else if (!strncasecmp(lang,
"ge", 2)) {
6223 static int deprecation_warning = 0;
6224 if (deprecation_warning++ % 10 == 0) {
6225 ast_log(
LOG_WARNING,
"ge is not a standard language code. Please switch to using ka instead.\n");
6228 }
else if (!strncasecmp(lang,
"gr", 2)) {
6230 }
else if (!strncasecmp(lang,
"he", 2)) {
6232 }
else if (!strncasecmp(lang,
"hu", 2)) {
6234 }
else if (!strncasecmp(lang,
"ka", 2)) {
6236 }
else if (!strncasecmp(lang,
"nl", 2)) {
6238 }
else if (!strncasecmp(lang,
"pt_BR", 5)) {
6240 }
else if (!strncasecmp(lang,
"pt", 2)) {
6242 }
else if (!strncasecmp(lang,
"th", 2)) {
6244 }
else if (!strncasecmp(lang,
"tw", 2)) {
6245 static int deprecation_warning = 0;
6246 if (deprecation_warning++ % 10 == 0) {
6247 ast_log(
LOG_WARNING,
"tw is a standard language code for Twi, not Taiwanese. Please switch to using zh_TW instead.\n");
6250 }
else if (!strncasecmp(lang,
"zh", 2)) {
6261 struct timeval when = { t, 0 };
6270 else if (hour == 12)
6272 else if (hour > 12) {
6310 struct timeval when = { t, 0 };
6330 struct timeval when = { t, 0 };
6338 res =
wait_file(chan, ints,
"digits/hours", lang);
6340 res =
wait_file(chan, ints,
"digits/hour", lang);
6342 if ((!res) && (tm.
tm_min)) {
6343 res =
wait_file(chan, ints,
"digits/and", lang);
6348 res =
wait_file(chan, ints,
"digits/minutes", lang);
6350 res =
wait_file(chan, ints,
"digits/minute", lang);
6359 struct timeval when = { t, 0 };
6382 struct timeval when = { t, 0 };
6401 struct timeval when = { t, 0 };
6421 struct timeval when = { t, 0 };
6432 res =
wait_file(chan, ints,
"digits/and", lang);
6438 res =
wait_file(chan, ints,
"digits/hour", lang);
6440 res =
wait_file(chan, ints,
"digits/hours", lang);
6451 struct timeval when = { t, 0 };
6460 res =
wait_file(chan, ints,
"digits/hours", lang);
6462 res =
wait_file(chan, ints,
"digits/hour", lang);
6464 if ((!res) && (tm.
tm_min)) {
6465 res =
wait_file(chan, ints,
"digits/and", lang);
6470 res =
wait_file(chan, ints,
"digits/minutes", lang);
6472 res =
wait_file(chan, ints,
"digits/minute", lang);
6481 struct timeval when = { t, 0 };
6499 struct timeval when = { t, 0 };
6508 else if (hour == 12)
6510 else if (hour > 12) {
6541 struct timeval when = { t, 0 };
6575 if (!strncasecmp(lang,
"en", 2)) {
6577 }
else if (!strncasecmp(lang,
"de", 2)) {
6579 }
else if (!strncasecmp(lang,
"fr", 2)) {
6581 }
else if (!strncasecmp(lang,
"ge", 2)) {
6582 static int deprecation_warning = 0;
6583 if (deprecation_warning++ % 10 == 0) {
6584 ast_log(
LOG_WARNING,
"ge is not a standard language code. Please switch to using ka instead.\n");
6587 }
else if (!strncasecmp(lang,
"gr", 2)) {
6589 }
else if (!strncasecmp(lang,
"he", 2)) {
6591 }
else if (!strncasecmp(lang,
"hu", 2)) {
6593 }
else if (!strncasecmp(lang,
"ka", 2)) {
6595 }
else if (!strncasecmp(lang,
"nl", 2)) {
6597 }
else if (!strncasecmp(lang,
"pt_BR", 5)) {
6599 }
else if (!strncasecmp(lang,
"pt", 2)) {
6601 }
else if (!strncasecmp(lang,
"th", 2)) {
6603 }
else if (!strncasecmp(lang,
"tw", 2)) {
6604 static int deprecation_warning = 0;
6605 if (deprecation_warning++ % 10 == 0) {
6606 ast_log(
LOG_WARNING,
"tw is a standard language code for Twi, not Taiwanese. Please switch to using zh_TW instead.\n");
6609 }
else if (!strncasecmp(lang,
"zh", 2)) {
6620 struct timeval when = { t, 0 };
6628 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
6634 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
6645 else if (hour == 12)
6647 else if (hour > 12) {
6687 struct timeval when = { t, 0 };
6702 struct timeval when = { t, 0 };
6716 struct timeval when = { t, 0 };
6727 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
6733 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
6757 struct timeval when = { t, 0 };
6776 struct timeval when = { t, 0 };
6784 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
6790 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
6801 else if (hour == 12)
6803 else if (hour > 12) {
6843 struct timeval when = { t, 0 };
6857 struct timeval when = { t, 0 };
6864 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
6870 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
6900 struct timeval when = { t, 0 };
6910 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
6918 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
6927 else if (hour == 12)
6929 else if (hour > 12) {
6960 struct timeval when = { t, 0 };
6968 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
6975 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
7024 if (!strncasecmp(lang,
"en", 2)) {
7026 }
else if (!strncasecmp(lang,
"fr", 2)) {
7028 }
else if (!strncasecmp(lang,
"ge", 2)) {
7029 static int deprecation_warning = 0;
7030 if (deprecation_warning++ % 10 == 0) {
7031 ast_log(
LOG_WARNING,
"ge is not a standard language code. Please switch to using ka instead.\n");
7034 }
else if (!strncasecmp(lang,
"he", 2)) {
7036 }
else if (!strncasecmp(lang,
"ka", 2)) {
7038 }
else if (!strncasecmp(lang,
"pt", 2)) {
7050 struct timeval nowtv =
ast_tvnow(), when = { t, 0 };
7059 if ((daydiff < 0) || (daydiff > 6)) {
7062 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
7070 }
else if (daydiff) {
7073 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
7088 struct timeval nowtv =
ast_tvnow(), when = { t, 0 };
7097 if ((daydiff < 0) || (daydiff > 6)) {
7100 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
7108 }
else if (daydiff) {
7111 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
7129 struct timeval nowtv =
ast_tvnow(), when = { t, 0 };
7135 if ((daydiff < 0) || (daydiff > 6)) {
7140 res =
wait_file(chan, ints,
"digits/pt-de", lang);
7141 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
7145 }
else if (daydiff) {
7147 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
7152 snprintf(fn,
sizeof(fn),
"digits/pt-as");
7154 snprintf(fn,
sizeof(fn),
"digits/pt-a");
7166 struct timeval nowt =
ast_tvnow(), when = { t, 0 };
7175 if ((daydiff < 0) || (daydiff > 6)) {
7178 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
7186 }
else if (daydiff) {
7189 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
7216 snprintf(fn,
sizeof(fn),
"digits/female-%d", num);
7218 }
else if (num < 13) {
7220 }
else if (num <100 ) {
7221 tmp = (num/10) * 10;
7223 snprintf(fn,
sizeof(fn),
"digits/%d", tmp);
7268 while (!res && num ) {
7271 snprintf(fn,
sizeof(fn),
"digits/%d", num);
7273 }
else if (num <= 100) {
7275 snprintf(fn,
sizeof(fn),
"digits/%d", (num /10) * 10);
7277 }
else if (num < 200) {
7279 snprintf(fn,
sizeof(fn),
"digits/hundred-100");
7281 }
else if (num < 1000) {
7283 snprintf(fn,
sizeof(fn),
"digits/hundred-%d", (num/100)*100);
7285 }
else if (num < 2000){
7286 snprintf(fn,
sizeof(fn),
"digits/xilia");
7290 if (num < 1000000) {
7295 snprintf(fn,
sizeof(fn),
"digits/thousands");
7297 if (num < 1000000000) {
7302 snprintf(fn,
sizeof(fn),
"digits/millions");
7304 ast_debug(1,
"Number '%d' is too big for me\n", num);
7311 if ((audiofd > -1) && (ctrlfd > -1))
7337 struct timeval when = { t, 0 };
7346 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
7357 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
7381 struct timeval when = { t, 0 };
7391 else if (hour == 12)
7393 else if (hour > 12) {
7428 struct timeval when = { t, 0 };
7437 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
7448 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
7460 struct timeval when = { t, 0 };
7462 int res=0, offset, sndoffset;
7463 char sndfile[256], nextmsg[256];
7466 format =
"AdBY 'digits/at' IMp";
7470 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
7471 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
7472 switch (format[offset]) {
7476 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
7477 sndfile[sndoffset] = format[offset];
7479 sndfile[sndoffset] =
'\0';
7480 res =
wait_file(chan, ints, sndfile, lang);
7485 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
7486 res =
wait_file(chan, ints, nextmsg, lang);
7492 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
7493 res =
wait_file(chan, ints, nextmsg, lang);
7543 res =
wait_file(chan, ints, nextmsg, lang);
7559 if (beg_today < t) {
7561 res =
wait_file(chan, ints,
"digits/today", lang);
7562 }
else if (beg_today - 86400 < t) {
7564 res =
wait_file(chan, ints,
"digits/yesterday", lang);
7584 if (beg_today < t) {
7586 }
else if ((beg_today - 86400) < t) {
7588 res =
wait_file(chan, ints,
"digits/yesterday", lang);
7589 }
else if (beg_today - 86400 * 6 < t) {
7603 res =
wait_file(chan, ints, nextmsg, lang);
7608 res =
wait_file(chan, ints, nextmsg, lang);
7619 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
7632 struct timeval when = { t, 0 };
7634 int res = 0, offset, sndoffset;
7635 char sndfile[256], nextmsg[256];
7638 format =
"A 'digits/day' eB 'digits/year' Y 'digits/at' k 'hours' M 'minutes' p";
7642 for (offset=0 ; format[offset] !=
'\0' ; offset++) {
7643 ast_debug(1,
"Parsing %c (offset %d) in %s\n", format[offset], offset, format);
7644 switch (format[offset]) {
7648 for (sndoffset = 0; !strchr(
"\'\0", format[++offset]) && (sndoffset <
sizeof(sndfile) - 1) ; sndoffset++) {
7649 sndfile[sndoffset] = format[offset];
7651 sndfile[sndoffset] =
'\0';
7652 res =
wait_file(chan, ints, sndfile, lang);
7657 snprintf(nextmsg,
sizeof(nextmsg),
"digits/day-%d", tm.
tm_wday);
7658 res =
wait_file(chan, ints, nextmsg, lang);
7664 snprintf(nextmsg,
sizeof(nextmsg),
"digits/mon-%d", tm.
tm_mon);
7665 res =
wait_file(chan, ints, nextmsg, lang);
7684 res =
wait_file(chan, ints,
"digits/19", lang);
7688 res =
wait_file(chan, ints,
"digits/odd", lang);
7701 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour - 12);
7703 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", tm.
tm_hour);
7704 res =
wait_file(chan, ints, nextmsg, lang);
7709 if (format[offset] ==
'H') {
7712 res =
wait_file(chan, ints,
"digits/0", lang);
7717 res =
wait_file(chan, ints,
"digits/0", lang);
7724 res =
wait_file(chan, ints,
"digits/20", lang);
7728 snprintf(nextmsg,
sizeof(nextmsg),
"digits/%d", remaining);
7729 res =
wait_file(chan, ints, nextmsg, lang);
7746 res =
wait_file(chan, ints, nextmsg, lang);
7758 gettimeofday(&now, NULL);
7763 if (beg_today < t) {
7765 res =
wait_file(chan, ints,
"digits/today", lang);
7766 }
else if (beg_today - 86400 < t) {
7768 res =
wait_file(chan, ints,
"digits/yesterday", lang);
7769 }
else if (beg_today - 86400 * 6 < t) {
7772 }
else if (beg_today - 2628000 < t) {
7775 }
else if (beg_today - 15768000 < t) {
7799 if (beg_today < t) {
7801 }
else if ((beg_today - 86400) < t) {
7803 res =
wait_file(chan, ints,
"digits/yesterday", lang);
7804 }
else if (beg_today - 86400 * 6 < t) {
7807 }
else if (beg_today - 2628000 < t) {
7810 }
else if (beg_today - 15768000 < t) {
7835 ast_log(
LOG_WARNING,
"Unknown character in datetime format %s: %c at pos %d\n", format, format[offset], offset);
7874 strncat(res,
"minus ", res_len - strlen(res) - 1);
7875 if ( num > INT_MIN ) {
7884 if (num <= 20 || num == 40 || num == 60 || num == 80 || num == 100) {
7885 snprintf(buf,
sizeof(buf),
"%d", num);
7886 strncat(res, buf, res_len - strlen(res) - 1);
7892 strncat(res,
"20_ ", res_len - strlen(res) - 1);
7897 strncat(res,
"40_ ", res_len - strlen(res) - 1);
7902 strncat(res,
"60_ ", res_len - strlen(res) - 1);
7907 strncat(res,
"80_ ", res_len - strlen(res) - 1);
7913 remaining = num % 100;
7914 digit = (num - remaining) / 100;
7916 if (remaining == 0) {
7917 snprintf(buf,
sizeof(buf),
"%d", num);
7918 strncat(res, buf, res_len - strlen(res) - 1);
7921 snprintf(buf,
sizeof(buf),
"%d_ ", digit*100);
7922 strncat(res, buf, res_len - strlen(res) - 1);
7929 strncat(res,
"1000", res_len - strlen(res) - 1);
7934 if (num < 1000000) {
7935 remaining = num % 1000;
7936 digit = (num - remaining) / 1000;
7938 if (remaining == 0) {
7940 strncat(res,
" 1000", res_len - strlen(res) - 1);
7945 strncat(res,
"1000_ ", res_len - strlen(res) - 1);
7950 strncat(res,
" 1000_ ", res_len - strlen(res) - 1);
7955 if (num == 1000000) {
7956 strncat(res,
"1 1000000", res_len - strlen(res) - 1);
7961 if (num < 1000000000) {
7962 remaining = num % 1000000;
7963 digit = (num - remaining) / 1000000;
7965 if (remaining == 0) {
7967 strncat(res,
" 1000000", res_len - strlen(res) - 1);
7972 strncat(res,
" 1000000_ ", res_len - strlen(res) - 1);
7977 if (num == 1000000000) {
7978 strncat(res,
"1 1000000000", res_len - strlen(res) - 1);
7983 if (num > 1000000000) {
7984 remaining = num % 1000000000;
7985 digit = (num - remaining) / 1000000000;
7987 if (remaining == 0) {
7989 strncat(res,
" 1000000000", res_len - strlen(res) - 1);
7994 strncat(res,
" 1000000000_ ", res_len - strlen(res) - 1);
8010 const char* remaining = fn;
8020 while (res == 0 && (s = strstr(remaining,
" "))) {
8021 size_t len = s - remaining;
8022 char* new_string =
ast_malloc(len + 1 + strlen(
"digits/"));
8024 sprintf(new_string,
"digits/");
8025 strncat(new_string, remaining, len);
8029 if ((audiofd > -1) && (ctrlfd > -1))
8039 while (*remaining ==
' ')
8045 if (res == 0 && *remaining) {
8047 char* new_string =
ast_malloc(strlen(remaining) + 1 + strlen(
"digits/"));
8048 sprintf(new_string,
"digits/%s", remaining);
8051 if ((audiofd > -1) && (ctrlfd > -1))
8084 struct timeval when = { t, 0 };
8094 snprintf(fn,
sizeof(fn),
"digits/tslis %d", tm.
tm_wday);
8108 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
8124 struct timeval when = { t, 0 };
8156 struct timeval when = { t, 0 };
8178 struct timeval when = { t, 0 }, nowt =
ast_tvnow();
8184 if ((daydiff < 0) || (daydiff > 6)) {
8189 snprintf(fn,
sizeof(fn),
"digits/mon-%d", tm.
tm_mon);
8195 }
else if (daydiff) {
8198 snprintf(fn,
sizeof(fn),
"digits/day-%d", tm.
tm_wday);
8222 if (num == 1 || num == -1) {
8250 if (num > 0 && num < 5) {
8262 if (!strncasecmp(chan->
language,
"ru", 2)) {
8264 }
else if (!strncasecmp(chan->
language,
"ua", 2)) {
8266 }
else if (!strncasecmp(chan->
language,
"pl", 2)) {
8271 temp =
ast_alloca((temp_len = (strlen(noun) + strlen(ending) + 1)));
8272 snprintf(temp, temp_len,
"%s%s", noun, ending);
8293 return gender ? gender :
"";
8304 if (!strncasecmp(chan->
language,
"ru", 2)) {
8306 }
else if (!strncasecmp(chan->
language,
"ua", 2)) {
8308 }
else if (!strncasecmp(chan->
language,
"pl", 2)) {
8313 temp =
ast_alloca((temp_len = (strlen(adjective) + strlen(ending) + 1)));
8314 snprintf(temp, temp_len,
"%s%s", adjective, ending);
static int ast_say_enumeration_full_vi(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd)
static int ast_say_datetime_from_now_he(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Main Channel structure associated with a channel.
static int ast_say_number_full_ur(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
static int say_character_str_full(struct ast_channel *chan, const char *str, const char *ints, const char *lang, int audiofd, int ctrlfd)
static int say_number_full(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
ast_say_number_full: call language-specific functions
static int wait_file(struct ast_channel *chan, const char *ints, const char *file, const char *lang)
int ast_streamfile(struct ast_channel *c, const char *filename, const char *preflang)
Streams a file.
Asterisk locking-related definitions:
static int ast_say_datetime_pt_BR(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Asterisk main include file. File version handling, generic pbx functions.
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_number_full_hu(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd)
ast_say_number_full_hu: Hungarian syntax
static char * ast_translate_number_ka(int num, char *res, int res_len)
static int ast_say_datetime_th(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
static int ast_say_enumeration_full_he(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
static int ast_say_date_fr(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
static int ast_say_time_ka(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
#define ast_alloca(size)
call __builtin_alloca to ensure we get gcc builtin semantics
static int ast_say_number_full_ru(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
ast_say_number_full_ru: Russian syntax
Time-related functions and macros.
static int ast_say_time_he(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
static int ast_say_datetime_nl(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)
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)
static int ast_say_date_th(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
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)
void ast_verbose(const char *fmt,...)
static int ast_say_datetime_ka(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
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
struct ast_tm * ast_localtime(const struct timeval *timep, struct ast_tm *p_tm, const char *zone)
Timezone-independent version of localtime_r(3).
int ast_say_digits_full(struct ast_channel *chan, int num, const char *ints, const char *lang, int audiofd, int ctrlfd)
static int ast_say_time_en(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
static int ast_say_enumeration_full_da(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
ast_say_enumeration_full_da: Danish syntax
static int say_datetime_from_now(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
static int ast_say_date_gr(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
static int ast_say_datetime_fr(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
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)
static int say_datetime(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
static int ast_say_date_en(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
static int ast_say_datetime_from_now_fr(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
static int ast_say_number_full_gr(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd)
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
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)
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
Generic File Format Support. Should be included by clients of the file handling routines. File service providers should instead include mod_format.h.
static int ast_say_number_full_it(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd)
ast_say_number_full_it: Italian
static int ast_say_datetime_en(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
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 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)
static int ast_say_date_nl(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
SAY_EXTERN int(* ast_say_datetime)(struct ast_channel *chan, time_t t, const char *ints, const char *lang) SAY_INIT(ast_say_datetime)
static int exp10_int(int power)
static int ast_say_datetime_from_now_pt(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
static int ast_say_date_ka(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Custom localtime functions for multiple timezones.
static int ast_say_number_full_fr(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
ast_say_number_full_fr: French syntax
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)
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
SAY_EXTERN int(* ast_say_date)(struct ast_channel *chan, time_t t, const char *ints, const char *lang) SAY_INIT(ast_say_date)
#define ast_debug(level,...)
Log a DEBUG message.
static int ast_say_datetime_pt(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
static int ast_say_date_es(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
int ast_play_and_wait(struct ast_channel *chan, const char *fn)
Play a stream and wait for a digit, returning the digit that was pressed.
static int ast_say_date_hu(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
int ast_say_counted_noun(struct ast_channel *chan, int num, const char *noun)
static int ast_say_time_th(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
General Asterisk PBX channel definitions.
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)
static int ast_say_number_full_cs(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
ast_say_number_full_cs: Czech syntax
static int ast_say_number_full_de(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
ast_say_number_full_de: German syntax
static int ast_say_number_full_pt(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
static char * pl_append(char *buffer, char *str)
static int say_date(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
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)
static int ast_say_time_de(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
static const char * counted_adjective_ending_ru(int num, const char gender[])
char * separator_dziesiatek
static int say_enumeration_full(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
ast_say_enumeration_full: call language-specific functions
static char language[MAX_LANGUAGE]
static char next_item(const char *format)
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)
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)
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 and Norwegian syntax
static int ast_say_datetime_zh(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
SAY_EXTERN int(* ast_say_phonetic_str_full)(struct ast_channel *chan, const char *num, const char *ints, const char *lang, int audiofd, int ctrlfd) SAY_INIT(ast_say_phonetic_str_full)
static int get_lastdigits_ru(int num)
determine last digits for thousands/millions (ru)
static int ast_say_date_he(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
static int ast_say_time_nl(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
static void __say_init(void)
static char * pl_rzad_na_tekst(odmiana *odm, int i, int rzad)
static void powiedz(struct ast_channel *chan, const char *language, int audiofd, int ctrlfd, const char *ints, odmiana *odm, int rzad, int i)
static int ast_say_datetime_de(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
static const char * counted_noun_ending_slavic(int num)
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
SAY_EXTERN int(* ast_say_character_str_full)(struct ast_channel *chan, const char *num, const char *ints, const char *lang, int audiofd, int ctrlfd) SAY_INIT(ast_say_character_str_full)
char * ast_skip_blanks(const char *str)
Gets a pointer to the first non-whitespace character in a string.
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
int ast_say_counted_adjective(struct ast_channel *chan, int num, const char *adjective, const char *gender)
static int ast_say_time_es(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
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)
static int say_date_with_format(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
static int ast_say_datetime_from_now_en(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
static int ast_say_number_full_es(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
ast_say_number_full_es: Spanish syntax
static int ast_say_number_full_da(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
ast_say_number_full_da: Danish syntax
static int ast_say_date_de(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
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_pt(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
static int ast_say_number_full_vi(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd)
ast_say_number_full_vi: Vietnamese syntax
static int ast_say_date_da(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
static int ast_say_time_pt(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
static int ast_say_time_fr(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
static int ast_say_time_pt_BR(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
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)
int ast_waitstream_full(struct ast_channel *c, const char *breakon, int audiofd, int monfd)
static int ast_say_number_full_th(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd)
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)
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)
int ast_say_number(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options)
says a number
static int say_digit_str_full(struct ast_channel *chan, const char *str, const char *ints, const char *lang, int audiofd, int ctrlfd)
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
static int ast_say_time_hu(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
static int say_time(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
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)
int ast_waitstream(struct ast_channel *c, const char *breakon)
Waits for a stream to stop or digit to be pressed.
int ast_fileexists(const char *filename, const char *fmt, const char *preflang)
Checks for the existence of a given file.
static int say_phonetic_str_full(struct ast_channel *chan, const char *str, const char *ints, const char *lang, int audiofd, int ctrlfd)
static int ast_say_datetime_hu(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
static int ast_say_number_full_zh(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd)
ast_say_number_full_zh: Taiwanese / Chinese syntax
static int ast_say_time_zh(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
static const char * counted_noun_ending_en(int num)
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)
static void pl_odtworz_plik(struct ast_channel *chan, const char *language, int audiofd, int ctrlfd, const char *ints, char *fn)
SAY_EXTERN int(* ast_say_time)(struct ast_channel *chan, time_t t, const char *ints, const char *lang) SAY_INIT(ast_say_time)
static int ast_say_datetime_from_now_ka(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
static int ast_say_datetime_gr(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
int ast_say_enumeration(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options)
says an enumeration
static int ast_say_time_gr(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
Say numbers and dates (maybe words one day too)
static int ast_say_number_full_en(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd)
ast_say_number_full_en: English syntax
static int ast_say_number_full_ka(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
ast_say_number_full_ka: Georgian syntax
static snd_pcm_format_t format
static int ast_say_datetime_he(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
static int gr_say_number_female(int num, struct ast_channel *chan, const char *ints, const char *lang)
const ast_string_field language
static int ast_say_number_full_pl(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
int ast_stopstream(struct ast_channel *c)
Stops a stream.
#define ASTERISK_FILE_VERSION(file, version)
Register/unregister a source code file with the core.
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)
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)