International4,
Using a filesystemwatcher (without any other checks) to detect when a new recording is created would work MOST of the time on systems that have very few recordings taking place, but on heavily used 3CX servers the likelihood of multiple recordings starting at, or very near, the same time makes this a very risky approach.
To be safe, you really need to look at the call information embedded in the file name to match the correct recording. We use a combination of a filesystemwatcher and when the file was created on disk, as well as the data in the file name (by parsing the file name) to match the recordings.
I am a little reluctant to mention that the recording name is saved in one of the PostgreSQL tables, but as we all should know by now, 3CX Support REALLY doesn't like people accessing the database directly. We could take that approach but elected not to do so simply because we have an approach that works reliably without going down the road of querying PostgreSQL.