[asterisk-dev] Asterisk crashes when hanging up a 3-way call.

Joel Jn-Francois voirtech at gmail.com
Fri Nov 14 10:56:59 CST 2008

Hi All,

A few days ago Mark Michelson was able to help me figure out that asterisk
was crashing when hanging up a 3-way call because the CDR was being set to
Null at that point.  However, the code below works perfectly for  2-way

Can anyone share some insight as to why the CDR might be null when hanging
up a 3-way call?  Or is there another way of calculating the duration and
the billsec without using the CDR?

Thanks for your help.

struct tm tm;
time_t t;

    ast_localtime(&t, &tm, NULL);


    if (!cdr->end.tv_sec && !cdr->end.tv_usec)
        ast_log(LOG_WARNING, "CDR on channel '%s' lacks end\n",

    if (!cdr->start.tv_sec && !cdr->start.tv_usec)
        ast_log(LOG_WARNING, "CDR on channel '%s' lacks start\n",

    if (cdr->answer.tv_sec || cdr->answer.tv_usec) {
        cdr->billsec = cdr->end.tv_sec - cdr->answer.tv_sec +
(cdr->end.tv_usec - cdr->answer.tv_usec) / 1000000;
    } else {    cdr->billsec = 0;}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20081114/00ef674b/attachment-0001.htm 

More information about the asterisk-dev mailing list