Hi<br><br>I am using this code below to calculate the duration and billsec of a call in asterisk. It works fine when I test it with one call, however if I make a 3-way call, when I hangup it crashes asterisks. When I check the log I get this debug error right before it crashes:DEBUG[23679] rtp.c: Oooh, something is weird, backing out.<br>
<br>Can anyone give me some insight as to what I am doing wrong.<br><br>struct tm tm;<br> timestr[128];<br>time_t t;<br><br>{<br> time(&t);<br> ast_localtime(&t, &tm, NULL);<br> strftime(timestr,128,DATE_FORMAT,&tm);<br>
<br> ast_cdr_end(cdr);<br> <br> if (!cdr->end.tv_sec && !cdr->end.tv_usec)<br> ast_log(LOG_WARNING, "CDR on channel '%s' lacks end\n", cdr->channel);<br><br> if (!cdr->start.tv_sec && !cdr->start.tv_usec)<br>
ast_log(LOG_WARNING, "CDR on channel '%s' lacks start\n", cdr->channel);<br>
<br> if (cdr->answer.tv_sec || cdr->answer.tv_usec) {<br> cdr->billsec = cdr->end.tv_sec - cdr->answer.tv_sec + (cdr->end.tv_usec - cdr->answer.tv_usec) / 1000000;<br> } else { cdr->billsec = 0;}<br>
<br>}<br>