Diameter Responses

Diameter Responses

When a Diameter response is received, the N2IWF will parse the message to determine the action(s) to take with the session being processed.

Response configuration may be applied as LogicApp global variables:

A sample Diameter response configuration for CAMEL/INAP calls might be:

<global name="READ_AVPS" type="array">
    <avp name="Cost-Information">
        <avp name="Unit-Value">
            <avp name="Value-Digits" to_var="cost_value" />
            <avp name="Exponent" to_var="cost_exp" />
        </avp>
    </avp>
</global>

<global name="RESULT_CODES" type="array">
    <rule code="4011" action="free" />
    <rule code="4012" service.at_terminate="false" action="release" announcement="ann1" />
    <rule code="4012" is_bf="true" action="release" cause="16" />
    <rule from="4000" to="5999" action="release" announcement="ann2" />
</global>

This configuration would parse Diameter answers with the following behaviour when handling CAMEL/INAP calls:

Result-Code Rules

Result-Code rules are described elsewhere as a special case of N2IWF action rules.

Read AVPs

The LogicApp global variable READ_AVPS holds additional AVP definitions that are read from the Diameter response.

This global is an array of AVPs, with each avp definition containing either a source value or other avp definitions.

If a defined AVP (or a parent of a defined AVP) is not sent by the OCS, AVP parsing will not occur.

Note that all AVPs listed for parsing must exist in the N2SVCD Diameter codec or be specified in the Diameter application as custom AVPs.

In addition to the standard IWF selector rule extensions, each avp definition supports additional parameters:

Parameter Type Description
name String [Required] The AVP name for this definition. This name must be present in the default N2SVCD Diameter codec or configured as a custom AVP in the Diameter application.
edr String If provided, the AVP’s populated value will be written to EDRs produced in the field named. EDR population is influenced by the repeat and persist parameters.
to_var String If provided, the AVP’s populated value will be written to the rule engine variable named. Variable population is influenced by the repeat parameter.
repeat String Control the recording of each incidence via to_var and edr of the AVP being encountered in a single response. Possible values are:
  • overwrite: replace any existing value with the latest version
  • append: write the first instance of the AVP as normal and write any subsequent instances separated by a comma.
  • index: write each instance of the AVP separately with the name of the storage location followed by the instance number. For example, with to_var set to foo, the AVPs encountered would be written to foo1, foo2, etc. Note that this same numbering scheme applies even when the AVP is not repeated.
_(Default = repeat)
persist Boolean Controls the behaviour of the to_var parameter if this AVP is not present or does not have a value in a response. When set to true, the rule engine variable will always be set to the last received value of this AVP. If set to false, the named variable will be removed if the AVP value is not present.
Does not modify EDR storage - each DIAMETER or DIAMETER-A EDR will only write the AVP values received for a single response.
(Default: true)
value Array Holds the child AVPs to parse for Grouped AVPs. Note that this must specifically be marked as type="array" in order to be correctly processed as a complex global.

Note that specifying the repeat or persist parameters on a Grouped AVP will cause that behaviour to be applied to all children of that AVP unless specified again against a leaf AVP (in which case the re-specified value will be used for that AVP only) or against a grouped AVP (in which case the re-specified value will be used for all children unless re-re-specified, and so forth).