LogicApp Configuration
LogicApp Configuration
The core of an N2IWF deployment is a configured N2SVCD LogicApp instance.
LogicApp Configuration for CAMEL Call Control
The base of an example N2IWF LogicApp configuration for call control via CAMEL might include:
<application name="N2IWF-Logic" module="LogicApp">
...
<config>
<services>
<service module="LhoScpApp::LhoScpLuaService"
libs="../../n2scp/apps/lho_scp/lib"
script_dir="../../n2iwf/lua/svc/"
lua_lib_path="../lua/lib/?.lua;../../n2iwf/lua/lib/?.lua;../../n2iwf/lua/svc/scp/?.lua;../../n2scp/lua/lib/?.lua;../../n2cug/lua/lib/?.lua">
<triggers>
<trigger script_key="iwf_svc"/>
</triggers>
...
</service>
</services>
...
</config>
</application>
The following points are relevant to LogicApp configuration for N2IWF:
- The
module
andlibs
parameters in theservice
must be as required for the appropriate protocol handler module in use for inbound messages. - The
script_dir
parameter in theservice
will always be../../n2iwf/lua/svc/
. - The
trigger
element must specify thescript_key
asiwf_svc
. - The
lua_lib_path
must be correctly specified.
Lua Library Paths
For the lua_lib_path
parameter in the LogicApp service
, the following guidelines apply:
- The following library paths are required:
- N2SVCD libraries:
../lua/lib/?.lua
- N2IWF core libraries:
../../n2iwf/lua/lib/?.lua
- N2SVCD libraries:
- A path to the N2IWF protocol handler for the input protocol in use is required. One of:
- N2IWF CAMEL/INAP calls (SCP):
../../n2iwf/lua/lib/n2/protocol/scp/?.lua
- N2IWF CAMEL SMS:
../../n2iwf/lua/lib/n2/protocol/capsms/?.lua
- N2IWF SIP calls:
../../n2iwf/lua/lib/n2/protocol/sip/?.lua
- N2IWF CAMEL/INAP calls (SCP):
- Paths to the appropriate API for the input protocol in use is required. One of:
- N2IWF CAMEL/INAP calls (SCP) or CAMEL SMS:
../../n2scp/lua/lib/?.lua
- N2IWF SIP calls:
../../n2sip/lua/lib/?.lua
- N2IWF CAMEL/INAP calls (SCP) or CAMEL SMS:
- If N2CUG external actions are being used, the following library paths are required:
- N2CUG core libraries:
../../n2cug/lua/lib/?.lua
- N2CUG core libraries:
- If custom Lua hooks are used, the path to the file is required.
Compiled Lua
Any Lua libraries, both supplied by N-Squared and custom, may be pre-compiled
by using the Lua compiler utility.
If this is done, ensure that the lua_lib_path
is updated to reflect the
appropriate file suffix (.lc
) as generated by the compiler.
LogicApp Configuration for Diameter -> Diameter IWF
The base of an example N2IWF LogicApp configuration for receiving inbound Diameter messages for proxy is as follows:
<application name="Diameter-Proxy" module="LogicApp">
...
<config>
<services>
<service module="DiameterApp::DiameterLuaService" libs="../apps/diameter/lib" script_dir="../../n2iwf/lua/svc/agent/">
<globals>
<global name="REQUIRE_HOOK_TO_PROXY">true</global>
<global name="HOOK_SCRIPT">local_hooks</global>
</globals>
</service>
</services>
...
</config>
</application>
The following points are relevant to LogicApp configuration for N2IWF when receiving and proxying inbound Diameter requests:
- The
module
andlibs
parameters in theservice
must refer to theDiameterLuaService
provided by N2SVCD. - The
script_dir
parameter in theservice
will always be../../n2iwf/lua/svc/agent/
.
Lua Library Paths
For the lua_lib_path
parameter in the LogicApp service
, the following guidelines apply:
- The following library paths are required:
- N2SVCD libraries:
../lua/lib/?.lua
- N2SVCD 3rd party libraries:
../lua/lib/3rdparty/?.lua
- N2IWF core libraries:
../../n2iwf/lua/lib/?.lua
- N2SVCD libraries:
- The path to the directory where the
HOOK_SCRIPT
file can be found. E.g. if the hook script is stored in/etc/n2svcd/lua
then add:/etc/n2svcd/lua/?.lua
A full example default_lua_lib_path
is:
<parameter name="default_lua_lib_path" value="../lua/lib/?.lua;../lua/lib/3rdparty/?.lua;../../n2iwf/lua/lib/?.lua;/etc/n2svcd/lua/?.lua/>
Compiled Lua
Any Lua libraries, both supplied by N-Squared and custom, may be pre-compiled
by using the Lua compiler utility.
If this is done, ensure that the lua_lib_path
is updated to reflect the
appropriate file suffix (.lc
) as generated by the compiler.