Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation  Back up to About Overview 
  
[+] Expand All
[-] Collapse All

Displaying CDR Information

CDRs are created periodically (for partial CDRs), at the end of a session (for session CDRs), or at logon (for fixed fee). You set fields in the [Settings] section of cdracct.acc to generate CDRs within sessions. See Table 175 for a list of settings that affect CDR creation.

CDR Files

CDR filenames are assigned to CDRs with the filename incremented by one for every CDR file generated within the same session. All CDR files have a .cdr, .cdr1, .cdr2, or .cdr2a extension, depending on the setting for the CdrType field in the cdracct.acc file described in Table 175. The CdrType and .cdr file extension are summarized in Table 176

Table 176: CdrType Settings in cdracct.acc and Resulting CDR Versions and Filename Extensions

CdrType Setting in cdracct.acc file

CDR Version Generated

CDR Filename Extension

CdrType=BinaryV1

Binary Version 1

.cdr1

CdrType=BinaryV2

Binary Version 2

.cdr2

CdrType=Asn1V2

ASN1 Version 2

.cdr2a

no setting specified

Binary Version 1

.cdr

The following example shows a listing of the CDR files in the CDR directory:

$ ls
4436830d_00000003.cdr1 44368607_00000003.cdr1 4436865f_00000003.cdr1
4436830d_00000004.cdr2 44368607_00000004.cdr2 4436865f_00000004.cdr2
4436830d_00000001.cdr2a 44368607_00000001.cdr2a 4436865f_00000001.cdr
443c0b94_00000001.cdr 4436830d_00000002.cdr2 44368607_00000002.cdr2
4436865f_00000002.cdr2

Using cdrdump to Display CDR File Contents

CDR files are binary or ASN.1 type files. The cdrdump tool provided with the optional authentication module displays the contents of a CDR file.

Note: Use the CdrType field in the [Settings] section of the cdracct.acc file to set the type of CDR file (binary version 1, binary version 2, or ASN.1). See Table 175 for more information.

To display CDR contents using cdrdump:

  1. Go to the radius/CDR directory and enter the list command to view the CDR filenames. For example:

    $ ls

  2. Enter the cdrdump command in the following format:

    $ ../cdrdump [-r] filename

    where:

    filename is the CDR filename as described in CDR Files.

    -r sets the display to raw format.

    The -r raw format command produces unformatted data but does display field names and data types. In raw format, every byte is displayed, even the insignificant bytes (such as those past the end-of-string NUL character). Omitting the -r field causes the display to appear in formatted mode. Table 177 lists the differences between raw mode and formatted mode.

    You cannot use the -r field for ASN1 (extension cdr2a) files. To display ASN1 files in raw format, see Displaying ASN1 CDR Files in Raw Format Using dumpasn1.

    Note: You can send the output of cdrdump to a file with the command
    $ ../cdrdump filename > output_filename.

  3. View the cdrdump output. Refer to CDR Fields for information about each field of information. The following listing shows example output from a CDR file:

    Note: You can use the UNIX od command to display the cdrdump file contents in purely raw format (all hexadecimal with no field names or data types displayed).

    Example: $- od -x fname

cdrdump Output

You can specify that cdrdump output be formatted or raw using the -r switch with the cdrdump command. (See Step 2 in Using cdrdump to Display CDR File Contents.) Table 177lists the differences between formatted and raw output.

Table 177: Differences Between Raw and Formatted cdrdump Output

Output Type

Formatted

Raw

Numbers

Decimal

Hexadecimal

IP addresses

IPv4 (dotted quad) if the first 12 bytes are zeroes.

IPv6 if the first 12 bytes are non-zero.

IPv6

Timestamps

Version 1: Local time

Version 2 and ASN.1: Universal Coordinated Time

Hexadecimal number of seconds since the UNIX epoch followed by ISO format

strings

Terminated at the first null character

Every character is included

BCD strings

Terminated at the first nibble inconsistent with BCD encoding (such as 0xf)

All bytes are displayed in hexadecimal

Version 1 reserved fields

Not displayed

Displayed

Bytes displayed

Only relevant characters are displayed.

Every byte is displayed, including those past the end-of-string null characters.

Displaying ASN1 CDR Files in Raw Format Using dumpasn1

To display ASN.1 CDRs in raw format, use the dumpasn1 tool located in the radius directory. When invoking the dumpasn1 command, always use the -z option to ensure that zero-length fields are displayed properly, as shown in the following example:

dumpasn1 -z filename.cdr2a

Note: CDR files for ASN.1 type can be displayed with formatting (not raw) using the cdrdump file as described in Using cdrdump to Display CDR File Contents.

Modified: 2017-09-27