This page describes tools for processing binary CDR files delivered as part of the CDR Resource Adaptor package.
Display binary CDR file content
The CDR Resource Adaptor package contains two user tools that can be used to display the content of a binary CDR file in text format.
Tool | Description | ||
---|---|---|---|
listcdrs.py |
A Python script that displays the content of a binary CDR file in text format. Usage: listcdrs.py CDRFILE
|
||
listcdrs.sh |
A shell script that starts a Java program capable of querying and displaying a binary CDR file’s content in text format. Usage: listcdrs.sh [--field field --regex regex] [--formatted] CDRFILE [CDRFILE]...
The The This tool also supports CDR binary files in gzip format.
Each file that ends with a |
When invoked without parameters, each tool displays a short usage message. |
Extendable binary CDR file processing tools
The CDR processing tool cdrpipeline
is a Java-based tool that streamlines development of custom binary CDR files'
processing logic.
The cdrpipeline
is responsible for loading and parsing binary CDR files. The actual CDR processing logic is
captured as plugins provided by the service developer, where cdrpipeline
plugins are implementations of the
CDRProcessor
interface.
The tool is delivered with abstract helper implementations of a CdrProcessor
that allow the service developer to cede
responsibility for decoding the binary CDR (protocol buffer message) to the helper class.
The service developer can then concentrate on creating custom processing logic without the need to reimplement the
boilerplate message-parsing code.
This effectively lets the service developer work with the binary CDR at the same abstraction level (protocol buffer
message) when generating the CDR in service code and when post-processing the resulting binary CDR files.
See also
The CDR File Tools API Javadoc.
|
Running the CDR Pipeline tool
The cdrpipeline
tool can be run using the cdrpipeline.sh
shell script delivered as part of the CDR resource adaptor
package.
cdrpipeline.sh [-i] [-p <property=value>] [-s <bytes>] -c <processor> [<processor>]... -f <cdrfile> [<cdrfile>]...
Option |
Description |
||
---|---|---|---|
-c <processor> [<processor>]... --chain <processor> [<processor>]... |
Class names representing
|
||
-f <cdrfile> [<cdrfile>]... --files <cdrfile> [<cdrfile>]... |
Binary CDR files to process.
|
||
-i --ignore-error |
If specified, the tool is to ignore record-processing errors and continue processing. |
||
-p <property=value> --processor-property <property=value> |
Custom property value pair to be used by CDR processors. |
||
-s <bytes> --size-limit <bytes> |
CDR record size limit. Minimal supported value is
|
This tool also supports CDR binary files in gzip format.
Each file that ends with a .gz
suffix is treated as compressed.
That is, there is no need to decompress such CDR files before running the tool.
Examples
To process all files in the ../../cdr
directory matching *.log.gz
using a processor that outputs stats for each file:
./cdrpipeline.sh -c com.opencloud.slee.resources.cdr.process.GenerateStatsCdrProcessor -f ../../cdr/*.log.gz
To process the same files using a processor that outputs formatted content of the CDRs, and increase the size limit for protobuf messages to 128MB:
./cdrpipeline.sh -c com.opencloud.slee.resources.cdr.process.listcdr.FormattedCdrProcessor -s 134217728 -f ../../cdr/*.log.gz
The other processor that can be used for simple (single-line) output is com.opencloud.slee.resources.cdr.process.listcdr.SimpleCdrProcessor
.
Developing a custom CDR Processor
To create and use a custom CdrProcessor
, you must implement the
com.opencloud.slee.resources.cdr.process.CdrProcessor
interface (or any of the implementing helper classes), and
place the compiled class
file (or jar
file) in the classpath used by cdrpipeline
.
Example CdrProcessor implementations are distributed as part of the
Example Service.
|
CDR Pipeline source code
The binary version of the cdrpipeline
tool is located in the lib
directory of the CDR resource adaptor package.
The relevant jar
files are described below:
Filename | Description | Required to compile against? |
---|---|---|
cdr-file-tools-VERSION.jar |
Classes constituting the |
Yes |
cdr-file-format-VERSION.jar |
Classes generated by the protocol buffers library, used to decode data from the binary CDR file. |
Yes |
protobuf-java-VERSION.jar |
Protocol buffers Java library, used to decode data from the binary CDR file. |
Yes |
log4j-VERSION.jar |
Log-handling library. |
No |
commons-cli-VERSION.jar |
Command-line parameters-handling library. |
No |
… where VERSION
represents the version of the CDR resource adaptor or library used.
The CDR Pipeline classpath
The classpath searched by the cdrpipeline
tool when using the provided cdrpipeline.sh
script includes:
-
the current working directory
-
jar
files in thelib
directory of the CDR resource adaptor package -
directories specified in the
OPT_JAR_LIST
environment variable (separated using the:
character).