Hi Yatir,
While there isn't a field in the CDR that specifically denotes whether the call was inbound or outbound, it's pretty easy to infer from the data.
You will have to filter the data as it comes in on the socket and decide whether you want to keep the data. There is no way to filter what calls are transmitted prior to sending the data over the socket.
However, I personally don't think using a socket is the most reliable approach to getting CDR data. What happens if, for example, your socket goes down? Answer -- you lose the data.
I would suggest, as an alternative, that you have 3CX create physical text files (one for each call) and parse the individual files. That should be easier than setting up a socket connection, maintaining the connection, implementing recoverability after connection loss, and finally parsing the data stream. Parsing the text files ensures you never lose any information if your service is down at any time. You simply process any remaining text files effectively catching up where you left off.
To configure 3CX to create the CDR files, in the 3CX Management Console select: Settings --> CDR. Be sure to select the option: "separate files for each call", and remember to add all the available "additional" fields to get as much information as possible.
As self-serving as this is, I encourage you to take a look at our Exporter tool which can automate the process of parsing the text files and putting the data in SQL Server or MySQL. Once the data is in a database it's easy to utilize the data as needed without impacting 3CX in any way.