ensure proper variables are returned from CDR function (bug #4521)
authorKevin P. Fleming <kpfleming@digium.com>
Wed, 15 Jun 2005 15:01:40 +0000 (15:01 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Wed, 15 Jun 2005 15:01:40 +0000 (15:01 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5916 65c4cc65-6c06-0410-ace0-fbb531ad65f3

cdr.c

diff --git a/cdr.c b/cdr.c
index 6ea359b..e04188a 100755 (executable)
--- a/cdr.c
+++ b/cdr.c
@@ -203,13 +203,13 @@ void ast_cdr_getvar(struct ast_cdr *cdr, const char *name, char **ret, char *wor
                        strftime(workspace, workspacelen, fmt, &tm);
                }
        } else if (!strcasecmp(name, "answer")) {
-               t = cdr->start.tv_sec;
+               t = cdr->answer.tv_sec;
                if (t) {
                        localtime_r(&t, &tm);
                        strftime(workspace, workspacelen, fmt, &tm);
                }
        } else if (!strcasecmp(name, "end")) {
-               t = cdr->start.tv_sec;
+               t = cdr->end.tv_sec;
                if (t) {
                        localtime_r(&t, &tm);
                        strftime(workspace, workspacelen, fmt, &tm);