EdrApp

EDR Application Configuration

The N2SVCD EDR Application is a utility application which performs all the write-to-file functions on behalf of all applications which generate EDRs. This functionality is separated into a separate application because writing/flushing to file can be a synchronous blocking task which could interfere with real-time call processing.

You should only ever require one EDR Application instance within the N2SVCD, although it is possible to run multiple apps. You don’t need to run any EDR Application at all, if you have set edr_enabled to 0 in the configuration for all applications that would otherwise write EDRs.

The following configuration is used to create a EDR Application instance.

Note that applications sending EDR-LOG messages will default to an edr_app_name parameter = EDR, and so it is convenient to configure the EdrApp with name EDR in order to minimise the configuration for the sending applications.

<?xml version="1.0" encoding="utf-8"?>
<n2svcd>
  ...
  <applications>
    ...
    <application name="EDR" module="EdrApp">
      <include><lib>../apps/edr/lib</lib></include>
      <parameters>
        <parameter name="edr_retry_interval" value="15"/>
        <parameter name="default_edr_directory" value="/tmp/edr"/>
        <parameter name="default_edr_max_file_edrs" value="1024"/>
        <parameter name="default_edr_max_file_secs" value="300"/>
        <parameter name="default_edr_max_flush_edrs" value="64"/>
        <parameter name="default_edr_max_flush_secs" value="10"/>
      </parameters>
      <config>
        <streams>
          <stream key="n2dsg" edr_directory="/EDR/DSG" edr_max_file_edrs="4096" edr_max_flush_edrs="128"/>
        </streams>
      </config>
    </application>
    ...
  </applications>
  ...
</n2svcd>

Configuration Details

The application element attributes for an EDR Application instance may include the below.

For details of the various parameter types used, refer to Common Configuration.

Parameter Name Type XML Type Description
See: Common Application configuration
module String Attribute [Required] EdrApp
include.lib String Element [Required] ../apps/manage/lib
parameters Array Attribute [Required] As per Common Configuration Application parameters.
"edr_enabled" - - This value is ignored; the EDR Application does not support writing EDRs.
"edr_filesystem_check_secs" Integer Attribute How frequently the EDR app will check directories for free space and writablity.
(Default = 5)
"edr_filesystem_min_mb" Integer Attribute The minimum number of available MB of disk space before the EDR application will stop creating new EDR files.
When the available space drops beyond this point, all streams writing to this directory will be disabled, EDR files in progress will be closed, and new EDRs arriving will be discarded.
(Default = 64)
"edr_num_files_shown" Integer Attribute The number of recent EDR files reported via the management API.
(Default = 20)
"edr_retry_interval" Integer Attribute How many seconds until retry after failing to open/write to an EDR file.
(Default = 30)
"default_edr_directory" String Attribute Default directory for writing output streams.
(Default = /var/lib/n2svcd/edrs)
"default_edr_max_file_edrs" Integer Attribute Default maximum number of EDRs that will ever be written to a single EDR file.
When this number is reached, the EDR file will be closed and a new EDR file started.
(Default = 10000, maximum = 5000000)
"default_edr_max_file_secs" Integer Attribute Default maximum number of seconds that a single EDR file will ever be open.
When this number is reached, the EDR file will be closed and a new EDR file started.
(Default = 300, maximum = 3600)
"default_edr_max_flush_edrs" Integer Attribute Default maximum number of EDRs held in-memory before flushing to the filesystem.
When this number is reached, the in-memory buffer will be flushed to file.
(Default = 20, maximum = 10000)
"default_edr_max_flush_secs" Integer Attribute Default maximum number of seconds of EDR data held in-memory before flushing to the filesystem.
When this number is reached, the in-memory buffer will be flushed to file.
(Default = 10, maximum = 300)
config Object Element Container for extended configuration for this application.
.streams Array Element Array of EDR stream elements for overriding defaults on individual EDR streams.

EDR Streams

EDR streams define per-stream configuration overrides. Streams are not automatically created. You must pre-define streams for each stream key used by Applications which will be sending EDRs to the EdrApp.

Each stream Object in the config.streams Array is configured as follows.

Parameter Name Type XML Type Description
edr_directory String Attribute Directory for writing this EDR output stream.
(Default = /var/lib/n2svcd/edrs)
edr_max_file_edrs Integer Attribute The maximum number of EDRs that will ever be written to a single EDR file.
When this number is reached, the EDR file will be closed and a new EDR file started.
(Default = 2000)
edr_max_file_secs Integer Attribute The maximum number of seconds that a single EDR file will ever be open.
When this number is reached, the EDR file will be closed and a new EDR file started.
(Default = 300)
edr_max_flush_edrs Integer Attribute The maximum number of EDRs held in-memory before flushing to the filesystem.
When this number is reached, the in-memory buffer will be flushed to file.
(Default = 20)
edr_max_flush_secs Integer Attribute The maximum number of seconds of EDR data held in-memory before flushing to the filesystem.
When this number is reached, the in-memory buffer will be flushed to file.
(Default = 5)

Message Handling

In addition to the common Application management messages, the EdrApp uses the following messages: