Data from the freepbx

Hi, I am a php developer in a company that uses freepbx, and I need to get data about the length of calls, time of waiting etc. I’m am not an expert in freepbx.

The table ASTERISKCDRDB does not give me enough information for that and is a bit confusing.

My question is, is there a way to change the information that the freepbx exports? or will I have to run a service with AGI that will export the information I need?

Thanks
Yehuda