About: CDR reports
- 1 Are CDR records ever deleted?
- 2 Export into CSV
- 3 Locate the RAW data
- 3.1 Directory on your PBXtra
- 3.2 How are files named?
- 3.3 What do the contents of files look like?
- 3.4 How do I download CDR reports?
- 3.5 Will you support customization of the CDR system?
- 3.6 How often do the reports update in the control panel?
- 3.7 What should I do if the reports have stopped updating?
- 3.8 What is the service level agreement for the reports in my control panel?
Are CDR records ever deleted?
No, Fonality does not remove your CDR reports for any reason ever. They 'live' on your server, and the only mitigating factor in CDR reports is the total space on your hard drive available for storage. If your server takes 10,000 calls per day for 5 years straight, these files may begin to grow large and consume space on your hard drive unnecessarily. In this case, you may wish to offload the files into CSV format and store them on your company SAN.
However, You can query up to 3 years of data via the Web Panel's CDR/ACD Reports. Data prior to that is scrubbed on our side, and you will not get results older than this time period. The data is still available on the server's local logs. You can export annual CDR reports to retain them in CSV records via the Web Panel.
Export into CSV
This feature requires Professional/Enterprise edition or higher.
Most of the time, you'll use the Web Admin Panel > Reporting > cdr reports tab to export call logs for your PBXtra server, as detailed here:
Saving the data to a file
Internet Explorer:
Reporting > CDR reports. Check CSV checkbox, select the desired ranges, dates, display options. Run report.
CTRL+A to select all. CTRL+C to copy.
Open up notepad. CTRL+V to paste.
File > Save as... I suggest a .csv extension. For example, "filename.csv"
You must change type to "all files" before saving.
Firefox:
Reporting > CDR reports. Check CSV checkbox, select the desired ranges, dates, display options. Run report.
Right-click on page, select "This frame" > "Same frame as..."
I suggest a .csv (comma-separated values) extension, to make it clearer to Excel.
You can read this information into a program like Microsoft Excel or Crystal Reports to sort and analyze the data.
Locate the RAW data
This document describes how to find the raw CDR (Call Data Record) files recorded by your PBXtra . These files are needed if you plan to import your call log information into a database in an automated fashion. The files are automatically created by the FONcore software on the PBXtra system, and are the same data that Fonality uses to update your call logs in the PBXtra Admin Panel.
Directory on your PBXtra
You can find all of your CDR records grouped by week on your server in the following directory:
/var/log/asterisk/cdr-csv/07-10-01
(the date - 07-10-01 - corresponds to YY-MM-DD and a new directory is created on Monday of each week)
This directory may contain thousands of files, so don’t simply ‘cd’ to the directory and run ‘ls’. You might need to wait several minutes for your terminal to finish printing all the filenames. If you make that mistake, you will need to use CTRL+C to abort the ‘ls’ output.
How are files named?
The files in the directory are named like this:
Master.csv.1114459934
The file named ‘Master.csv’ is the ACTIVE file, and should not be opened and read. If you try to read the active file, it may change while you are reading it. The Master.csv.xxxxxxxxxx files are the INACTIVE files that have already been rotated by the system on a 5 minute interval, and will no longer change. The integer string on the end of the filename represents the UNIX time that the file was rotated. This is the number of seconds elapsed since Jan 1, 1970. You can convert this to a human readable date like this:
[root@pbx0000 ~]# perl -MTime::localtime -e 'print ctime(1114459934) . "\n";'
Mon Apr 25 16:12:14 2005
As you can see from the above example, the number corresponds to the date “Mon Apr 25 16:12:14 2005”.
What do the contents of files look like?
The contents of the files will look like this:
The above is one line of an example CDR file. Admittedly, this looks rather cryptic. It’s a comma separated values format. The columns are in the following order:
'''accountcode:''' Your server ID (integer, 4-6 digits)
'''src:''' Caller*ID number (string, 80 characters)
'''dst:''' Destination extension (string, 80 characters)
'''dcontext:''' Destination context/submenu (string, 80 characters)
'''clid:''' Caller*ID with text (80 characters)
'''channel:''' Channel used (80 characters)
'''dstchannel:''' Destination channel if appropriate (80 characters)
'''lastapp:''' Last Asterisk application if appropriate (80 characters)
'''lastdata:''' Last Asterisk application data (arguments) (80 characters)
'''start:''' Start of call (date/time)
'''answer:''' Answer of call (date/time)
'''end:''' End of call (date/time)
'''duration:''' Total time in system, in seconds (integer)
'''billsec:''' Total time call is up, in seconds (integer)
'''disposition:''' What happened to the call: ANSWERED, NO ANSWER, BUSY
'''amaflags:''' Billing flags (reserved for future use)
'''timestamp:''' Unix timestamp of the start of call
Note: If you do automate the insertion of this data into a database of your own, and you are confident that it’s working properly, we suggest moving the imported files to another directory on the system to make it easier for your automated program to identify new CDR files to import.
How do I download CDR reports?
Your CDRs are stored in comma-delimited format in the /var/log/asterisk/cdr-csv directory, allowing you to easily import them into a database or report-writer of your choosing.
These detailed instructions are provided with the following disclaimer:
Fonality only provides support for the management interface and the PBX itself. These instructions have passed Fonality support peer review before being posted here; however, they are neither endorsed nor supported by Fonality. In short: These instructions are for advanced users and choosing to follow them is at your own risk.
To retrieve cdr reports from the PBX server for archival purposes
First the root name and password must be set on the PBXtra .
Login to the server using username: ip and password: ip.
When the Fonality options page is displayed, select Option 11 'Set Root Password'.
The password should be easy to remember and difficult to guess. Fonality advises using at least a combination of characters and letters in a string a minimum of eight characters.
Keep your root password available but secure.
Once the root password is set the user must connect into the PBX from another location. This is accomplished using an application such as Winscp freely available at:
Once this application is installed on another computer, on the same local network, the user must connect into the PBX using the private IP address of the PBX and logging in using the root password that was earlier set.
Example: the settings using winSCP are:
Hostname: “Private IP address of your PBx server”
Port: 22
Username: root
Password: “the root password you set previously”
Once the user is logged into the PBX the files may be downloaded to the remote machine and saved for archival use by the following steps:
Create a directory/folder on local computer
Connect to the PBX
Identify and select the target directory/folder (created in step 1) on the local machine. If using WinSCP the local machine will be on the left.
Identify and select the source directory/folder: /var/log/asterisk/der-csv/ on the PBXtra . If using WinSCP the source machine will be located on the right.
Download the desired files to be archived.
Will you support customization of the CDR system?
Further use of this information is beyond the scope of the PBXtra Annual Support and Maintenance Agreement. You are welcome to perform any integration you wish. However, the support team will not be able to supply you with information in addition to what’s shown above.
How often do the reports update in the control panel?
It will depend on the volume of calls to be processed at the time. On average you will see your call updated in the reports about 3-9 minutes after completing it.
What should I do if the reports have stopped updating?
If you have a server with active calls that has not shown an update in the reports in 12 hours, you should contact support to check the reporting on your server and clear any problems that have stopped the call reports from processing.
What is the service level agreement for the reports in my control panel?
The CDR and ACD reports are an as-is feature. There is no service level agreement. However, if the reports have not updated on a server with active calls in 12 hours, open a ticket with Support to investigate the reporting on your server.