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:
- Extract values from arbitrary returned AVPs to enrich processing within the
READ_AVPS
global. - Act on the Diameter
Result-Code
AVP value returned using selector rules within theRESULT_CODES
global.
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:
- If the Diameter
Result-Code
value4011
(DIAMETER_CREDIT_CONTROL_NOT_APPLICABLE
) is returned, allow the call to continue without monitoring or rating. - If the Diameter
Result-Code
value4012
(DIAMETER_CREDIT_LIMIT_REACHED
) is returned prior to final interrogation, the announcementann1
, then release the call with the default release cause. - If the Diameter
Result-Code
value4012
is returned at final interrogation, release the call with release cause16
and mark the EDR as a billing failure. - If the Diameter
Result-Code
value returned is for a transient (4xxx
) or permanent error (5xxx
), play announcement2
, then release the call with the default release cause. - For all other Diameter
Result-Code
values, apply default Result-Code rule handling. - Read the value of the
Cost-Information
→Unit-Value
→Value-Digits
andExponent
AVPs and write them to the rule engine variablescost_value
andcost_exp
respectively.
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:
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).