This is an old song, but I'll keep singing it. I personally think using an active socket is a less than ideal solution. If your socket connection goes down for any reason (socket service crash, network connection failure, etc.), that data is gone. There is no retry mechanism, or any form of recovery so that data is gone forever (any calls that come in while the connection is broken). The advantage of the file-based approach is that you can always "catch up" later. That is what we do with our
3CX Exporter tool.

It's that simple -- a single checkbox. And it does not matter where your 3CX is hosted (on-prem or hosted on Amazon, Azure, Google, etc.). We instantly detect the new file, automatically parse the data, and push the data to your Microsoft SQL Server, MySQL, MariaDB database). This is real-time data.
In 3CX v20 update 6, there are new "cdr" database tables available for Grafana. We can replicate that data too. You set the frequency (default 60 seconds) and we get you near real-time data available for PowerBi, Crystal Reports, Grafanna, etc. But that is not all, we can also provide queue statistics, agent login/logout times, missed calls, extension/user lists, departments, chat, all the data 3CX uses for their internal reports.