Selector Rules

Selector Rules

Selector Rules are used in various configuration contexts to define rules for selecting a value for a parameter based on a list of rules.

Rules are matched based on selectors to fields in the InitialDP (e.g. MSC address), derived from it (e.g. normalised calling party), or configured tags. Each rule must provide a value, either as a literal or copied from an InitialDP, derived, or tag field. All selectors in a rule must match in order for the rule to be selected. If no selectors are present (e.g. only a literal is configured), the rule will always match, acting as a catch-all.

Rules are traversed in order, and the first matching rule found will have its value extracted.

Note that, depending on the source network and the InitialDPeventTypeBCSM, some fields may not be available for selection. In such cases, rules using these fields for selection will be skipped.

An example configuration extract might be:

      <config>
        <diameter>
          <request>
              <service_identifiers>
                <rule eventTypeBCSM="3" serviceKey="1" bearerCap_itc="0" literal="201"/>
                <rule serviceKey="1" bearerCap_itc="0" literal="201"/>
                <rule serviceKey="1" literal="201"/>
                <rule serviceKey="2" literal="202"/>
                <rule bearerCap_itc="8" literal="301"/>
                <rule callingPartysCategory_hex="8" literal="401"/>
                <rule location="roaming" literal="402" />
                <rule literal="501"/>
              </service_identifiers>
              <rating_groups>
                <rule service_key="1" literal="2"/>
                <rule literal="2"/>
              </rating_groups>
              <requested_times>
                <rule literal="60"/>
              </requested_times>

The service_identifier rules here will attempt to assign a Diameter Service-Identifier based on the service key, bearer capability, calling party category, or derived location, with a fallback value if no deeper match occurs. The rating_group rules will check service key only, with a fallback value used otherwise. All InitialDP messages rececived will always use 60 as the Diameter Requested-Service-Unit.CC-Time value from the fallback rule.

Configuration Details

Each rule object for IDP selection can support the following attributes:

