Adding DID to master.csv CDR?

w1ve

Guru
Joined
Nov 15, 2007
Messages
842
Reaction score
223
In FreePBX, you can search by DID, and see the DID on screen, but if you ask for a csv file, the DID is not included.
How can I do this for the Master.csv in \var\log\asterisk\cdr-csv?

I really need to know the original DID called.

Thanks!
 
did is a field in cdr table. It shouldn't be too difficult (fingers crossed) to alter the query but my Incredible2020 doesn't have a Master.csv
I'm interested in finding the queries that are used to show CDR in the FreePBX admin web page.
 
did is a field in cdr table. It shouldn't be too difficult (fingers crossed) to alter the query but my Incredible2020 doesn't have a Master.csv
I'm interested in finding the queries that are used to show CDR in the FreePBX admin web page.
Me as well
 
So, Here's how I'm doing it, getting exactly what I want.
I'm a Windows guy, so I'm using SSH.Net to connect to the PBX, and I execute command-line mysql to get at what I need, and create the CSV:
...connect to mysql using creds, select the cdr database.

SELECT did, duration INTO OUTFILE '/tmp/democdr.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' FROM cdr WHERE DID ='NXXNXXXXXX' ORDER BY calldate desc

Of course, you can select different fields and criteria, but it will create the CSV you want.
Then just sftp the file to whatever system you want it on. A few steps, but you get exactly what you want.
 
Thanks for sharing the info. It is great to know how to get the exact info a person wants.
 
@w1ve my issue with the canned CDR report is that calls that route to ring group shows a disposition for each extension in the group and the group extension as the destination. I need to look at the CEL report to find which extension accepted the call.
 
@dallas I completely agree, and that's one of my major gripes. Why is one of the dispositions not "answered elsewhere" so that calls to a ring group - you can more easily determine what happened. I really want to write my own CDR table that populates from the existing CDR and/or CEL to be simpler to read. Here's what I think we be ideal on a drill down of an inbound call:

1) Inbound call on DID xyz
2) Ring Group 600
3) Extension 105 answered
4) Parked in Parking-1
5) PIcked up from extension 102
6) Call ended by caller

Or something like that. Still trying to work it out in my head.
 

Members online

No members online now.

Forum statistics

Threads
26,687
Messages
174,410
Members
20,257
Latest member
Dempan
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top