Diameter -> Diameter IWF Globals

Diameter -> Diameter IWF Globals

When configured as a Diameter -> Diameter IWF, several LogicApp global variables can be configured to control the IWF behaviour.

An example LogicApp configuration block for the IWF might be:

<application name="DiameterProxy" module="LogicApp" admin_alloc="1m" user_alloc="64m">
    <include>
        <lib>../apps/logic/lib</lib>
    </include>
    <parameters>
        <parameter name="edr_enabled" value="1"/>
        <parameter name="default_edr_app_name" value="EDR"/>
        <parameter name="default_edr_stream_key" value="diameterproxy"/>
        <parameter name="default_lua_lib_path" value="../lua/lib/?.lua;../lua/lib/3rdparty/?.lua;../../n2iwf/lua/lib/?.lua;/etc/n2svcd/lua/?.lua"/>
        <parameter name="default_diameter_app_name" value="DiameterOutbound"/>
    </parameters>
    <config>
        <services>
            <service module="DiameterApp::DiameterLuaService" libs="../apps/diameter/lib" script_dir="../../n2iwf/lua/svc/agent/">
                <globals>
                    <global name="ROUTE_RECORD_CHECK">n2-t-iwf01</global>
                    <global name="REQUIRE_HOOK_TO_PROXY">true</global>
                    <global name="HOOK_SCRIPT">event_sms_hooks</global>
                </globals>
            </service>
        </services>
        <agents>
            <agent module="DiameterApp::DiameterLuaAgent" libs="../apps/diameter/lib"/>
        </agents>
    </config>
</application>

Globals

ROUTE_RECORD_CHECK

If the ROUTE_RECORD_CHECK global is set, the Diameter IWF will check for a Route-Record AVP in incoming requests and if any Route-Record AVP has the same value as ROUTE_RECORD_CHECK, the request will be rejected with the Result-Code 3005 (DIAMETER_LOOP_DETECTED).

For technical reasons, the Diameter -> Diameter IWF cannot determine the value to check from the Lua logic without it being provided as a global variable.

The value of this variable should be set to the value of the Origin-Host as sent by the DiameterApp used for sending requests by this IWF app.

REQUIRE_HOOK_TO_PROXY

If set to true (the default) the IWF will reject (with a Result-Code value of 5003 - DIAMETER_AUTHORIZATION_REJECTED) any request that is not matched to a custom request hook. This allows the Diameter IWF to reject any inbound message that will not be processed by an IWF hook.

If set to false, if an inbound request does not get processed by a hook, the inbound request is send to the outbound DiameterApp without any further processing.

HOOK_SCRIPT

This global must be set to the name of a Lua script that includes zero or more hooks to be called for each inbound Diameter request. The hook script is require()ed by the Diameter IWF, and so must be found in the default_lua_lib_path of the LogicApp running the Diameter IWF.