Skip to content
Snippets Groups Projects
Commit 1bcfff48 authored by Russell Bryant's avatar Russell Bryant
Browse files

remove calculations that always evaluate to zero, thanks Luigi!

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@12995 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 9d2f8b28
No related branches found
No related tags found
No related merge requests found
......@@ -657,9 +657,9 @@ void ast_cdr_end(struct ast_cdr *cdr)
ast_log(LOG_WARNING, "CDR on channel '%s' has not started\n", chan);
if (ast_tvzero(cdr->end))
cdr->end = ast_tvnow();
cdr->duration = cdr->end.tv_sec - cdr->start.tv_sec + (cdr->end.tv_usec - cdr->start.tv_usec) / 1000000;
cdr->duration = cdr->end.tv_sec - cdr->start.tv_sec;
if (!ast_tvzero(cdr->answer))
cdr->billsec = cdr->end.tv_sec - cdr->answer.tv_sec + (cdr->end.tv_usec - cdr->answer.tv_usec) / 1000000;
cdr->billsec = cdr->end.tv_sec - cdr->answer.tv_sec;
else
cdr->billsec = 0;
cdr = cdr->next;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment