Mysql cdr call formats


I have a sql dump with some asterisk cdr. I need to figure out what is the format of some basic calls, I know the field format of the cdr table but there is no documentation with some sample calls eg outgoing call with the matching cdr… I have added a field after the billsec as ring(dur -billsec)

I dont have a asterisk pbx to test…

here are 2 types of calls I have, I assume that this is an example of an inc and out call, not sure which format is which… please help…
record 1
27042006 07:47:08 01980999999 01980999999 2999 ext1 Local/2999@ext1-02bc,2 SIP/2999-f808 Dial SIP/2999|25|r 16 0 16 NO ANSWER 3 1146120428.35

record 2

27042006 07:59:48 “John Doe” <2888> 2888 8300639195999999 int1 SIP/2888-ed0 Zap/1-1 Dial Zap/g1/128000639195999999 141 130 11 ANSWERED 3 1146121188.37

the main difference here is the fact that the fomats seem to be like so
date caller caller extension
date ext ext dialled number

I dont know if record 1 is inc or out format…?

also channel and dstchannel seem to swap in different formats as well,

if you can tell me if rec 1 is inc or out going format I would appreciate this.
why does channel and dstchannel include the dialled number or the extension?



I am noticing that there might be calls that are linked eg go through different stages eg maybe transfered and then diverted.

now the unique id of the call records must be realted to the record and not the call, if it was realted to the call then you would have some instances where 1 call might generate more than 1 record and then the
"uniquecallid" field would have duplicate entries…

this is what the cdr is laking, a unique field that can be used to id the call record as well as id a call that might have multiple records, eg call comes in then transfered then diverted out - this sort of call might have 3/4 records but is 1 call.

This system i explain is used in the avaya ip office with its cdr event stream and makes for great stats, at the moment all I can see if spahgetti records!

though i cannot confirm this, just with experience and seeing how some of the records pan out this is a feature lacking…

uniqueid can be added to the CDR records - if you had spent 5 minutes on the wiki, most of your questions would have been answered: