Duration in CDR

Hi, I am trying to get the duration of the calls, and I am using a voip provider. in my records the duration of the calls is almost double than the one in the voip provider.

I am making outbound calls and the disposition is ‘NO ANSWER’ although the last application is ‘hangup’ and the call is made.

Here is an example:

org.asteriskjava.manager.event.CdrEvent[dateReceived=Wed Nov 05 12:30:09 CAT 2008,privilege=‘call,all’,endtime=‘2008-11-05 12:29:24’,destinationchannel=‘null’,userfield=‘null’,starttimeasdate=‘Wed Nov 05 12:29:05 CAT 2008’,timestamp=‘null’,billableseconds=‘0’,endtimeasdate=‘Wed Nov 05 12:29:24 CAT 2008’,lastdata=‘null’,accountcode=‘0766107xxx’,answertimeasdate=‘null’,src=‘null’,disposition=‘NO ANSWER’,callerid=‘Edgars’,starttime=‘2008-11-05 12:29:05’,answertime=‘null’,destination=‘s’,uniqueid=‘1225880945.22’,lastapplication=‘Hangup’,duration=‘19’,amaflags=‘DOCUMENTATION’,destinationcontext=‘outbound’,channel=‘IAX2/voipconnect-11849’,systemHashcode=10054858]

Maybe with the timestamp I could fix it, but it appears as null. Any ideas?

Thanks,
laura

What I really need is billsec, not duration:

duration
Total time in system, in seconds (integer), from dial to hangup.
billsec
Total time call is up, in seconds (integer), from answer to hangup.

But, billsec is null!!! What can be the problem?

CDR handling is somewhat flakey, e.g. see: http://bugs.digium.com/view.php?id=11849 and http://bugs.digium.com/view.php?id=13794.

However, if the answer time is null, that part of the call really hasn’t been answered, and you would need to provide console/SIP trace information to prove to the contrary.

Where you could get something like this is if you use Dial with the g flag, in which case you will get a CDR for the outgoing call, followed by a new CDR for anything that follows it. That new CDR will not have ANSWERED status, although it might have an answer time.

You can get NO ANSWER for a call that was answered on the incoming side, if you reset the CDR.

Execution of the Hangup application does not indicate that the call was ever answered, either for the incoming or outgoing side. Incoming ANSWER only happens when you send a SIP ACK to the incoming INVITE. If you’ve only sent RINGING, the call hasn’t been answered.

Trickier manipulation of the call can produce different results, again.