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-Control
→ Result-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 of3002
(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 of4012
(DIAMETER_CREDIT_LIMIT_REACHED
) will apply. In this case, the Diameter EDR fieldsRC_ORIG_ROOT
andRC_ORIG_MSCC
will be used to show the originalResult-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. |
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 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 originating calls. (Default: true ) |
forwarding |
Boolean | Whether this rule applies for forwarding calls. (Default: true ) |
terminating |
Boolean | Whether this rule applies for terminating calls. (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 are not applicable at interim interrogation.(Default: as for Result-Code Rule Actions → Valid At) |
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 are not applicable at final interrogation.(Default: as for Result-Code Rule Actions → Valid At)) |
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 . |
announcement_source |
String | The tag to use as the announcement ID to play to the caller, if appropriate to the action . If no value or a non-numeric value is found, announcement_id will be used instead. |
srf_name |
String | [Required with action = announcement_release or announcement_connect ] The SRF name (as configured in the ScpApp ) to use to play an announcement to the caller, if appropriate to the action . |
srf_source |
String | The tag to use as the SRF name to use to play an announcement to the caller, if appropriate to the action . If no value or a non-numeric value is found, srf_name will be used instead. |
divert_to |
String | [Required with action = connect or announcement_connect ] The normalised destination digits to connect the call to, if approrpiate to the action . |
notification |
String | A notification message name to send when this rule applies. |
fci or sci |
String | An FCI or SCI message name to send when this rule applies. Only available for certain actions and must have at_initial /at_update /at_terminate set to 1 /0 /0 , respectively. |
(other available fields) | (various) | Any number of selector rule 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 | FCI/SCI? | Description |
---|---|---|---|---|---|
continue |
- | - | (all) | Yes | Continue the call normally with rating interaction where applicable. |
continue_free |
- | - | initial |
Yes | Allow the call to continue unmonitored on the network with no further rating interaction. |
continue_period |
seconds |
initial update |
Yes | Allow the call to continue monitored on the network for a limited time with no further rating interaction. FCI/SCI may only be sent at initial . |
|
release |
- | cause |
(all) | No | Release the call immediately with the given cause . |
connect |
divert_to |
- | initial |
Yes | Terminate the call to the provided divert_to with no further rating interaction. |
announcement_continue |
announcement_id srf_name |
announcement_source srf_source |
initial |
Yes | Play announcement ID announcement_id on the resource srf_name (as configured under SRF Endpoints) and then apply handling as for continue . |
announcement_release |
announcement_id srf_name |
announcement_source srf_source cause |
(all) | No | Play announcement ID announcement_id on the resource srf_name (as configured under SRF Endpoints) and then apply handling as for release . |
announcement_connect |
announcement_id srf_name divert_to |
announcement_source srf_source |
initial |
Yes | Play announcement ID announcement_id on the resource srf_name (as configured under SRF Endpoints) and then apply handling as for connect . |
abort |
- | - | (all) | No | 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>