static int say_date_with_format(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone)
{
- /* If no format is given, use default english format */
- if (format == NULL)
- format = "ABdY 'digits/at' IMp";
-
if (!strcasecmp(lang, "en") ) { /* English syntax */
return(ast_say_date_with_format_en(chan, time, ints, lang, format, timezone));
} else if (!strcasecmp(lang, "da") ) { /* Danish syntax */
int res=0, offset, sndoffset;
char sndfile[256], nextmsg[256];
+ if (format == NULL)
+ format = "ABdY 'digits/at' IMp";
+
ast_localtime(&time,&tm,timezone);
for (offset=0 ; format[offset] != '\0' ; offset++) {
int res=0, offset, sndoffset;
char sndfile[256], nextmsg[256];
+ if (!format)
+ format = "A dBY HMS";
+
ast_localtime(&time,&tm,timezone);
for (offset=0 ; format[offset] != '\0' ; offset++) {
/* Yesterday */
res = wait_file(chan,ints, "digits/yesterday",lang);
} else {
- res = ast_say_date_with_format(chan, time, ints, lang, "AdBY", timezone);
+ res = ast_say_date_with_format_da(chan, time, ints, lang, "AdBY", timezone);
}
}
break;
res = wait_file(chan,ints, "digits/yesterday",lang);
} else if (beg_today - 86400 * 6 < time) {
/* Within the last week */
- res = ast_say_date_with_format(chan, time, ints, lang, "A", timezone);
+ res = ast_say_date_with_format_da(chan, time, ints, lang, "A", timezone);
} else {
- res = ast_say_date_with_format(chan, time, ints, lang, "AdBY", timezone);
+ res = ast_say_date_with_format_da(chan, time, ints, lang, "AdBY", timezone);
}
}
break;
case 'R':
- res = ast_say_date_with_format(chan, time, ints, lang, "HM", timezone);
+ res = ast_say_date_with_format_da(chan, time, ints, lang, "HM", timezone);
break;
case 'S':
/* Seconds */
}
break;
case 'T':
- res = ast_say_date_with_format(chan, time, ints, lang, "HMS", timezone);
+ res = ast_say_date_with_format_da(chan, time, ints, lang, "HMS", timezone);
break;
case ' ':
case ' ':
int res=0, offset, sndoffset;
char sndfile[256], nextmsg[256];
+ if (!format)
+ format = "A dBY HMS";
+
ast_localtime(&time,&tm,timezone);
for (offset=0 ; format[offset] != '\0' ; offset++) {
/* Yesterday */
res = wait_file(chan,ints, "digits/yesterday",lang);
} else {
- res = ast_say_date_with_format(chan, time, ints, lang, "AdBY", timezone);
+ res = ast_say_date_with_format_de(chan, time, ints, lang, "AdBY", timezone);
}
}
break;
res = wait_file(chan,ints, "digits/yesterday",lang);
} else if (beg_today - 86400 * 6 < time) {
/* Within the last week */
- res = ast_say_date_with_format(chan, time, ints, lang, "A", timezone);
+ res = ast_say_date_with_format_de(chan, time, ints, lang, "A", timezone);
} else {
- res = ast_say_date_with_format(chan, time, ints, lang, "AdBY", timezone);
+ res = ast_say_date_with_format_de(chan, time, ints, lang, "AdBY", timezone);
}
}
break;
case 'R':
- res = ast_say_date_with_format(chan, time, ints, lang, "HM", timezone);
+ res = ast_say_date_with_format_de(chan, time, ints, lang, "HM", timezone);
break;
case 'S':
/* Seconds */
}
break;
case 'T':
- res = ast_say_date_with_format(chan, time, ints, lang, "HMS", timezone);
+ res = ast_say_date_with_format_de(chan, time, ints, lang, "HMS", timezone);
break;
case ' ':
case ' ':
int res=0, offset, sndoffset;
char sndfile[256], nextmsg[256];
+ if (!format)
+ format = IL_DATE_STR_FULL;
+
ast_localtime(&time,&tm,timezone);
for (offset=0 ; format[offset] != '\0' ; offset++) {
}
break;
case 'R':
- res = ast_say_date_with_format(chan, time, ints, lang, "HM", timezone);
+ res = ast_say_date_with_format_he(chan, time, ints, lang, "HM", timezone);
break;
case 'S': /* Seconds */
res = ast_say_number_full_he(chan, tm.tm_sec,
);
break;
case 'T':
- res = ast_say_date_with_format(chan, time, ints, lang, "HMS", timezone);
+ res = ast_say_date_with_format_he(chan, time, ints, lang, "HMS", timezone);
break;
/* c, x, and X seem useful for testing. Not sure
* if thiey're good for the general public */
- case 'c':
+ case 'c':
res = ast_say_date_with_format_he(chan, time,
ints, lang, IL_DATE_STR_FULL, timezone);
break;
- case 'x':
+ case 'x':
res = ast_say_date_with_format_he(chan, time,
ints, lang, IL_DATE_STR, timezone);
break;
- case 'X': /* Currently not locale-dependent...*/
+ case 'X': /* Currently not locale-dependent...*/
res = ast_say_date_with_format_he(chan, time,
ints, lang, IL_TIME_STR, timezone);
break;
int res=0, offset, sndoffset;
char sndfile[256], nextmsg[256];
+ if (format == NULL)
+ format = "'digits/es-el' Ad 'digits/es-de' B 'digits/es-de' Y 'digits/at' IMp";
+
ast_localtime(&time,&tm,timezone);
for (offset=0 ; format[offset] != '\0' ; offset++) {
/* Yesterday */
res = wait_file(chan,ints, "digits/yesterday",lang);
} else {
- res = ast_say_date_with_format(chan, time, ints, lang, "'digits/es-el' Ad 'digits/es-de' B 'digits/es-de' Y", timezone);
+ res = ast_say_date_with_format_es(chan, time, ints, lang, "'digits/es-el' Ad 'digits/es-de' B 'digits/es-de' Y", timezone);
}
}
break;
res = wait_file(chan,ints, "digits/yesterday",lang);
} else if (beg_today - 86400 * 6 < time) {
/* Within the last week */
- res = ast_say_date_with_format(chan, time, ints, lang, "A", timezone);
+ res = ast_say_date_with_format_es(chan, time, ints, lang, "A", timezone);
} else {
- res = ast_say_date_with_format(chan, time, ints, lang, "'digits/es-el' Ad 'digits/es-de' B 'digits/es-de' Y", timezone);
+ res = ast_say_date_with_format_es(chan, time, ints, lang, "'digits/es-el' Ad 'digits/es-de' B 'digits/es-de' Y", timezone);
}
}
break;
case 'R':
- res = ast_say_date_with_format(chan, time, ints, lang, "H 'digits/y' M", timezone);
+ res = ast_say_date_with_format_es(chan, time, ints, lang, "H 'digits/y' M", timezone);
break;
case 'S':
/* Seconds */
}
break;
case 'T':
- res = ast_say_date_with_format(chan, time, ints, lang, "HMS", timezone);
+ res = ast_say_date_with_format_es(chan, time, ints, lang, "HMS", timezone);
break;
case ' ':
case ' ':
int res=0, offset, sndoffset;
char sndfile[256], nextmsg[256];
+ if (format == NULL)
+ format = "AdBY 'digits/at' IMp";
+
ast_localtime(&time,&tm,timezone);
for (offset=0 ; format[offset] != '\0' ; offset++) {
/* Yesterday */
res = wait_file(chan,ints, "digits/yesterday",lang);
} else {
- res = ast_say_date_with_format(chan, time, ints, lang, "AdBY", timezone);
+ res = ast_say_date_with_format_fr(chan, time, ints, lang, "AdBY", timezone);
}
}
break;
res = wait_file(chan,ints, "digits/yesterday",lang);
} else if (beg_today - 86400 * 6 < time) {
/* Within the last week */
- res = ast_say_date_with_format(chan, time, ints, lang, "A", timezone);
+ res = ast_say_date_with_format_fr(chan, time, ints, lang, "A", timezone);
} else {
- res = ast_say_date_with_format(chan, time, ints, lang, "AdBY", timezone);
+ res = ast_say_date_with_format_fr(chan, time, ints, lang, "AdBY", timezone);
}
}
break;
case 'R':
- res = ast_say_date_with_format(chan, time, ints, lang, "HM", timezone);
+ res = ast_say_date_with_format_fr(chan, time, ints, lang, "HM", timezone);
break;
case 'S':
/* Seconds */
}
break;
case 'T':
- res = ast_say_date_with_format(chan, time, ints, lang, "HMS", timezone);
+ res = ast_say_date_with_format_fr(chan, time, ints, lang, "HMS", timezone);
break;
case ' ':
case ' ':
int res=0, offset, sndoffset;
char sndfile[256], nextmsg[256];
+ if (format == NULL)
+ format = "AdB 'digits/at' IMp";
+
ast_localtime(&time,&tm,timezone);
for (offset=0 ; format[offset] != '\0' ; offset++) {
/* Yesterday */
res = wait_file(chan,ints, "digits/yesterday",lang);
} else {
- res = ast_say_date_with_format(chan, time, ints, lang, "AdB", timezone);
+ res = ast_say_date_with_format_it(chan, time, ints, lang, "AdB", timezone);
}
}
break;
res = wait_file(chan,ints, "digits/yesterday",lang);
} else if (beg_today - 86400 * 6 < time) {
/* Within the last week */
- res = ast_say_date_with_format(chan, time, ints, lang, "A", timezone);
+ res = ast_say_date_with_format_it(chan, time, ints, lang, "A", timezone);
} else {
- res = ast_say_date_with_format(chan, time, ints, lang, "AdB", timezone);
+ res = ast_say_date_with_format_it(chan, time, ints, lang, "AdB", timezone);
}
}
break;
case 'R':
- res = ast_say_date_with_format(chan, time, ints, lang, "HM", timezone);
+ res = ast_say_date_with_format_it(chan, time, ints, lang, "HM", timezone);
break;
case 'S':
/* Seconds */
}
break;
case 'T':
- res = ast_say_date_with_format(chan, time, ints, lang, "HMS", timezone);
+ res = ast_say_date_with_format_it(chan, time, ints, lang, "HMS", timezone);
break;
case ' ':
case ' ':
int res=0, offset, sndoffset;
char sndfile[256], nextmsg[256];
+ if (format == NULL)
+ format = "ABdY 'digits/at' IMp";
+
ast_localtime(&time,&tm,timezone);
for (offset=0 ; format[offset] != '\0' ; offset++) {
/* Yesterday */
res = wait_file(chan,ints, "digits/yesterday",lang);
} else {
- res = ast_say_date_with_format(chan, time, ints, lang, "ABdY", timezone);
+ res = ast_say_date_with_format_nl(chan, time, ints, lang, "ABdY", timezone);
}
}
break;
res = wait_file(chan,ints, "digits/yesterday",lang);
} else if (beg_today - 86400 * 6 < time) {
/* Within the last week */
- res = ast_say_date_with_format(chan, time, ints, lang, "A", timezone);
+ res = ast_say_date_with_format_nl(chan, time, ints, lang, "A", timezone);
} else {
- res = ast_say_date_with_format(chan, time, ints, lang, "ABdY", timezone);
+ res = ast_say_date_with_format_nl(chan, time, ints, lang, "ABdY", timezone);
}
}
break;
case 'R':
- res = ast_say_date_with_format(chan, time, ints, lang, "HM", timezone);
+ res = ast_say_date_with_format_nl(chan, time, ints, lang, "HM", timezone);
break;
case 'S':
/* Seconds */
}
break;
case 'T':
- res = ast_say_date_with_format(chan, time, ints, lang, "HMS", timezone);
+ res = ast_say_date_with_format_nl(chan, time, ints, lang, "HMS", timezone);
break;
case ' ':
case ' ':
int res=0, offset, sndoffset;
char sndfile[256], nextmsg[256];
+ if (format == NULL)
+ format = "Ad 'digits/pt-de' B 'digits/pt-de' Y 'digits/at' IMp";
+
ast_localtime(&time,&tm,timezone);
for (offset=0 ; format[offset] != '\0' ; offset++) {
/* Yesterday */
res = wait_file(chan,ints, "digits/yesterday",lang);
} else {
- res = ast_say_date_with_format(chan, time, ints, lang, "Ad 'digits/pt-de' B 'digits/pt-de' Y", timezone);
+ res = ast_say_date_with_format_pt(chan, time, ints, lang, "Ad 'digits/pt-de' B 'digits/pt-de' Y", timezone);
}
}
break;
res = wait_file(chan,ints, "digits/yesterday",lang);
} else if (beg_today - 86400 * 6 < time) {
/* Within the last week */
- res = ast_say_date_with_format(chan, time, ints, lang, "A", timezone);
+ res = ast_say_date_with_format_pt(chan, time, ints, lang, "A", timezone);
} else {
- res = ast_say_date_with_format(chan, time, ints, lang, "Ad 'digits/pt-de' B 'digits/pt-de' Y", timezone);
+ res = ast_say_date_with_format_pt(chan, time, ints, lang, "Ad 'digits/pt-de' B 'digits/pt-de' Y", timezone);
}
}
break;
case 'R':
- res = ast_say_date_with_format(chan, time, ints, lang, "H 'digits/pt-e' M", timezone);
+ res = ast_say_date_with_format_pt(chan, time, ints, lang, "H 'digits/pt-e' M", timezone);
break;
case 'S':
/* Seconds */
}
break;
case 'T':
- res = ast_say_date_with_format(chan, time, ints, lang, "HMS", timezone);
+ res = ast_say_date_with_format_pt(chan, time, ints, lang, "HMS", timezone);
break;
case ' ':
case ' ':
int res=0, offset, sndoffset;
char sndfile[256], nextmsg[256];
+ if (format == NULL)
+ format = "YBdA 'digits/at' HM";
+
ast_localtime(&time,&tm,timezone);
for (offset=0 ; format[offset] != '\0' ; offset++) {
/* Yesterday */
res = wait_file(chan,ints, "digits/yesterday",lang);
} else {
- res = ast_say_date_with_format(chan, time, ints, lang, "YBdA", timezone);
+ res = ast_say_date_with_format_tw(chan, time, ints, lang, "YBdA", timezone);
}
}
break;
res = wait_file(chan,ints, "digits/yesterday",lang);
} else if (beg_today - 86400 * 6 < time) {
/* Within the last week */
- res = ast_say_date_with_format(chan, time, ints, lang, "A", timezone);
+ res = ast_say_date_with_format_tw(chan, time, ints, lang, "A", timezone);
} else {
- res = ast_say_date_with_format(chan, time, ints, lang, "YBdA", timezone);
+ res = ast_say_date_with_format_tw(chan, time, ints, lang, "YBdA", timezone);
}
}
break;
case 'R':
- res = ast_say_date_with_format(chan, time, ints, lang, "HM", timezone);
+ res = ast_say_date_with_format_tw(chan, time, ints, lang, "HM", timezone);
break;
case 'S':
/* Seconds */
}
break;
case 'T':
- res = ast_say_date_with_format(chan, time, ints, lang, "HMS", timezone);
+ res = ast_say_date_with_format_tw(chan, time, ints, lang, "HMS", timezone);
break;
case ' ':
case ' ':
struct tm tm;
int res=0, offset, sndoffset;
char sndfile[256], nextmsg[256];
-
+
+ if (!format)
+ format = "AdBY 'digits/at' IMp";
+
ast_localtime(&time,&tm,timezone);
for (offset=0 ; format[offset] != '\0' ; offset++) {
/* Yesterday */
res = wait_file(chan,ints, "digits/yesterday",lang);
} else {
- res = ast_say_date_with_format(chan, time, ints, lang, "AdBY", timezone);
+ res = ast_say_date_with_format_gr(chan, time, ints, lang, "AdBY", timezone);
}
}
break;
res = wait_file(chan,ints, "digits/yesterday",lang);
} else if (beg_today - 86400 * 6 < time) {
/* Within the last week */
- res = ast_say_date_with_format(chan, time, ints, lang, "A", timezone);
+ res = ast_say_date_with_format_gr(chan, time, ints, lang, "A", timezone);
} else {
- res = ast_say_date_with_format(chan, time, ints, lang, "AdBY", timezone);
+ res = ast_say_date_with_format_gr(chan, time, ints, lang, "AdBY", timezone);
}
}
break;
case 'R':
- res = ast_say_date_with_format(chan, time, ints, lang, "HM", timezone);
+ res = ast_say_date_with_format_gr(chan, time, ints, lang, "HM", timezone);
break;
case 'S':
/* Seconds */
res = wait_file(chan,ints,nextmsg,lang);
break;
case 'T':
- res = ast_say_date_with_format(chan, time, ints, lang, "HMS", timezone);
+ res = ast_say_date_with_format_gr(chan, time, ints, lang, "HMS", timezone);
break;
case ' ':
case ' ':