Export call log

Status
Not open for further replies.

ovi

Joined
Jan 24, 2018
Messages
9
Reaction score
0
Hi everyone,

I want to export during the day the call log for us dashboard.
How is the best solution ? cdr export ? export db ? any other solutions ?

thanks !

Vince
 
First, be aware that 3CX doesn't always write records to the database right away. There may be a delay while 3CX caches writes to the database. You can extract data from the CDR files, but they don't typically get written until the call is complete (at least I believe that to be the case) so that can also add delays. The only way to get real-time information is to monitor the 3CX events using the Call Control API. It's a bit complicated to sift through all the events, but it is possible to do. Otherwise, take a look at our 3CX Exporter -- this application can synchronize the data in 3CX with a SQL Server database, in close to real time.
 
Hello @ovi @voiptoys

Just to confirm the below. Yes that is correct, cdr will be written(file/socket) once a call is completed.
You can extract data from the CDR files, but they don't typically get written until the call is complete (at least I believe that to be the case)
 
Ok but is not a problem, i want to export the call every 15 min. You think cdr is the better way ? or directly a export from the database ?
 
I would go with CDR as accessing the Database is not advised.
Just note that using sockets to get the cdr, the PBX will generate a CDR at the time that the call completes. You cannot query the PBX for calls every 15 minutes using sockets.
So either you will connect using sockets and store this info as needed, or alternatively you will output CDR to a file(s)(single/multiple) and read the files at any time interval you want.
 
Ok thanks !
Did you hav some examples to read the cdr ? with anything ? or extract the data ?
 
If you are going to feed the CDR automatically to another software(dashboard?) then some kind of implementation is required. Either reading the files either with socket programming.

If you are going to output to files, these are located on the following locations:
Windows: C:\ProgramData\3CX\Instance1\Data\Logs\CDRLogs
Linux: /var/lib/3cxpbx/Instance1/Data/Logs/CDRLogs
You can use a batch to copy them where needed.
You can also use putty to test the socket passive mode

What are you trying to accomplish exactly?
 
Last edited:
The concern with using sockets is if the socket connection goes down, for any reason, you lose the data. Relying on the CDR files is far safer since you can always catch up if your CDR processing application goes down temporarily. IMO
 
Hello,
Thanks for all the info, so I need to copy on my mgt server (windows) and extract the info with ps.
 
Here my solution:
cat /var/lib/3cxpbx/Instance1/Data/Logs/CDRLogs/cdr.log | grep -o 'Call' | wc -l > /home/script/nbcall.txt

thanks !
 
Thanks for sharing @ovi as others may find it useful.
 
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
111,881
Messages
589,534
Members
164,739
Latest member
wmlcon