Result-Code Rules

Diameter Result-Code Rules

When Diameter answer messages are received from the OCS, the application can be configured to behave differently depending on the Result-Code value(s) received. Rules are applied in the order listed until a match is made to the received value.

Each rule can specify either a single code or an inclusive range of codes for matching. Once matched, various actions can be taken: continue the call, play an announcement, etc. If a rule does not specify any matching criteria, it will always match; this should only be used as a catch-all.

The Result-Code at the Diameter Multiple-Services-Credit-Control level takes priority over the Result-Code at the root level. If the action applied for the Multiple-Services-Credit-ControlResult-Code is anything other than continue or announcement_continue, the rating session will be closed on the OCS if required (i.e. if the root Result-Code was 2xxx).

Note that there are two special cases where a Result-Code will be generated and used to determine the action to take: * If a Diameter message cannot be delivered to the OCS, or no response is received, a Diameter Result-Code value of 3002 (DIAMETER_UNABLE_TO_DELIVER) will apply. * When starting or extending the charged portion of a call, if the OCS returns a successful response but does not return any granted units, a Diameter Result-Code value of 4012 (DIAMETER_CREDIT_LIMIT_REACHED) will apply. In this case, the Diameter EDR fields RC_ORIG_ROOT and RC_ORIG_MSCC will be used to show the original Result-Code values received.

Configuration Details

Each rule can support the following attributes:

| Attribute | Type | Description | | :-------: | :--: | :---------- | | `action` | String | **[Required]** The action to take when this rule is matched. Possible values are shown under [Result-Code Rule Actions](#result-code-rule-actions). | | `from` | Integer | **[Required with `to`]** The start Diameter `Result-Code` for an inclusive range match. If provided, `to` must also be set, and must be greater than or equal to the `from` value. Mutually exclusive with `code`. | | `to` | Integer | **[Required with `from`]** The end Diameter `Result-Code` for an inclusive range match. If provided, `from` must also be set, and must be less than or equal to the `to` value. Mutually exclusive with `code`. | | `code` | Integer | A single Diameter `Result-Code` to match on for rule selection. Mutually exclusive with `from` and `to`.
(Default: all codes) | | `tag` | String | **[Conditional]** The [tag](/config/dsg_scp/diameter/tags.html) name to match the value for. If `tag` is present, `value` must also be present. | | `tag_x` | String | **[Conditional]** As for `tag`, but with `x` representing a unique pairing, e.g. `tag_1` or `tag_a`. A matching `value_x` must also be present. | | `value` | (various) | **[Conditional]** The string or integer value to match against during rule selection. Required when `tag` is present. | | `value_x` | (various) | **[Conditional]** As for `value`, but with `x` representing a unique pairing, e.g. `value_1` or `value_a`. A matching `tag_x` must also be present. | | `originating` | Boolean | Whether this rule applies for [MO calls](/applications/dsg_scp.html#traffic-type-determination).
(Default: `true`) | | `forwarding` | Boolean | Whether this rule applies for [MF calls](/applications/dsg_scp.html#traffic-type-determination).
(Default: `true`) | | `terminating` | Boolean | Whether this rule applies for [MT calls](/applications/dsg_scp.html#traffic-type-determination).
(Default: `true`) | | `at_initial` | Boolean | Whether this rule applies at the initial OCS interrogation, i.e. the Diameter `CC-Request-Type` is `1` (`INITIAL_REQUEST`).
(Default: `true`) | | `at_update` | Boolean | Whether this rule applies at interim OCS interrogations, i.e. the Diameter `CC-Request-Type` is `2` (`UPDATE_REQUEST`). Note that [some actions](#result-code-rule-actions) are not applicable at interim interrogation.
(Default: as for [Result-Code Rule Actions → Valid At](#result-code-rule-actions)) | | `at_terminate` | Boolean | Whether this rule applies at the final OCS interrogation, i.e. the Diameter `CC-Request-Type` is `3` (`TERMINATE_REQUEST`). Note that [some actions](#result-code-rule-actions) are not applicable at final interrogation.
(Default: as for [Result-Code Rule Actions → Valid At](#result-code-rule-actions))) | | `is_bf` | Boolean | Whether this rule represents a failure at the billing layer (and therefore may require post-call adjustment). When matched, will mark the EDR created as experiencing a billing failure.
(Default: `true` in `Result-Code` range `3000` to `3999`, otherwise `false`) | `cause` | Integer | The release cause to send to the network if the `action` releases the call.
(Default: `31`) | | `seconds` | Integer | **[Required with `action` = `continue_period`]** The number of seconds a call to continue for unbilled, if appropriate to the `action`. | | `announcement_id` | Integer | **[Required with `action` = `announcement_release` or `announcement_connect`]** The announcement ID to play to the caller, if appropriate to the `action`. | | `srp_name` | Integer | **[Required with `action` = `announcement_release` or `announcement_connect`]** The SRP name (as configured in the `ScpApp`) to use to play an announcement to the caller, if appropriate to the `action`. | | `divert_to` | String | **[Required with `action` = `connect` or `announcement_connect`]** The normalised destination digits to connect the call to, if approrpiate to the `action`. | | (other available fields) | (various) | Any number of selector rule [available fields](/config/dsg_scp/diameter/selector_rules.html#available-fields). |

Result-Code Rule Actions

Each Diameter Result-Code rule allows the specification of a single action to take when a matching Diameter Result-Code is received from the OCS.

Note that if the calling party is no longer present in the call (i.e. they have hung up or been disconnected), no action will be able to be applied.

The following actions are available:

Action Required
Parameters
Optional
Parameters
Valid At Description
continue - - (all) Continue the call normally with rating interaction where applicable.
continue_free - - initial Allow the call to continue unmonitored on the network with no further rating interaction.
continue_period seconds initial
update
Allow the call to continue monitored on the network for a limited time with no further rating interaction.
release - cause (all) Release the call immediately with the given cause.
connect divert_to - initial Terminate the call to the provided divert_to with no further rating interaction.
announcement_continue announcement_id
srp_name
- initial Play announcement ID announcement_id on the resource srp_name (as configured under SRP Endpoints) and then apply handling as for continue.
announcement_release announcement_id
srp_name
cause initial Play announcement ID announcement_id on the resource srp_name (as configured under SRP Endpoints) and then apply handling as for release.
announcement_connect announcement_id
srp_name
divert_to
- initial Play announcement ID announcement_id on the resource srp_name (as configured under SRP Endpoints) and then apply handling as for connect.
abort - - (all) Send a TC_ABORT to end the call immediately.

Default Result-Code Actions

The below default rules are always applied after all configured Result-Code action rules to act as a fallback. They may not be disabled, but earlier rules will be used in preference (including rules with no selectors which will always be chosen as fallbacks):

<result_codes>
    <rule from="2000" to="2999" action="continue" />
    <rule from="3000" to="3999" is_bf="true" action="release" />
    <rule action="release" />
</result_codes>