Service Configuration
Overview
The N2ACD service is built on the N2SVCD framework. Technically it could be considered to consist of a specialised Lua service running within a logic application.
The INAP and SIP protocol support are provided by the N-Squared N2SCP platform and SIP components. ACD has separate service classes for each protocol that can be configured independently or together.
<application name="ACD Logic" module="LogicApp">
<include>
<lib>../apps/logic/lib</lib>
</include>
<parameters>
<parameter name="trace_level" value="0"/>
<parameter name="edr_enabled" value="1"/>
<parameter name="retention_count" value="100"/>
<parameter name="default_edr_stream_key" value="acd"/>
<parameter name="default_db_app_name" value="ACD DB"/>
<parameter name="db_app_name_acd" value="ACD DB"/>
<parameter name="db_app_name_acd_local" value="ACD Local DB"/>
</parameters>
<config>
<services>
<service
module="AcdScpApp::AcdScpLuaService"
libs="../../n2acd/apps/acd_scp/lib,../../n2acd/lib,../../n2scp/apps/lho_scp/lib"
db_app_name="ACD DB"
lua_lib_path="../lua/lib/?.lc;../lua/lib/?.lua;../lua/lib/3rdparty/?.lc;../lua/lib/3rdparty/?.lua;../../n2scp/lua/lib/?.lc;../../n2scp/lua/lib/?.lua;../../n2acd/lua/lib/common/?.lc;../../n2acd/lua/lib/common/?.lua;../../n2acd/lua/lib/scp/?.lc;../../n2acd/lua/lib/scp/?.lua"
best_prefix_match="yes"
>
<triggers>
<trigger called_prefix="0800"/>
</triggers>
</service>
<service
module="AcdSipApp::AcdSipLuaService"
libs="../../n2acd/apps/acd_sip/lib,../../n2acd/lib,../../n2sip/apps/lho_sip/lib"
db_app_name="ACD DB"
lua_lib_path="../lua/lib/?.lc;../lua/lib/?.lua;../lua/lib/3rdparty/?.lc;../lua/lib/3rdparty/?.lua;../../n2sip/lua/lib/?.lc;../../n2sip/lua/lib/?.lua;../../n2acd/lua/lib/common/?.lc;../../n2acd/lua/lib/common/?.lua;../../n2acd/lua/lib/sip/?.lc;../../n2acd/lua/lib/sip/?.lua"
best_prefix_match="yes"
>
<triggers>
<trigger called_prefix="0800"/>
</triggers>
</service>
</services>
<agents>
<agent module="DBApp::DBLuaAgent" libs="../apps/db/lib"/>
</agents>
</config>
</application>
Special Script Keys
Typical N2ACD triggers are configured with one of the following script keys:
- No script key
number_portabilitypreprocess
The absence of a script key is an indication that two-phase loading should be performed. In the first loading phase, the N2ACD Lua service performs a database query to determine which flow is scheduled for the service that matches the pending termination number. The pending termination number is initially the called number. In the second phase, if a matching service with a scheduled flow has been identified, the N2ACD Lua service collects the flow dependencies and executes the N2ACD service loader script to bootstrap the service and prepare to execute the scheduled flow. The pending termination number may not match a service, or match a service that does not have a scheduled flow. In those cases the N2ACD Lua service executes the N2ACD service loader script to enable error handling to be peformed (e.g. generate an EDR, play a “no such service” announcement, end the call with a specific cause).
The number_portability script key is used to load and execute the N2ACD number portability script. The purpose of the number portability script is to determine if the service associated with the
pending termination number is ported out. This determination can be implemented using number checks, database queries, or other logic. If the script determines that the service has been ported out,
it generally redirects to the service owner; otherwise chaining is used to invoke the service using two-phase
loading (as described for when there is no script key).
The preprocess script key is used to load and execute the N2ACD service loader script without attempting to identify or load the service associated with the pending termination number. This can be
useful if - for example - it is known in advance that the pending termination number or any other script input arguments need to be modified before loading is attempted. The N2ACD service loader
script can perform a wide range of processing including number manipulation, database queries, call handling/rejection, external system requests, or
chaining to begin attempting to load the appropriate service.
Best Prefix Match
When required to perform two-phase loading, the N2ACD Lua service identifies the target service by matching the pending termination number with a service number in the N2ACD database. The match can be either a full match or a best prefix match.
When best_prefix_match is false, the target service is identified by matching the full pending termination number with a full service number.
When best_prefix_match is true, the target service is identified by matching the pending termination number’s prefix with a full service number. The longest matching service number will be selected.
Defaults to false.