Furthermore, set the disposition to FAILED if the CDR was never even started
authorRussell Bryant <russell@russellbryant.com>
Wed, 15 Mar 2006 22:04:49 +0000 (22:04 +0000)
committerRussell Bryant <russell@russellbryant.com>
Wed, 15 Mar 2006 22:04:49 +0000 (22:04 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@13160 65c4cc65-6c06-0410-ace0-fbb531ad65f3

cdr.c

diff --git a/cdr.c b/cdr.c
index 0aa7ddb..19c73dc 100644 (file)
--- a/cdr.c
+++ b/cdr.c
@@ -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;