How to send outbound calls only as a CDR to TCP socket

Status
Not open for further replies.

yatir dagan

Joined
Oct 31, 2018
Messages
2
Reaction score
0
Hi, i am new to 3cx, I want to get only outbound calls details (from, to , date_time, duration) as CDR in real time, i read about the tcp socket but how can i filter for outbound calls only?, there is a cdr field which detect that it is an outbound call?
maybe can i query 3cx somehow for it?
Thanks.
 
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.
 
Thank for your quick answer, i'll do it! But, a few clarification please:
1) you said: "it's pretty easy to infer from the data.". can you bring me more close on how to exactly infer this programmatically please?

2) the mysql which the exporter use is found with the 3cx machine phisically,? is it accessible for 3rd party from outside?

3) this all process (cdr creation-> "parse and insert to mysql by exporter" ) is in real time and free to use with the very basic license of 3cx?
 
Last edited:
If you look at the Dialed_No field it will either have an extension or an outside number. By looking at the length, you should be able to determine if it is an inbound or outbound call.

I strongly urge you not to install anything on the 3CX server if the software can be installed on a separate server. In the case of SQL Server or MySQL, you would want to install on a separate server. You can use the free additions of SQL.

While 3CX can create the CDR files in any version (Free, Standard, Pro, Enterprise), processing the CDR files and getting the data into SQL is not part of 3CX and would require your programming, or the purchase of our Exporter tool.
 
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
112,323
Messages
591,896
Members
165,474
Latest member
costionofrei