Add schedule extensions to app_meetme. In addition, the reporter found a

problem within strptime(3), which we are correcting here with ast_strptime().
(closes issue #11040)
 Reported by: DEA
 Patches: 
       20080910__bug11040.diff.txt uploaded by Corydon76 (license 14)
 Tested by: DEA


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@145649 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2008-10-01 23:02:25 +00:00
parent 7eae109418
commit 529874de7b
4 changed files with 410 additions and 138 deletions

View File

@@ -691,10 +691,7 @@ static int acf_strptime(struct ast_channel *chan, const char *cmd, char *data,
AST_APP_ARG(timezone);
AST_APP_ARG(format);
);
union {
struct ast_tm atm;
struct tm time;
} t = { { 0, }, };
struct ast_tm tm;
buf[0] = '\0';
@@ -712,13 +709,11 @@ static int acf_strptime(struct ast_channel *chan, const char *cmd, char *data,
return -1;
}
if (!strptime(args.timestring, args.format, &t.time)) {
ast_log(LOG_WARNING, "C function strptime() output nothing?!!\n");
if (!ast_strptime(args.timestring, args.format, &tm)) {
ast_log(LOG_WARNING, "STRPTIME() found no time specified within the string\n");
} else {
struct timeval when;
/* Since strptime(3) does not check DST, force ast_mktime() to calculate it. */
t.atm.tm_isdst = -1;
when = ast_mktime(&t.atm, args.timezone);
when = ast_mktime(&tm, args.timezone);
snprintf(buf, buflen, "%d", (int) when.tv_sec);
}