bg

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

ItemAsterisk (Master CSV)
InterfaceCDR files downloaded by FTP from the PBX or its server and parsed on arrival.
Port21
Parser to selectAsterisk (Master CSV)
Fields extracted17

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]

Asterisk [Master CSV]. Data source selection dialog.

Asterisk [Master CSV]. Folders and files.

Configuring FTP connection to Asterisk [Master CSV]

192.168.0.254

21

/var/log/asterisk/cdr-custom/

Master*.csv

admin


Adjusting read options for Asterisk [Master CSV]

Selecting the correct parser for Asterisk (Master CSV)

Parser Selection For PBX Data Logger

Asterisk (Master CSV)

Asterisk (Master CSV)

Data items

DescriptionData typeColumn name
Caller namestringFLAG1
Caller phonestringCALLER_PHONE
Account codestringACC
SourcestringFLAG2
DestinationstringFLAG3
DirectionstringDIRECTION
ExtstringEXT
TrunkstringTRUNK
Destination contextstringFLAG4
Call typestringCALL_TYPE
Call timedatetimeCALL_TIME
Call duration (s)integerCALL_DURATION_S
Call durationdatetimeCALL_DURATION
RingdatetimeRING
DespositionstringFLAG5
AMA flagsstringFLAG6
Call IDstringFLAG7

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.