CDR Converter
Version 2.0 enhancements
This chapter presents the new features added to the CDR Converter v2.0 release with regards to the v1.0 release. The following features have been added to CDR Converter v2.0:
- ASN.1 data can now be converted in one single command. This command first compiles the CDR syntax and then converts the CDR data.
- The output can be generated in XML format.
- Support for block size and padding. If block size is not known the CDR Converter can detect it automatically.
- Support file and message headers.
- Data conversion using TBCD and ASCII.
- Redefinition of the default column separator.
- Conversion of multiple files.
- Decoding errors are skipped and logged.
- ASN.1 Value Editor project files can be reused.
Easy conversion
CDR conversion typically requires 2 steps for processing CDR files: compilation of the CDR ASN.1 syntax and data conversion. Both steps are executed in one command by cdrconvert. To compile and convert CDR data use the following command:
cdrconvert -asn <CDR syntax> -i <CDR file>
However, some CDR syntaxes are ambiguous concerning the message which should be decoded. Decoding a particular message is specified with the option -msg, e.g. for GPRSRecord:
cdrconvert -asn <CDR syntax> -i <CDR file> -msg GPRSRecord
XML output
With CDR Converter v2.0, the input files can now be converted to the XML format. This format is used with the option -f xml. It is the new default output format for conversion.
The existing CSV output format is used with the option -f csv.
Block size and padding bytes
CDR Converter v2.0 now supports input files which are organized in blocks. The block size is specified using the -bs option. The filler byte used for padding at the end of a block is specified with the option -pb.
If neither the block size nor the padding byte is given the CDR Converter v2.0 tries to detect automatically the block size and padding byte.
Automatic block size detection
Most of the block sized CDR values use 0x00 or 0xFF for the padding byte. If neither the block size nor the padding byte is given the CDR Converter v2.0 tries to detect them automatically for padding byte values of 0x00 and 0xFF.
File and message headers
Some CDR files have a file header and a header before each CDR. These headers are not in ASN.1 format and cannot be decoded using ASN.1. However, the CDR Converter v2.0 introduces three new options to skip these headers.
In case of a fixed size file and message header, the option -filehdr skips the file header at the beginning of a file, and -msghdr skips the headers before each CDR.
CDR files which are based on the 3GPP specification TS32.297 can have a variable file and message header length. These header lengths depend on the used 3GPP release. With the option -3gpp the CDR Converter v2.0 gets these variable headers automatically and skips them accordingly.
TBCD and ASCII conversion
Some CDR data, like IMEI for example, is encoded using TBCD or hexadecimal encoding (using OCTET STRING). These formats are not always the required output formats. They can be changed and converted during conversion using the following mapping options:
- TBCD: Telephony Binary-Coded Decimal, an extension of BCD. Decimals are converted using the TBCD rules.
- TBCD-1: Same as TBCD except that the first byte is not converted.
- ASCII: hexadecimal data is mapped on corresponding ASCII characters.
Both mapping options have to be specified on OCTET STRING types in the generated mapping file.
Column separator for CSV
The default column separator in generated CSV files is the semicolon (;). However, the semicolon may sometimes be used in values. In this case, it cannot be used for column separation and must be changed to another character in order to keep the CSV file structure and avoid import errors.
The default column separator is changed using the -s option.
Mass conversion
In addition to the conversion of individual files (option -i), it is now possible to convert an entire directory of CDR files. The input directory is specified with the option -I.
The output directory is set with the option -O.
Logging and erroneous data
The process of decoding is by default dumped to the screen. This output is redirected to a logfile (.log) using the new -l option.
The CDR Converter v2.0 cannot recover from all possible errors. When erroneous data cannot be converted it is copied to a separate file containing all erroneous values (.err). The data is copied as is: it is the complete CDR in binary format. It is then possible to fix and process them separately.
Error handling in CDR files
Some CDRs are wrongly encoded and not fully compliant with the ASN.1 syntax or standard. This often results in decoding errors and skipping of CDR data.
Whenever possible, CDR Converter v2.0 tries resuming from decoding errors and converting data even from erroneous encodings. This is done automatically. No option needs to be set. The screen output (or generated log files if the option -l is used) should be checked after conversion for possible problems.
Support for MARBEN ASN.1 Value Editor project files
CDR Converter v2.0 now supports the usage of MARBEN ASN.1 Value Editor project files (.pra). This improves data exchange between the graphical user interface of the ASN.1 Value Editor and the CDR Converter.
With the ASN.1 Value Editor it can easily be checked whether the ASN.1 syntax and CDR data is correct and complete; it can easily be fixed if not. Further, some CDR projects require more than one ASN.1 file. Setting up an ASN.1 project file (.pra) with the ASN.1 Value Editor speeds up the process of compilation and conversion by avoiding missing definitions.