| Attribute | Type | Description | | :-------: | :--: | :---------- | | `literal` | String | **[Conditional]** The literal value to return when the rule is selected. One of `literal`, `idp`, or `from_tag` must be present for each rule. | | `idp` | String | **[Conditional]** An [available field](#available-fields) name to return as the value when the rule is selected. One of `literal`, `idp`, or `from_tag` must be present for each rule. | | `from_tag` | String | **[Conditional]** A [tag](/config/dsg_scp/diameter/tags.html) name to return the value of when the rule is selected. One of `literal`, `idp`, or `from_tag` must be present for each rule. | | `tag` | String | **[Conditional]** Selector for a [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`).
(Default: true) | | `at_terminate` | Boolean | Whether this rule applies at the final OCS interrogation, i.e. the Diameter `CC-Request-Type` is `3` (`TERMINATE_REQUEST`).
(Default: false) | | (other available fields) | (various) | Any number of [available fields](#available-fields). |

Available Fields

The following fields are available for IDP rule selectors and for value extraction when using the idp source type:

| Attribute | Type | Description | | :-------: | :--: | :---------- | | `eventTypeBCSM` | Integer | Selector for the `InitialDP` → `eventTypeBCSM` decoded value. | | `serviceKey` | Integer | Selector for the `InitialDP` → `serviceKey` decoded value. | | `iMSI_length_min` | String | The minimum length of the `InitialDP` → `iMSI` decoded digits. | | `iMSI_length_max` | String | The maximum length of the `InitialDP` → `iMSI` decoded digits. | | `iMSI_digits` | String | Selector for the `InitialDP` → `iMSI` decoded digits. | | `iMSI_prefix` | String | Selector for the `InitialDP` → `iMSI` decoded digits prefix. | | `callingPartyNumber_length_min` | String | The minimum length of the `InitialDP` → `callingPartyNumber` decoded digits. | | `callingPartyNumber_length_max` | String | The maximum length of the `InitialDP` → `callingPartyNumber` decoded digits. | | `callingPartyNumber_digits` | String | Selector for the `InitialDP` → `callingPartyNumber` decoded digits. | | `callingPartyNumber_length_min_n` | String | The minimum length of the [normalised](/config/dsg_scp/normalisation_denormalisation.html) `InitialDP` → `callingPartyNumber` decoded digits. | | `callingPartyNumber_length_max_n` | String | The maximum length of the [normalised](/config/dsg_scp/normalisation_denormalisation.html) `InitialDP` → `callingPartyNumber` decoded digits. | | `callingPartyNumber_digits_n` | String | Selector for the [normalised](/config/dsg_scp/normalisation_denormalisation.html) `InitialDP` → `callingPartyNumber` decoded digits. | | `callingPartyNumber_prefix` | String | Selector for the `InitialDP` → `callingPartyNumber` decoded digits prefix. | | `callingPartyNumber_prefix_n` | String | Selector for the [normalised](/config/dsg_scp/normalisation_denormalisation.html) `InitialDP` → `callingPartyNumber` decoded digits prefix. | | `callingPartyNumber_noa` | Integer | Selector for the `InitialDP` → `callingPartyNumber` → `Nature of address indicator` decoded value. | | `callingPartyNumber_npi` | Integer | Selector for the `InitialDP` → `callingPartyNumber` → `Numbering plan indicator` decoded value. | | `callingPartyNumber_pri` | Integer | Selector for the `InitialDP` → `callingPartyNumber` → `Address presentation restricted indicator` decoded value. | | `callingPartyNumber_si` | Integer | Selector for the `InitialDP` → `callingPartyNumber` → `Screening indicator` decoded value. | | `callingPartyNumber_ni` | Integer | Selector for the `InitialDP` → `callingPartyNumber` → `Number incomplete indicator` decoded value. | | `callingPartysCategory_hex` | String | Selector for the `InitialDP` → `callingPartysCategory` received value. | | `calledPartyNumber_length_min` | String | The minimum length of the `InitialDP` → `calledPartyNumber` decoded digits. | | `calledPartyNumber_length_max` | String | The maximum length of the `InitialDP` → `calledPartyNumber` decoded digits. | | `calledPartyNumber_digits` | String | Selector for the `InitialDP` → `calledPartyNumber` decoded digits. | | `calledPartyNumber_length_min_n` | String | The minimum length of the [normalised](/config/dsg_scp/normalisation_denormalisation.html) `InitialDP` → `calledPartyNumber` decoded digits. | | `calledPartyNumber_length_max_n` | String | The maximum length of the [normalised](/config/dsg_scp/normalisation_denormalisation.html) `InitialDP` → `calledPartyNumber` decoded digits. | | `calledPartyNumber_digits_n` | String | Selector for the [normalised](/config/dsg_scp/normalisation_denormalisation.html) `InitialDP` → `calledPartyNumber` decoded digits. | | `calledPartyNumber_prefix` | String | Selector for the `InitialDP` → `calledPartyNumber` decoded digits prefix. | | `calledPartyNumber_prefix_n` | String | Selector for the [normalised](/config/dsg_scp/normalisation_denormalisation.html) `InitialDP` → `calledPartyNumber` decoded digits prefix. | | `calledPartyNumber_noa` | Integer | Selector for the `InitialDP` → `calledPartyNumber` → `Nature of address indicator` decoded value. | | `calledPartyNumber_npi` | Integer | Selector for the `InitialDP` → `calledPartyNumber` → `Numbering plan indicator` decoded value. | | `calledPartyNumber_pri` | Integer | Selector for the `InitialDP` → `calledPartyNumber` → `Address presentation restricted indicator` decoded value. | | `calledPartyNumber_si` | Integer | Selector for the `InitialDP` → `calledPartyNumber` → `Screening indicator` decoded value. | | `calledPartyNumber_inn` | Integer | Selector for the `InitialDP` → `calledPartyNumber` → `Internal network number indicator` decoded value. | | `calledPartyBCDNumber_length_min` | String | The minimum length of the `InitialDP` → `calledPartyBCDNumber` decoded digits. | | `calledPartyBCDNumber_length_max` | String | The maximum length of the `InitialDP` → `calledPartyBCDNumber` decoded digits. | | `calledPartyBCDNumber_digits` | String | Selector for the `InitialDP` → `calledPartyBCDNumber` decoded digits. | | `calledPartyBCDNumber_length_min_n` | String | The minimum length of the [normalised](/config/dsg_scp/normalisation_denormalisation.html) `InitialDP` → `calledPartyBCDNumber` decoded digits. | | `calledPartyBCDNumber_length_max_n` | String | The maximum length of the [normalised](/config/dsg_scp/normalisation_denormalisation.html) `InitialDP` → `calledPartyBCDNumber` decoded digits. | | `calledPartyBCDNumber_digits_n` | String | Selector for the [normalised](/config/dsg_scp/normalisation_denormalisation.html) `InitialDP` → `calledPartyBCDNumber` decoded digits. | | `calledPartyBCDNumber_prefix` | String | Selector for the `InitialDP` → `calledPartyBCDNumber` decoded digits prefix. | | `calledPartyBCDNumber_prefix_n` | String | Selector for the [normalised](/config/dsg_scp/normalisation_denormalisation.html) `InitialDP` → `calledPartyBCDNumber` decoded digits prefix. | | `calledPartyBCDNumber_noa` | Integer | Selector for the `InitialDP` → `calledPartyBCDNumber` → `Nature of address indicator` decoded value. | | `calledPartyBCDNumber_npi` | Integer | Selector for the `InitialDP` → `calledPartyBCDNumber` → `Numbering plan indicator` decoded value. | | `redirectionInformation_ind` | Integer | Selector for the `InitialDP` → `redirectionInformation` → `Redirecting indicator` decoded value. | | `redirectionInformation_orig` | Integer | Selector for the `InitialDP` → `redirectionInformation` → `Original redirecting reason` decoded value. | | `redirectionInformation_num` | Integer | Selector for the `InitialDP` → `redirectionInformation` → `Redirection counter` decoded value. | | `redirectionInformation_nat` | Integer | Selector for the `InitialDP` → `redirectionInformation` → `National indicator` decoded value. | | `redirectionInformation_reason` | Integer | Selector for the `InitialDP` → `redirectionInformation` → `Redirecting reason` decoded value. | | `redirectingPartyID_length_min` | String | The minimum length of the `InitialDP` → `redirectingPartyID` decoded digits. | | `redirectingPartyID_length_max` | String | The maximum length of the `InitialDP` → `redirectingPartyID` decoded digits. | | `redirectingPartyID_digits` | String | Selector for the `InitialDP` → `redirectingPartyID` decoded digits. | | `redirectingPartyID_length_min_n` | String | The minimum length of the [normalised](/config/dsg_scp/normalisation_denormalisation.html) `InitialDP` → `redirectingPartyID` decoded digits. | | `redirectingPartyID_length_max_n` | String | The maximum length of the [normalised](/config/dsg_scp/normalisation_denormalisation.html) `InitialDP` → `redirectingPartyID` decoded digits. | | `redirectingPartyID_digits_n` | String | Selector for the [normalised](/config/dsg_scp/normalisation_denormalisation.html) `InitialDP` → `redirectingPartyID` decoded digits. | | `redirectingPartyID_prefix` | String | Selector for the `InitialDP` → `redirectingPartyID` decoded digits prefix. | | `redirectingPartyID_prefix_n` | String | Selector for the [normalised](/config/dsg_scp/normalisation_denormalisation.html) `InitialDP` → `callingPartyNumber`. `InitialDP` → `redirectingPartyID` decoded digits prefix. | | `redirectingPartyID_noa` | String | Selector for the `InitialDP` → `redirectingPartyID` → `Nature of address indicator` decoded value. | | `redirectingPartyID_npi` | String | Selector for the `InitialDP` → `redirectingPartyID` → `Numbering plan indicator` decoded value. | | `redirectingPartyID_pri` | String | Selector for the `InitialDP` → `redirectingPartyID` → `Address presentation restricted indicator` decoded value. | | `originalCalledPartyID_length_min` | String | The minimum length of the `InitialDP` → `originalCalledPartyID` decoded digits. | | `originalCalledPartyID_length_max` | String | The maximum length of the `InitialDP` → `originalCalledPartyID` decoded digits. | | `originalCalledPartyID_digits` | String | Selector for the `InitialDP` → `originalCalledPartyID` decoded digits. | | `originalCalledPartyID_prefix` | String | Selector for the `InitialDP` → `originalCalledPartyID` decoded digits prefix. | | `originalCalledPartyID_noa` | Integer | Selector for the `InitialDP` → `originalCalledPartyID` → `Nature of address indicator` decoded value. | | `originalCalledPartyID_npi` | Integer | Selector for the `InitialDP` → `originalCalledPartyID` → `PartyIDing plan indicator` decoded value. | | `originalCalledPartyID_pri` | Integer | Selector for the `InitialDP` → `originalCalledPartyID` → `Address presentation restricted indicator` decoded value. | | `additionalCallingPartyNumber_length_min` | String | The minimum length of the `InitialDP` → `additionalCallingPartyNumber` decoded digits. | | `additionalCallingPartyNumber_length_max` | String | The maximum length of the `InitialDP` → `additionalCallingPartyNumber` decoded digits. | | `additionalCallingPartyNumber_digits` | String | Selector for the `InitialDP` → `additionalCallingPartyNumber` decoded digits. | | `additionalCallingPartyNumber_prefix` | String | Selector for the `InitialDP` → `additionalCallingPartyNumber` decoded digits prefix. | | `additionalCallingPartyNumber_noa` | Integer | Selector for the `InitialDP` → `additionalCallingPartyNumber` → `Nature of address indicator` decoded value. | | `additionalCallingPartyNumber_npi` | Integer | Selector for the `InitialDP` → `additionalCallingPartyNumber` → `Numbering plan indicator` decoded value. | | `additionalCallingPartyNumber_nqi` | Integer | Selector for the `InitialDP` → `additionalCallingPartyNumber` → `Number qualifier indicator` decoded value. | | `additionalCallingPartyNumber_pri` | Integer | Selector for the `InitialDP` → `additionalCallingPartyNumber` → `Address presentation restricted indicator` decoded value. | | `additionalCallingPartyNumber_si` | Integer | Selector for the `InitialDP` → `additionalCallingPartyNumber` → `Screening indicator` decoded value. | | `additionalCallingPartyNumber_ni` | Integer | Selector for the `InitialDP` → `additionalCallingPartyNumber` → `Number incomplete indicator` decoded value. | | `location` | String | Selector for derived location classification for the call. | | `locationNumber_length_min` | String | The minimum length of the `InitialDP` → `locationNumber` decoded digits. | | `locationNumber_length_max` | String | The maximum length of the `InitialDP` → `locationNumber` decoded digits. | | `locationNumber_digits` | String | Selector for the `InitialDP` → `locationNumber` decoded digits. | | `locationNumber_prefix` | String | Selector for the `InitialDP` → `locationNumber` decoded digits prefix. | | `locationNumber_noa` | Integer | Selector for the `InitialDP` → `locationNumber` → `Nature of address indicator` decoded value. | | `locationNumber_npi` | Integer | Selector for the `InitialDP` → `locationNumber` → `Numbering plan indicator` decoded value. | | `locationNumber_pri` | Integer | Selector for the `InitialDP` → `locationNumber` → `Address presentation restricted indicator` decoded value. | | `locationNumber_si` | Integer | Selector for the `InitialDP` → `locationNumber` → `Screening indicator` decoded value. | | `locationNumber_inn` | Integer | Selector for the `InitialDP` → `locationNumber` → `Internal network number indicator` decoded value. | | `mscAddress_length_min` | String | The minimum length of the `InitialDP` → `mscAddress` decoded digits. | | `mscAddress_length_max` | String | The maximum length of the `InitialDP` → `mscAddress` decoded digits. | | `mscAddress_digits` | String | Selector for the `InitialDP` → `mscAddress` decoded digits. | | `mscAddress_prefix` | String | Selector for the `InitialDP` → `mscAddress` decoded digits prefix. | | `mscAddress_noa` | Integer | Selector for the `InitialDP` → `mscAddress` → `Nature of address indicator` decoded value. | | `mscAddress_npi` | Integer | Selector for the `InitialDP` → `mscAddress` → `Numbering plan indicator` decoded value. | | `vlrNumber_length_min` | String | The minimum length of the `InitialDP` → `locationInformation` → `vlrNumber` decoded digits. | | `vlrNumber_length_max` | String | The maximum length of the `InitialDP` → `locationInformation` → `vlrNumber` decoded digits. | | `vlrNumber_digits` | String | Selector for the `InitialDP` → `locationInformation` → `vlrNumber` decoded digits. | | `vlrNumber_prefix` | String | Selector for the `InitialDP` → `locationInformation` → `vlrNumber` decoded digits prefix. | | `vlrNumber_noa` | Integer | Selector for the `InitialDP` → `locationInformation` → `vlrNumber` → `Nature of address indicator` decoded value. | | `vlrNumber_npi` | Integer | Selector for the `InitialDP` → `locationInformation` → `vlrNumber` → `Numbering plan indicator` decoded value. | | `ageOfLocationInformation` | Integer | Selector for the `InitialDP` → `locationInformation` → `ageOfLocationInformation` decoded value. | | `cellIdOrLAI_mcc` | String | Selector for the `InitialDP` → `locationInformation` → `cellGlobalIdOrServiceAreaIdOrLAI` → `cellGlobalIdOrServiceAreaIdFixedLength` → `Mobile country code` decoded value. | | `cellIdOrLAI_mnc` | String | Selector for the `InitialDP` → `locationInformation` → `cellGlobalIdOrServiceAreaIdOrLAI` → `cellGlobalIdOrServiceAreaIdFixedLength` → `Mobile network code` decoded value. | | `cellIdOrLAI_lac_hex` | String | Selector for the `InitialDP` → `locationInformation` → `cellGlobalIdOrServiceAreaIdOrLAI` → `cellGlobalIdOrServiceAreaIdFixedLength` → `Location area code` decoded value. | | `cellIdOrLAI_ci_hex` | String | Selector for the `InitialDP` → `locationInformation` → `cellGlobalIdOrServiceAreaIdOrLAI` → `cellGlobalIdOrServiceAreaIdFixedLength` → `Cell ID` decoded value. | | `ext-BearerService` | String | Selector for the `InitialDP` → `ext-basicServiceCode` → `bearerService` decoded value, in hex. | | `ext-Teleservice` | String | Selector for the `InitialDP` → `ext-basicServiceCode` → `teleService` decoded value, in hex. | | `bearerCap_hex` | String | Selector for the `InitialDP` → `bearerCapability` decoded value. | | `bearerCap_itc` | Integer | Selector for the `InitialDP` → `bearerCapability` → `Information transfer capability` value. | | `cf_pending` | Integer | Selector for the `InitialDP` → `gsm-ForwardingPending`/`callForwardingSS-Pending` flag value. | | `highLayerCompatibility_hex` | String | Selector for the `InitialDP` → `highLayerCompatibility` decoded value. | | `callReferenceNumber` | String | Selector for the `InitialDP` → `callReferenceNumber` decoded value. | | `timeAndTimezone_digits` | String | Selector for the `InitialDP` → `timeAndTimezone` decoded value. | | `timeAndTimezone_epoch` | Integer | Selector for the `InitialDP` → `timeAndTimezone` decoded value as a Unix epoch value. | | `timeAndTimezone_offset` | Integer | Selector for the `InitialDP` → `timeAndTimezone` decoded value's timezone offset value. | | `ipSSPCapabilities` | Integer | Selector for the `InitialDP` → `ipSSPCapabilities` decoded value. | | `serviceInteractionIndicators_hex` | String | Selector for the `InitialDP` → `serviceInteractionIndicators_hex` decoded value. | | `forwardCallIndicators_hex` | String | Selector for the `InitialDP` → `forwardCallIndicators` decoded value. |