You can use CTI (TAPI/JTAPI) to monitor the phones in real time and keep your own statistics (usually a pretty heavy solution) or use the CDRs.
Thats what I thought about TAPI/JTAPI, and there is no way I can/will go that route
The CDRonDemand service can only receive single CDR files and there is a throttle limit, so it's usually impractical for anything but spot checking very specific time frames - e.g. examing when a 911 or malicious call was made.
I was going to try the get_file_list operation in that service with one hour interval which was sufficient in my scenario. But only after we resolve the self signed SSL issue complicated by the 1024 bit CSR limit by CUCM OS Admin.
If you want to keep large scale statistics, you will likely want to set up your app as a CDR FTP target, so that you receive all CDRs as they are generated (once a minute, default.) You can then import then into a database and query as needed.
That sounds the best option. I just need to research more on the CDR fields - what they mean - before I dump them to a SQL DB.