Merge in ast_strftime branch, which changes timestamps to be accurate to the microsecond, instead of only to the second

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75706 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2007-07-18 19:47:20 +00:00
parent b96fde308c
commit 81bc1d7af5
40 changed files with 701 additions and 654 deletions

View File

@@ -103,8 +103,7 @@ static int load_config(void)
static int manager_log(struct ast_cdr *cdr)
{
time_t t;
struct tm timeresult;
struct ast_tm timeresult;
char strStartTime[80] = "";
char strAnswerTime[80] = "";
char strEndTime[80] = "";
@@ -114,19 +113,16 @@ static int manager_log(struct ast_cdr *cdr)
if (!enablecdr)
return 0;
t = cdr->start.tv_sec;
ast_localtime(&t, &timeresult, NULL);
strftime(strStartTime, sizeof(strStartTime), DATE_FORMAT, &timeresult);
ast_localtime(&cdr->start, &timeresult, NULL);
ast_strftime(strStartTime, sizeof(strStartTime), DATE_FORMAT, &timeresult);
if (cdr->answer.tv_sec) {
t = cdr->answer.tv_sec;
ast_localtime(&t, &timeresult, NULL);
strftime(strAnswerTime, sizeof(strAnswerTime), DATE_FORMAT, &timeresult);
ast_localtime(&cdr->answer, &timeresult, NULL);
ast_strftime(strAnswerTime, sizeof(strAnswerTime), DATE_FORMAT, &timeresult);
}
t = cdr->end.tv_sec;
ast_localtime(&t, &timeresult, NULL);
strftime(strEndTime, sizeof(strEndTime), DATE_FORMAT, &timeresult);
ast_localtime(&cdr->end, &timeresult, NULL);
ast_strftime(strEndTime, sizeof(strEndTime), DATE_FORMAT, &timeresult);
/* Custom fields handling */
memset(buf, 0 , sizeof(buf));