To invoke the List CDRs tool, run the list-cdrs.sh
script under the ipsmgw-sdk/tools/list-cdrs
directory.
Pass one or more file paths as arguments, each being a path to a completed binary CDR file generated by Sentinel.
If the ipsmgw-sdk/tools parent directory does not contain a list-cdrs directory, then the List CDRs tool needs to be
installed. The Installing List CDRs page describes how to install the List CDRs tool.
|
Calling the script with no arguments shows the expected syntax:
$ ./tools/list-cdrs/list-cdrs.sh Usage: list-cdrs.sh [--no-header] [--no-footer] [--no-protocol] [--ignore-error] [--output-file OUTPUTFILE] [--size-limit BYTES] [--cdr-filter FIELD=REGEX] CDRFILE [CDRFILE]... --no-header - Disable printing of CDR headers. --no-footer - Disable printing of CDR footers. --no-protocol - Disable printing of protocol and spec revisions in top level AVPs, e.g. "(Ro,vcb0)". --ignore-error - Continue processing CDRs files when encountering recoverable errors. --list-icids - List all unique IMS Charging Identifiers in the given CDR file(s), in order of first appearance. --filter-by-icid ICID - Print CDR message body only when CDR contains the given IMS Charging Identifier. ICID can be listed by "--list-icids" option. --output-file OUTPUTFILE - Append CDR output to OUTPUTFILE rather than to the console. --size-limit BYTES - CDR record size limit. Minimum and default value is 67108864 (64MB). Increase if encountering "Protocol message was too large" exception. --cdr-filter FIELD=REGEX - Print CDR message body only when the given FIELD matches the given regular expression. FIELD can be a field name, an AVP name, or an AVP path like "/IMS-Information/User-Session-Id". CDRFILE - A completed binary CDR file as produced by Sentinel. Both the new AVP based format (Sentinel 2.5 and later) and the older format (Sentinel 2.4 and earlier) are supported. CDR files can optionally be in gzip format, using a '.gz' suffix. Partially written CDR files (ending in ".tmp") are not supported.
An example invocation, showing how to print a CDR file:
2016-08-03T20:45:47.569+1200 Header { ra_name=CDR Generation, ra_vendor=OpenCloud, ra_version=2.3, ra_release=2.3.0.0, ra_build=20160715041441, ra_revision=cdr-ra/2.3.0@a177ef4, description=CDR session, rhino_node=101, ra_entity=cdr, hostname=stroganoff.opencloud.co.nz } 2016-08-03T20:45:47.575+1200 AvpCdr { avps=[ IMS-Information(Ro,vcb0)[ Node-Functionality[AS(6)], Session-Priority[PRIORITY_2(2)] ], Service-Context-Id(Ro,vcb0)[12.32274@3gpp.org], OC-Sentinel-Selection-Key(Ext,Ext)[DefinitelyNotOpenCloud:DefinitelyNotOpenCloud:map:SRI4SM:], OC-Service-Type(Ext,Ext)[Unknown(1)], OC-Charging-Result(Ext,Ext)[-1], OC-Sentinel-Error(Ext,Ext)[None(1)], OC-Plan-Id(Ext,Ext)[SRI4SM], OC-Submit-Report-Type(Ext,Ext)[NOT_APPLICABLE(1)], MSISDN(Ro,vcb0)[46 21 43 65 87], OC-MT-Correlated-Id(Ext,Ext)[001010000000000], OC-MT-PS-Delivery-Result(Ext,Ext)[NOT_ATTEMPTED(1)], OC-MT-CS-Delivery-Result(Ext,Ext)[NOT_ATTEMPTED(1)], SMS-Information(Ro,vcb0)[ Originator-SCCP-Address[00 08 53 63 63 70 41 64 64 72 65 73 73 5b 74 79 70 65 3d 43 37 2c 72 6f 75 74 65 4f 6e 44 50 43 3f 3d 66 61 6c 73 65 2c 6e 61 74 69 6f 6e 61 6c 55 73 65 3f 3d 74 72 75 65 2c 67 74 20 69 6e 64 69 63 61 74 6f 72 3d 47 54 5f 30 30 30 31 2c 6e 61 74 75 72 65 3d 33 20 28 6e 61 74 69 6f 6e 61 6c 20 28 73 69 67 6e 69 66 69 63 61 6e 74 29 20 6e 75 6d 62 65 72 29 2c 61 64 64 72 65 73 73 3d 36 34 31 32 33 5d], Recipient-Info[ Recipient-SCCP-Address[00 08 53 63 63 70 41 64 64 72 65 73 73 5b 74 79 70 65 3d 43 37 2c 72 6f 75 74 65 4f 6e 44 50 43 3f 3d 74 72 75 65 2c 6e 61 74 69 6f 6e 61 6c 55 73 65 3f 3d 74 72 75 65 2c 70 63 3d 36 20 28 30 2f 30 2f 36 29 2c 73 73 6e 3d 31 34 37 5d] ] ] ] } 2016-08-03T20:45:48.685+1200 AvpCdr { avps=[ IMS-Information(Ro,vcb0)[ Role-Of-Node[ORIGINATING_ROLE(0)], Node-Functionality[AS(6)], Session-Priority[PRIORITY_2(2)], Called-Party-Address[sip:127.0.0.1:5060], ], Service-Context-Id(Ro,vcb0)[12.32260@3gpp.org], OC-Sentinel-Selection-Key(Ext,Ext)[DefinitelyNotOpenCloud:DefinitelyNotOpenCloud:sipcall:MTFSM_DR:], OC-Call-Type(Ext,Ext)[MOC(1)], OC-Service-Type(Ext,Ext)[Message(5)], OC-Charging-Result(Ext,Ext)[-1], OC-Sentinel-Error(Ext,Ext)[None(1)], OC-Call-Id(Ext,Ext)[e-gJhCPjtEDqoZWG8yBIng], OC-Plan-Id(Ext,Ext)[MTFSM_DR], OC-Submit-Report-Type(Ext,Ext)[NOT_APPLICABLE(1)], OC-MT-PS-Delivery-Result(Ext,Ext)[NOT_ATTEMPTED(1)], OC-MT-CS-Delivery-Result(Ext,Ext)[NOT_ATTEMPTED(1)], SMS-Information(Ro,vcb0)[ ] ] } 2016-08-03T20:45:48.878+1200 AvpCdr { avps=[ IMS-Information(Ro,vcb0)[ Node-Functionality[AS(6)], Session-Priority[PRIORITY_2(2)] ], Service-Context-Id(Ro,vcb0)[12.32274@3gpp.org], OC-Sentinel-Selection-Key(Ext,Ext)[DefinitelyNotOpenCloud:DefinitelyNotOpenCloud:map:MTFSM_PS_CS:], OC-Service-Type(Ext,Ext)[Unknown(1)], OC-Charging-Result(Ext,Ext)[-1], OC-Sentinel-Error(Ext,Ext)[None(1)], OC-End-Session-Cause(Ext,Ext)[202], OC-Plan-Id(Ext,Ext)[MTFSM_PS_CS], OC-Submit-Report-Type(Ext,Ext)[NOT_APPLICABLE(1)], MSISDN(Ro,vcb0)[46 21 43 65 87], TGPP-IMSI(Ro,vcb0)[001010000001001], OC-MT-Correlated-Id(Ext,Ext)[001010000000000], OC-MT-PS-Delivery-Result(Ext,Ext)[DELIVERY_SUCCEEDED(2)], OC-MT-CS-Delivery-Result(Ext,Ext)[NOT_ATTEMPTED(1)], OC-IMPU(Ext,Ext)[tel:+6412345678], SMS-Information(Ro,vcb0)[ Originator-SCCP-Address[00 08 53 63 63 70 41 64 64 72 65 73 73 5b 74 79 70 65 3d 43 37 2c 72 6f 75 74 65 4f 6e 44 50 43 3f 3d 66 61 6c 73 65 2c 6e 61 74 69 6f 6e 61 6c 55 73 65 3f 3d 74 72 75 65 2c 67 74 20 69 6e 64 69 63 61 74 6f 72 3d 47 54 5f 30 30 30 31 2c 6e 61 74 75 72 65 3d 33 20 28 6e 61 74 69 6f 6e 61 6c 20 28 73 69 67 6e 69 66 69 63 61 6e 74 29 20 6e 75 6d 62 65 72 29 2c 61 64 64 72 65 73 73 3d 36 34 31 32 33 5d], Recipient-Info[ Recipient-SCCP-Address[00 08 53 63 63 70 41 64 64 72 65 73 73 5b 74 79 70 65 3d 43 37 2c 72 6f 75 74 65 4f 6e 44 50 43 3f 3d 74 72 75 65 2c 6e 61 74 69 6f 6e 61 6c 55 73 65 3f 3d 74 72 75 65 2c 70 63 3d 36 20 28 30 2f 30 2f 36 29 2c 73 73 6e 3d 31 34 37 5d] ] ] ] } 2016-08-03T20:45:50.554+1200 Footer {}
Logging output
The List CDRs tool writes its main output to the console, but it can be configured to write some extra debugging to a log file.
It uses the log4j logging library, and its log4j configuration file is located
at ipsmgw-sdk/list-cdrs/log4j.properties
.
By default, it will log to ipsmgw-sdk/tools/list-cdrs/logs/list-cdrs.log
. It logs very little
when using the default configuration — the log file will typically be empty unless configured
for debug logging.
To enable debug logging, change the log level on the last line of the log4j.properties
file to DEBUG
:
log4j.logger.sentinel.cdr=DEBUG