The CDR Resource Adaptor is configured using resource adaptor configuration properties and a configuration profile table.
The configuration is processed when you activate the resource adaptor or reconfigure it while it’s active.
Resource adaptor configuration properties
The CDR Resource Adaptor is configured using following configuration properties:
Property | What it does | Default | ||
---|---|---|---|---|
CdrStreamConfigurationProfileTable |
The name of a profile table defining CDR streams configuration. Each profile represents a CDR stream.
The table must use the |
CdrStreamConfiguration |
||
DefaultStream |
The stream name to be used when an SBB requests a CDR write using a resource adaptor provider interface method
without a stream name parameter.
If the stream name is provided, it must match the name of a profile defined in
|
empty |
||
ArchiveQueueSizeAlarmRaise |
If the archive queue size exceeds this value, the The value must be |
120 |
||
ArchiveQueueSizeAlarmClear |
If the archive queue size decreases below this value mthe The value must be |
80 |
Profile configuration
The CDR Resource Adaptor manages a set of CDR streams.
A CDR stream is configured by creating a profile in CdrStreamConfigurationProfileTable
.
The profile name is used as the CDR stream name.
Attribute | What it does | Default | ||||
---|---|---|---|---|---|---|
OutputDirectoryName |
Name of the directory into which the CDRs will be written. The resource adaptor must have write permissions for it. This parameter is mandatory. The directory will be created if it does not exist when the resource adaptor configuration is verified. This will happen before the resource adaptor is activated. The directory will also be created if it is missing when a new CDR file is created.
|
${rhino.dir.home}${/}cdr |
||||
CdrFileType |
The CDR file type to use. Either |
Binary |
||||
FilenamePattern |
Pattern used to generate final CDR filenames.
|
cdr_%n_%M_%t.log |
||||
TempFilePrefix |
Prefix used as part of the temporary CDR filename. That is, the file to which currently generated call data records are written. The full filename format for temporary CDR file is: TempFilePrefix RHINO NODE ID CDR STREAM NAME _*.tmp where
|
cdr_ |
||||
MaxSize |
Approximate maximum size in bytes before a new CDR file is started.
After a CDR is written, the total file size is compared to
|
1,000,000 bytes (approx 1MB) |
||||
MaxCdrs |
Number of CDRs to be written to a CDR file before a new file is started.
|
0 (no rollover) |
||||
MaxInterval |
Number of milliseconds of operation before time-based file rollover.
If a CDR file is used for more than The value must be either
|
0 (no rollover) |
||||
Header |
If
|
True |
||||
Footer |
If
|
True |
||||
CreateEmptyFiles |
If If |
False |
||||
ArchiveCommand |
Command to run on each CDR file completion.
If empty, no command is run.
|
empty |
||||
Charset |
Character encoding to use for the output file. |
ISO-8859-1 |
||||
WriteTimeout |
Time, in milliseconds, to wait for a CDR write to complete before returning a timeout error to the calling SBB. The value must either If
|
5000 (5 seconds) |
||||
WriteRetry |
Delay, in milliseconds, to wait after a CDR write error before attempting another CDR write.
Value must be greater than or equal to |
30000 (30 seconds) |
||||
WriteSync |
If If
|
True |
File permissions
The security permission spec in the resource adaptor descriptor contains the following default permissions:
// rhino.dir.home - the install directory for Rhino SDK, the node-nnn directory for Rhino Production. permission java.io.FilePermission "${rhino.dir.home}${/}cdr", "read, write, execute"; permission java.io.FilePermission "${rhino.dir.home}${/}cdr${/}-", "read, write, execute"; permission java.io.FilePermission "${rhino.dir.home}${/}cdr-bin", "read, execute"; permission java.io.FilePermission "${rhino.dir.home}${/}cdr-bin${/}-", "read, execute"; // rhino.dir.base - the install directory for both Rhino Production and Rhino SDK permission java.io.FilePermission "${rhino.dir.base}${/}cdr", "read, write, execute"; permission java.io.FilePermission "${rhino.dir.base}${/}cdr${/}-", "read, write, execute"; permission java.io.FilePermission "${rhino.dir.base}${/}cdr-bin", "read, execute"; permission java.io.FilePermission "${rhino.dir.base}${/}cdr-bin${/}-", "read, execute"; // deprecated, retained for compatibility permission java.io.FilePermission "${rhino.dir.home}${/}archive-cdr-log.sh", "read, execute"; permission java.io.FilePermission "${rhino.dir.home}${/}cdr${/}archive-cdr-log.sh", "execute"; permission java.io.FilePermission "${rhino.dir.base}${/}archive-cdr-log.sh", "read, execute"; permission java.io.FilePermission "${rhino.dir.base}${/}cdr${/}archive-cdr-log.sh", "read, execute";
Specifying an output directory or archive command that is not covered by the above permissions will require a new permission to be added to the deployable unit, using a Rhino management tool.
The Rhino Element Manager is the simplest way to make manual changes, and there is an Ant task for scripted deployment.
Filename patterns
The FilenamePattern
configuration parameter should include format specifiers that are replaced to generate unique
filenames. The supported specifiers are:
Specifier | Description | ||
---|---|---|---|
%% |
A literal |
||
%t |
File completion timestamp, as milliseconds since Jan 1 1970 00:00 UTC |
||
%T |
File creation timestamp, as milliseconds since Jan 1 1970 00:00 UTC |
||
%s |
Auto-incrementing file completion sequence number, starting at 1
|
||
%d |
File completion timestamp, formatted as yyyyMMddHHmmss |
||
%D |
File creation timestamp, formatted as yyyyMMddHHmmss |
||
%n |
Rhino node ID responsible for creating this file |
||
%M |
CDR stream name where characters other than |
Property expansion
Certain CDR resource adaptor configuration properties support system property expansion.
This mechanism is similar to expanding variables in a shell. That is, when a string like
${some.property}
appears as part of a configuration property value, it will be expanded to the value of the system
property. For example,
${user.home}/cdr
will expand ${user.home}
to use the value of the user.home
system property.
If that property’s value is /home/rhino
, then the above is equivalent to
/home/rhino/cdr
Two useful properties for specifying paths (used in the default file permissions) are
rhino.dir.home
and rhino.dir.base
:
Property | What it refers to |
---|---|
rhino.dir.home |
the install directory for Rhino SDK, the |
rhino.dir.base |
the install directory for both Rhino Production and Rhino SDK |
In order to assist in platform-independent configuration, you can also use the special notation of ${/}
, which is a
shortcut for ${file.separator}
.
CDR stream persistence, error handling, and operational state
If stream configuration attributes WriteTimeout
is set to a non-zero value and WriteSync
is set to True
, the CDR
resource adaptor ensures that all written CDR data has been flushed to disk (using java.io.FileDescriptor.sync()
)
before returning to an SBB.
In that case, after a successful writeCDR
call, SBBs should assume that all CDR data has been saved to disk.
The exact behaviour of java.io.FileDescriptor.sync() is dependent on the operating system, drivers and
hardware. In some environments the sync() call may return successfully before the data is permanently stored.
|
If there is a write error while writing the CDR, and the WriteTimeout
stream configuration attribute is set to a
non-zero value, this will be reported to the SBB as an IOException
.
If the CDR could not be written within the configured WriteTimeout
, then a
com.opencloud.slee.resources.cdr.WriteTimeoutException
(a subclass of IOException
) is reported to the SBB.
In general, receiving an exception means that the CDR resource adaptor could not guarantee that the CDR was successfully written. |
Under normal operation, a CDRProvider.isOperational()
call directed towards any stream returns True
.
If a write error or timeout error occurred recently for a stream, a isOperational()
call towards that stream returns
False
. All attempts to write CDRs to such streams are immediately rejected without attempting to write them to disk.
This state persists for 2 * WriteTimeout
milliseconds (for timeout errors) or WriteRetry
milliseconds (for write
errors).
Additionally, isOperational()
returns False
if the resource adaptor entity is currently inactive (but was
successfully activated at least once).
Services should test isOperational()
if they wish to behave differently when CDR writing is unavailable.
In the event of a write error, or if a Rhino node unexpectedly exits, partial CDR files may be left in the CDR
directory.
With the default configuration value of TempFilePrefix
, these files are named cdr_nodeID_streamName_*.tmp
where *
denotes a random number.
If they contain useful CDR data, these files will need to be manually examined and processed.
Active reconfiguration
The resource adaptor supports active reconfiguration. You can update configuration properties without having to deactivate the resource adaptor entity.
Changes to stream configuration profiles are not automatically discovered by the resource adaptor
For the stream configuration to take effect, you must trigger a configuration reload after changing the profile table. To trigger a configuration reload…
|
When the configuration is updated, the resource adaptor will compare the new configuration with the previous valid configuration to determine which streams need to be:
-
stopped and removed — when a profile representing the stream was removed; that is, there is no profile with a profile name equal to the CDR stream name
-
created and started — when a new profile was added
-
reconfigured — when attributes of an existing profile were changed; that is, attribute values of a profile with the same CDR stream name are different than attribute values previously used by the resource adaptor.
If errors are encountered when adding new streams or reconfiguring existing streams, the configuration update is aborted. No changes to the existing "in use" configuration are made.
Changing configuration of a stream that is in use results in a rollover of the stream’s CDR file. The newly created CDR file is configured based on the updated stream configuration. CDRs will not be lost during stream reconfiguration. |