Asterisk (Master CSV) SMDR setup and CDR format
This page shows how to get call records out of the Asterisk (Master CSV) into Advanced PBX Data Logger: the connection settings, the parser to select and the 17 fields the logger extracts for reports or a database. The settings apply to our logger; other call accounting software may expect a different configuration.
Quick facts
| Item | Asterisk (Master CSV) |
|---|---|
| Interface | CDR files downloaded by FTP from the PBX or its server and parsed on arrival. |
| Port | 21 |
| Parser to select | Asterisk (Master CSV) |
| Fields extracted | 17 |
Asterisk it is an open-source software PBX licensed under the GPL license.
Asterisk configuration
For this to work you do need to have cdr_csv.so loaded. show modules or module show entered at the CLI will tell you if it has been loaded. If not: Type load cdr_csv.so in the CLI. You'll also want to add that load command to /etc/asterisk/modules.conf if Asterisk didn't automatically include this module at startup.
You also need to edit cdr.conf. The file is located in the /etc/asterisk/ directory.
[general] ; Define whether or not to use CDR logging. Setting this to "no" will override ; any loading of backend CDR modules. Default is "yes". enable=yes unanswered=yes (or no) [cdr] ;usegmtime=yes ;log date/time in GMT (disabled) loguniqueid=yes ;log uniqueid (enabled) ;loguserfield=yes ;log user field (disabled)
Out of the box, Asterisk will update: /var/log/asterisk/cdr-custom/Master.csv
How to check the CDR service status
CLI> cdr show status
Call Detail Record (CDR) settings
----------------------------------
Logging: Enabled
Log unanswered calls: Yes
Log congestion: No
* Registered Backends
-------------------
csv
Configuring PBX Data Logger
1. Create the new "File" data source.
2. Click "Actions → Add...".
3. Select the "FTP" file transfer protocol and configure connection with a FTP server on your PBX.
4. Adjust read options.
![Adding a new file data source for Asterisk [Master CSV]](/pbx/shared/ftp-mode1.png)
![Asterisk [Master CSV]. Data source selection dialog.](/pbx/shared/file-interface.png)
![Asterisk [Master CSV]. Folders and files.](/pbx/shared/ftp-mode2.png)
![Configuring FTP connection to Asterisk [Master CSV]](/pbx/shared/ftp-mode3.png)
192.168.0.254
21
/var/log/asterisk/cdr-custom/
Master*.csv
admin
![Adjusting read options for Asterisk [Master CSV]](/pbx/shared/ftp-mode4.png)
Selecting the correct parser for Asterisk (Master CSV)

Asterisk (Master CSV)
Asterisk (Master CSV)
Data items
| Description | Data type | Column name |
|---|---|---|
| Caller name | string | FLAG1 |
| Caller phone | string | CALLER_PHONE |
| Account code | string | ACC |
| Source | string | FLAG2 |
| Destination | string | FLAG3 |
| Direction | string | DIRECTION |
| Ext | string | EXT |
| Trunk | string | TRUNK |
| Destination context | string | FLAG4 |
| Call type | string | CALL_TYPE |
| Call time | datetime | CALL_TIME |
| Call duration (s) | integer | CALL_DURATION_S |
| Call duration | datetime | CALL_DURATION |
| Ring | datetime | RING |
| Desposition | string | FLAG5 |
| AMA flags | string | FLAG6 |
| Call ID | string | FLAG7 |
Sample record
As delivered by the system; phone numbers, names and public addresses are masked.
"","402xxxxxxx","6443","from-did-direct","""A Person "" <402xxxxxxx>","DAHDI/i1/402xxxxxxx-47cc3","SIP/6443-0004bffc","Dial","SIP/6443,15,tr","2014-03-06 13:11:40","2014-03-06 13:11:43","2014-03-06 13:12:16",36,33,"ANSWERED","DOCUMENTATION","139xxxxxxx.837055","" "","6336","402xxxxxxx","from-internal","6336","SIP/6336-0004bfff","DAHDI/i1/402xxxxxxx-47cc4","Dial","DAHDI/g0/402xxxxxxx,300,","2014-03-06 13:14:16",,"2014-03-06 13:14:39",23,0,"NO ANSWER","DOCUMENTATION","139xxxxxxx.837059","" "","6599","3","TAF-FX-Calls","""No Name"" <6599>","SIP/6599-0004bffd","SIP/vimp_af202-0004bffe","Dial","SIP/vimp_af202/160xxxxxxxx,60,r","2014-03-06 13:13:54","2014-03-06 13:14:20","2014-03-06 13:14:42",48,22,"ANSWERED","DOCUMENTATION","139xxxxxxx.837057",""
Reports and a database
Once records arrive, the logger writes them to a text file or to any ODBC database in real time, or hands them to the PBX Reports utility for manual, scheduled and e-mailed reports with a built-in web server. See exporting call log data to a database for the database setup.
Related Asterisk systems
Asterisk (CSV)Asterisk (AMI interface)
Asterisk Fonality (CSV)
AudioCodes Gateway (Extended)
All supported PBX systems
Note: Products and companies mentioned here are used only for definition and identification purposes and can be trademarks and/or registered trademarks of the respective companies.
Related topics: Advanced PBX Data Logger
hereCall logging Call accounting SMDR to SQL SMDR Listener Cables and signals