Core Configuration

Configuration

This LogicApp instance may specify the following globals for use with the N2CUG SVC library:

Protocol Selection

The runtime SVC library requires a single protocol handler to be included within the include path of the N2SVCD LogicApp, e.g.:

        <application name="N2CUG-Logic" module="LogicApp">
            ...
            <config>
                ...
                <services>
                    <service module="LhoScpApp::LhoScpLuaService"
                             libs="../../n2scp/apps/lho_scp/lib"
                             script_dir="../../n2cug/lua/svc/common/n2/n2svcd"
                             lua_lib_path="../lua/lib/?.lua;../../n2cug/lua/lib/n2/protocol/scp/?.lua;../../n2cug/lua/lib/?.lua;../../n2scp/lua/lib/?.lua">

The CUG protocol library selected must match the LogicApp service used, in this case LhoScpLuaService. The base library for each protocol’s service must also be included as per the service’s documentation - in this case, the N2SVCD LhoScpLuaService.

CUG Configuration Selector Rules

The rules used to select the CUG action rules configuration and CUG lookup rules configuration to apply for a given call are standard N2SVCD rule engine selector rules within the CUG_SELECTORS LogicApp global. Each rule must contain two additional attributes that provide the configuration to load when this selector applies:

Simple CUG configuration selector rules using the CUG SCP SVC library might be:

<global name="CUG_SELECTORS" type="array">
    <rule service.terminating="1"
          actions="terminating_actions"
          lookup="terminating_lookup" />
    <rule actions="originating_actions"
          lookup="originating_lookup"/>
</global>

CUG Action Rule Configurations

Within the CUG_ACTION_RULES LogicApp global, individual CUG action rule configurations may be specified. Each of these configurations in turn specifies the values that are used when the rule(s) that trigger them apply for the any given CUG outcome.

The CUG action rule configuration global takes the following structure:

<global name="CUG_ACTION_RULES" type="array">
    ...
    <actions name="actions1"
                   apply_lists="0"
                   show_sc="1">
        <no_user_found type="array">
            <!-- rule(s) for when no user is found -->
        </no_user_found>
        <not_allowed_list type="array">
            <!-- rule(s) for when a number list disallows a call -->
        </not_allowed_list>
        <not_allowed_user type="array">
            <!-- rule(s) for when user configuration disallows a call -->
        </not_allowed_user>
        <match_found type="array">
            <!-- rule(s) for when a user and a match are found -->
        </match_found>
        <no_match_found type="array">
            <!-- rule(s) for when a user is found, but no match is found -->
        </no_match_found>
    </actions>
    ...
</global>

Each CUG action rule configuration allows the following parameters.

Parameter Location Type Description
name configuration attribute String The name of this CUG configuration, as referenced in CUG configuration selector rules or other CUG configuration include directives.
no_user_found configuration child Array The list of CUG action rule rule elements to use to select the action to take when no CUG user_number is found.
not_allowed_list configuration child Array The list of CUG action rule rule elements to use to select the action to take when the CUG user cannot make/receive calls to/from the CUG match due to blacklist or whitelists applying.
not_allowed_user configuration child Array The list of CUG action rule rule elements to use to select the action to take when the CUG user cannot make/receive calls to/from the CUG match (or lack of match) due to user restriction settings applying.
no_match_found configuration child Array The list of CUG action rule rule elements to use to select the action to take when a CUG user_number is found but a CUG match_number is not found (and the call is not disallowed by list or user configuration).
match_found configuration child Array The list of CUG action rule rule elements to use to select the action to take when a CUG user_number is found and a CUG match_number is also found (and the call is not disallowed by list or user configuration).
apply_lists configuration attribute Boolean Whether to apply the restrictions of number lists.
show_sc configuration attribute Boolean Whether to send the match_number for display to the other party as part of a terminating operation.

Each protocol handler specifies its own default values for these configuration fields. In the case of rule lists such as no_user_found, any user-defined rules will be processed before the default rules. For simple parameters such as show_sc, any user-defined value will override the protocol handler default.

CUG Action Rule Selection

Each CUG action rule configuration array list supports selecting the action to take when a CUG user is or isn’t found or when a call is disallowed. Each of these is supported as a list of rules that are applied in the order listed until a match is made.

Each rule can support the following attributes:

Attribute Type Description
action String [Required] The action to take when this rule is matched. The possible values are protocol-specific.
(other available fields) (various) Any number of protocol-specific or core rule engine selector rule available fields to be used for matching.

CUG Lookup Rule Configurations

Within the CUG_LOOKUP_RULES LogicApp global, individual CUG configurations may be specified. Each of these configurations in turn specifies the values that are used when the rule(s) that trigger them apply for CUG lookups.

The CUG lookup rule configuration global takes the following structure:

<global name="CUG_LOOKUP_RULES" type="array">
    ...
    <configuration name="lookup1"
                   allow_sc_user="1"
                   allow_match_sc="0">
        <user_number type="array">
            <!-- rule(s) for selecting a user number -->
        </user_number>
        <match_number type="array">
            <!-- rule(s) for selecting a match number -->
        </match_number>
    </configuration>
    ...
</global>

Each CUG lookup configuration allows the following parameters.

Parameter Location Type Description
name configuration attribute String The name of this CUG configuration, as referenced in CUG configuration selector rules or other CUG configuration include directives.
user_number configuration child Array The list of N2SVCD rule engine selector rules rule elements to use to populate the CUG user number.
match_number configuration child Array The list of N2SVCD rule engine selector rules rule elements to use to populate the CUG match number.
allow_sc_user configuration attribute Boolean Whether to allow the user_number to be populated via a short code search.
allow_match_sc configuration attribute Boolean Whether to allow the match_number to be matched against short codes.

Each protocol handler specifies its own default values for these configuration fields. In the case of rule lists such as user_number, any user-defined rules will be processed before the default rules. For simple parameters such as allow_sc_user, any user-defined value will override the protocol handler default.

CUG Action Rule Selection

Each CUG lookup rule configuration array list supports selecting the source to use for CUG lookups. Each of these is supported as a list of rules that are applied in the order listed until a match is made.

Each rule can support the following attributes:

Attribute Type Description
literal String [Conditional] A literal value to use. One of literal, source, or from_var must be specified.
source String [Conditional] The source field to read, usually from the input context (i.e. starts with input.). The possible values are protocol-specific. One of literal, source, or from_var must be specified.
from_var String [Conditional] The rule engine variable name to read from. One of literal, source, or from_var must be specified.
(other available fields) (various) Any number of protocol-specific or core rule engine selector rule available fields to be used for matching.