EDR Manager

EDR Manager

The EDR manager is a Lua object that is used to write all EDRs for N2IWF processing.

As the network session progresses through the N2IWF states, EDR information is passed to the EDR manager and EDRs are written as instructed.

Note that only a single instance of any given EDR type is available to be manipulated within the EDR manager at any given time. Requests to create EDRs will create a new instance if none already exists, and will update the fields of the current EDR of that type otherwise. Writing EDRs will flush all pending EDRs and allow the creation of new ones.

Attributes

The EDR manager should only be modified using its methods. Direct access to its attributes is not recommended.

Methods

The EDR manager is created as a new instance for each network session, so its methods should be accessed using the colon operator, e.g.:

edr_manager:write_edrs ()

As N2IWF EDRs have a fixed base format, the exposed methods of the EDR manager only allow for certain fields to be added in their signatures. For additional field population, use N2SVCD rule engine variables.

set_edr_grace / set_edr_diameter

These functions are used to create GRACE and DIAMETER EDRs, respectively.

Both functions take no arguments and return nothing.

update_edr_diameter_rule

This function is used to update an existing DIAMETER EDR once rule selection is complete.

This function takes two positional parameters:

set_edr_problem

This function is used to create a PROBLEM EDR.

This function takes three positional parameters:

Parameter Type Description
action String The action string that has been selected for use.
class String A freeform string for the error class.
message String A freeform string containing the error message.

This function returns nothing.

set_edr_external

This function is used to create an EXTERNAL EDR.

This function takes three positional parameters:

Parameter Type Description
action_type String The external action type string that was executed.
name String The external action name string that was executed.
mandatory Boolean Whether the external action rule was configured as mandatory.

This function returns nothing.

update_edr_external_complete

This function is used to update an existing EXTERNAL EDR to record the success or failure of an external action.

This function takes two positional parameters:

Parameter Type Description
ok Boolean Whether the external action succeeded or not.
message String If ok is false, a freeform string containing the error message.

This function returns nothing.

set_edr_pre / set_edr_post

These functions are used to create PRE and POST EDRs, respectively.

Both functions take a single argument - the action string that has been selected for use.

These functions return nothing.

write_edrs

This function is used to flush all pending EDRs, if any, for writing.

This function takes no parameters and returns nothing.