Here is an article about PBX: http://en.wikipedia.org/wiki/Pbx
Your question is not specific about where that software is supposed to run. Software applications running in a PBX itself are presumably written in low level languages like Assembler or C.
If you are required to think of a way to run a program in a PC which connects to a PBX to provide reports for Call Accounting, you need to think of a modular approach. First of all, your application needs to capture the call information forwarded by the PBX on either a serial (RS-232) or network interface (TCP/IP). Secondly, the information needs to be reformatted so that it can be written to a file or database of some sort. Thirdly, a user interface is required which picks one of the available reports from a menu. And finally, a reporting language selects the relevant records or rows from the stored call information, sorts them and presents the report on the screen, prints it or writes the report into a file.