Asterisk Fonality (CSV) SMDR setup and CDR format
This page shows how to get call records out of the Asterisk Fonality (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 Fonality (CSV) |
|---|---|
| Interface | CDR files downloaded by FTP from the PBX or its server and parsed on arrival. |
| Port | 21 |
| Parser to select | Asterisk Fonality (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)
Then cdr_custom.conf
[mappings]
Master.csv => "${CDR(clid)}","${CDR(src)}","${CDR(dst)}","${CDR(dcontext)}","${CDR(channel)}","${CDR(dstchannel)}","${CDR(lastapp)}","${CDR(lastdata)}","${CDR(start)}","${CDR(answer)}","${CDR(end)}","${CDR(duration)}","${CDR(billsec)}","${CDR(disposition)}","${CDR(amaflags)}","${CDR(accountcode)}","${CDR(uniqueid)}","${CDR(userfield)}","${CDR(sequence)}"
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 Fonality [CSV]](/pbx/shared/ftp-mode1.png)
![Asterisk Fonality [CSV]. Data source selection dialog.](/pbx/shared/file-interface.png)
![Asterisk Fonality [CSV]. Folders and files.](/pbx/shared/ftp-mode2.png)
![Configuring FTP connection to Asterisk Fonality [CSV]](/pbx/shared/ftp-mode3.png)
192.168.0.254
21
/var/log/asterisk/cdr-custom/
Master*.csv
admin
![Adjusting read options for Asterisk Fonality [CSV]](/pbx/shared/ftp-mode4.png)
Selecting the correct parser for Asterisk Fonality (CSV)

Asterisk Fonality (CSV)
Asterisk Fonality (CSV)
Data items
| Description | Data type | Column name |
|---|---|---|
| Caller name | string | FLAG1 |
| Caller phone | string | CALLER_PHONE |
| 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 |
| Account code | string | ACC |
| Call ID | string | FLAG7 |
Sample record
As delivered by the system; phone numbers, names and public addresses are masked.
"","5444","916xxxxxxxxx","internal","""A Person "" <5444>","SIP/0004F27E5A3C-000213a6","SIP/ATT-000213a7","Dial","SIP/ATT/162xxxxxxxx,,W","2020-01-31 14:36:34","2020-01-31 14:36:42","2020-01-31 14:38:16",102,94,"ANSWERED","DOCUMENTATION","1580502994.260534","SIP/0004F27E5A3C-000213a6<ssrc=1595049192;themssrc=311xxxxxxx;lp=0;rxjitter=0.000220;rxcount=4684;txjitter=0.000046;txcount=4679;rlp=0;rtt=0.000000>SIP/ATT-000213a7<ssrc=926xxxxxx;themssrc=1630575087;lp=0;rxjitter=0.000292;rxcount=4679;txjitter=0.000000;txcount=4684;rlp=0;rtt=0.060000>","srcip=10.0.68.126","dnid=916xxxxxxxxx" "316xxxxxxx","470xxxxxxx","s","Sales","""Sales"" <470xxxxxxx>","SIP/ATT_Second_IP-000213a8","Local/#401xxxxx@neoagent-e7a7;1","Queue","Sales,tT,,,120","2020-01-31 14:36:41","2020-01-31 14:36:41","2020-01-31 14:38:22",101,101,"ANSWERED","DOCUMENTATION","1580503001.260536","SIP/ATT_Second_IP-000213a8<ssrc=115xxxxxxx;themssrc=409xxxxxxx;lp=0;rxjitter=0.000501;rxcount=2077;txjitter=0.000000;txcount=4892;rlp=0;rtt=0.000000>","srcip=198.51.100.5","dnid=316xxxxxxx" "","470xxxxxxx","s","neoagent","""Sales"" <470xxxxxxx>","Local/#401xxxxx@neoagent-e7a7;2","SIP/0004F2CA9174-000213aa","Dial","SIP/0004F2CA9174,15,woCrgtM(neoanswer^5401) ","2020-01-31 14:37:04","2020-01-31 14:37:12","2020-01-31 14:38:22",78,70,"ANSWERED","DOCUMENTATION","1580503024.260541","SIP/0004F2CA9174-000213aa<ssrc=1830756287;themssrc=417xxxxxxx;lp=0;rxjitter=0.000135;rxcount=3477;txjitter=0.000122;txcount=1793;rlp=0;rtt=0.000000>"
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 (Master CSV)Asterisk (CSV)
AudioCodes Gateway (Extended)
AudioCodes Mediant 1000
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