Monitor module. How does it work?

I am wonder how does the monitor module for call recording work. The MixMonitor application has main loop of reading frames and writing to the corresponding file, but i could’t see the reading/writing loop in the Monitor module.