You need some sort of call accounting package.

Something like pabxsoft or samsung cms.

Both offer a trial period