Index: res/res_agi.c =================================================================== RCS file: /usr/cvsroot/asterisk/res/res_agi.c,v retrieving revision 1.31 diff -u -r1.31 res_agi.c --- res/res_agi.c 30 Mar 2005 07:00:49 -0000 1.31 +++ res/res_agi.c 7 Apr 2005 23:49:38 -0000 @@ -649,6 +649,43 @@ return RESULT_FAILURE; } +static int handle_saydatetime(struct ast_channel *chan, AGI *agi, int argc, char *argv[]) +{ + int res=0; + long unixtime; + char *format, *zone=NULL; + + if (argc < 4) + return RESULT_SHOWUSAGE; + + if (argc > 4) { + format = argv[4]; + } else { + if (!strcasecmp(chan->language, "de")) { + format = "A dBY HMS"; + } else { + format = "ABdY 'digits/at' IMp"; + } + } + + if (argc > 5 && !ast_strlen_zero(argv[5])) + zone = argv[5]; + + if (sscanf(argv[2], "%ld", &unixtime) != 1) + return RESULT_SHOWUSAGE; + + res = ast_say_date_with_format(chan, (time_t) unixtime, argv[3], chan->language, format, zone); + if (res == 1) + return RESULT_SUCCESS; + + fdprintf(agi->fd, "200 result=%d\n", res); + + if (res >= 0) + return RESULT_SUCCESS; + else + return RESULT_FAILURE; +} + static int handle_sayphonetic(struct ast_channel *chan, AGI *agi, int argc, char *argv[]) { int res; @@ -1389,6 +1426,17 @@ " completes without a digit being pressed, or the ASCII numerical value of the\n" " digit if one was pressed or -1 on error/hangup.\n"; +static char usage_saydatetime[] = +" Usage: SAY DATETIME