You can use REST hooks /publishStream and /unPublishStream (and /StreamStatusEvent) to detect the moment of stream publishing/stopping. So< you can calculate the room (mixer) stream duration.
If, however, you create a mixer with very longidle timeout, you should use the same REST hooks for all the participants streams. When first participant (user1#room1 for example) publishes its stream to the mixer, the call is started. When the last participant unpublishes its stream, the call is finished.