Generating CDRs
ARM allows you to generate CDRs using the CDR Generator utility.
|
➢
|
To generate CDRs using the CDR Generator utility: |
|
1.
|
Open the CDR page in the ARM GUI (Settings > Network Service > CDR). |
|
2.
|
Click the Enable CDR toggle button to enable CDR generation, and then from the 'Format' drop-down list, select Json or Clear text and Json: |
|
3.
|
Collect all the CDRs, using one of the following methods: |
|
●
|
If you have a syslog server, take the syslog file from the syslog server. |
|
●
|
If you do not have a syslog server, collect the logs from All Routers and create one large file: ARM saves the CDRs in JSON format under the /opt/tomcat/logs/CDR_Json directory. The name of the CDR file is CDR_Json-*.log (up to 10 files can be saved). Create one file: 'CDR_Json.log'. |
|
4.
|
Generate a CdrArmMessages file from CDRs: |
|
a.
|
Copy the one CDR file you got into one of the Routers. |
|
b.
|
Run the following command for generating the CDR file: |
cdrUtil -i CDR_Json.txt
The output files are:
|
●
|
CdrArm_ CDR_Json _[timestamp].txt |
|
●
|
CdrArm_ CDR_Json _[timestamp]. json |
|
5.
|
To set the output file name, use the -o option. For example: |
cdrUtil -i CDR_Json.log -o myOutputFileName
|
6.
|
To set the drop-calls period in hours, use the -d option. For example: |
cdrUtil -d 12 CDR_Json.log
All partial calls created more than 12 hours before are exported to the file ‘DroppedCdrs.json’. The other partial calls are part of the input CDR in the next cdrUtil that is run and are exported to the file ‘UnfinishedCdrs.json’.
When running cdrUtil again, it uses the ‘myOutputFileName’ input and the file ‘UnfinishedCdrs.json’.
‘UnfinishedCdrs.json’ is overwritten with new cdrUtil results.
The file ‘UnfinishedCdrs.json’ will then no longer be used as input and each cdrUtill UnfinishedCdrs message will be added to it.
The default value for drop-calls is 24 hours.
|
7.
|
To set the input ‘UnfinishedCdrs.json’ file location, use the -iu option. For example: |
cdrUtil CDR_Json.log -iu /root/UnfinishedCdrs.json
|
8.
|
To set the output directory, use the -od option. For example: |
cdrUtil CDR_Json.log -od /root/tempDir
The output directory will contain the following files:
|
●
|
CdrArm_ CDR_Json _[timestamp].txt |
|
●
|
CdrArm_ CDR_Json _[timestamp]. Json |
|
9.
|
To set the date format, use the -f option. For example: |
cdrUtil CDR_Json.log -f "yyyy-MM-dd HH:mm:ss.SSSSZZ"
|
10.
|
Generate a CSV file of the CdrArmMessages file from CDRs. To generate a CSV file, use the -m option. For example: |
cdrUtil -i CDR_Json.log -m myMapFileName
The map file is a text file in json format that defines which fields will be displayed in the CSV file and what their new name (if required by the customer) will be. The file contains a list of name pairs:
|
●
|
armCdrFieldName [the name of the field from the CdrArmMessage] |
|
●
|
convertedCdrFieldName [the customer-required name of the field that will be displayed in the CSV file] |
|
●
|
The generated CSV file contains only the 'armCdrFieldName' field from the mapping json file but you can dynamically build a CSV file, customize CSV file column names and determine where the CSV file will take its columns from. Use the example in the next section as reference. |
|
●
|
To create a new column with a new name which isn't displayed in the CdrArmMessage, set 'armCdrFieldName' to empty and 'convertedCdrFieldName' to the new column name. See convertedCdrFieldName = Direction in the section below. |