Furthermore, set the disposition to FAILED if the CDR was never even started

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@13160 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant 2006-03-15 22:04:49 +00:00
parent 62d5f5a7ea
commit cde3711d7c
1 changed files with 3 additions and 2 deletions

5
cdr.c
View File

@ -655,9 +655,10 @@ void ast_cdr_end(struct ast_cdr *cdr)
ast_log(LOG_WARNING, "CDR on channel '%s' already posted\n", chan);
if (ast_tvzero(cdr->end))
cdr->end = ast_tvnow();
if (ast_tvzero(cdr->start))
if (ast_tvzero(cdr->start)) {
ast_log(LOG_WARNING, "CDR on channel '%s' has not started\n", chan);
else
cdr->disposition = AST_CDR_FAILED;
} else
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;