Socket cdr

Status
Not open for further replies.

MartinaP

Titanium Partner
Joined
Mar 8, 2022
Messages
41
Reaction score
7
I created a socket server listening on port 3000.
From 3cx I set the active socket towards port 3000 in the cdr section and everything works ok.
But when I turn off the socket server, in 3cx I still see the connection to port 3000 active and it never disconnects.
Therefore I am forced to remove the active socket from 3cx and reset and give ok to be able to create a new connection to the socket server. Is there a timeout to set? or something else to do?
 
OK, I freely acknowledge that I do not have a useful answer to your question, AND my following comments are self-serving. Nevertheless, here we go...

I think using the IP socket connection as a means to receive CDR data is a mistake. First, there is the complexity of creating, configuring, and maintaining the socket software, and second, what happens when your socket connection fails? ... and you know it will fail from time to time...

If your IP socket connection goes down for ANY reason, you will lose data and that data will be lost FOREVER. Maybe your use case for the CDR data does not require that you have EVERY call, but gaps in your data typically is problematic.

So what is the solution? In my opinion, you should configure 3CX to create CDR files. Further, I would recommend the setting that instructs 3CX to create a separate file for each call. Files never fail the way a socket can. Even better, if your automation process fails at some point, that is not a problem. 3CX will continue to create files and when your process is back up it will continue where it left off, processing any new files it finds. This is a safe and dependable approach.

The final question, then, is how do I process these files? That is a complicated answer. You can use tools to automate the copying of files from the 3CX server to your local server where you can process the files (Maybe Filezilla?). If you have the coding skills to make a IP socket connection, then you clearly have the skills to do this.

If you do not want to automate this process yourself, then we can help. I suggest you take a look at our 3CX Exporter tool. Exporter can process the CDR files in real time from any 3CX server -- hosted or on-prem, and Windows or Linux. It can parse the CDR files and save the data in SQL Server or MySQL automatically.
 
@MartinaP - When you turn off your socket server are you closing the TCP connection first? When you say: 'in 3cx I still see the connection to port 3000 active' where are you finding this information (I'm not aware of anywhere the CDR up/down socket status is shown on the management terminal)?

In active socket mode you should find that 3CX will auto-reconnect within a relatively short space of time: 3CX will try and re-initiate the connection approximately once every 40 seconds (each new attempt increments the the 'from' port) with TCP retries after 1,2,4 & 8 seconds. This behaviour is observed on v18 update 8 (build 939).
[This may depend on your 3CX version, much earlier versions didn't show this behaviour, instead the reconnect attempt was triggered by a call generating a CDR]

Despite the warnings from VoipTools, the CDR socket can be extremely reliable - on my PBX (with passive mode) I've never dropped any CDRs though this will depend on your network topology - SFTP is certainly the sure-fire way to go.
If you want to test IP connectivity then a tool like YAT is extremely helpful, or you could try something like CallVitesse which can do IP active/passive as well as SFTP.
 
Thank you both.
Cjay on installation on premise , login with root and write command ss you can see the connection.
 
@MartinaP - I see the connection drop in the Debian Socket Statistics (ss) - but as 3CX keeps trying to re-establish the connection it will reappear: So it drops from state ESTAB but then reappears every 40secs as SYN-SENT and stays in this state until it times out (after 8+4+2+1 seconds perhaps). Not sure if this will help you though...
 
Status
Not open for further replies.

Forum statistics

Threads
111,974
Messages
590,081
Members
164,899
Latest member
mazet