aboutsummaryrefslogtreecommitdiffstats
path: root/cdr/cdr_manager.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-18 19:47:20 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-18 19:47:20 +0000
commit74c2948c2299773fd3816af43e06e3bdf714ba3a (patch)
tree540f82bac3e6105b6fc34cd4b4613c1756a7512b /cdr/cdr_manager.c
parentfd471b4a0cbb2abd7b4c8f30fee850cedefedaa1 (diff)
Merge in ast_strftime branch, which changes timestamps to be accurate to the microsecond, instead of only to the second
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@75706 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'cdr/cdr_manager.c')
-rw-r--r--cdr/cdr_manager.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/cdr/cdr_manager.c b/cdr/cdr_manager.c
index a245d92bf..5dc4da6fe 100644
--- a/cdr/cdr_manager.c
+++ b/cdr/cdr_manager.c
@@ -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));