Configuration

Configuration

The N2C5 application does not have its own database. All configuration for the N2C5 is stored in the “n2c5-{suffix}.xml” configuration file which is part of the underlying Jarvis back-end data access.

In a simple development system, you may have only one configuration file.

/etc/jarvis/n2c5.xml

In a typical production installation, there will often be more than one N2C5 instance in operation. Each will have a separate configuration file, e.g.

/etc/jarvis/n2c5-model.xml
/etc/jarvis/n2c5-test.xml
/etc/jarvis/n2c5-dev.xml

Example Configuration

Here is an example N2C5 configuration file:

<?xml version="1.0" encoding="utf-8"?>
<jarvis>
  <app use_placeholders="yes" format="json" debug="no" dump="no" log_format="[%P/%A/%U/%D] %M">
    <tracker logins="no" requests="no" errors="no">
        <dbfile>/opt/jarvis/tracker/db/tracker.db</dbfile>
    </tracker>

    <default_libs>
      <lib path="/usr/share/n2c5-dev/jarvis/plugin"/>
      <lib path="/usr/share/n2c5-dev/jarvis/hook"/>
      <lib path="/usr/share/n2c5-dev/jarvis/login"/>
      <lib path="/usr/share/n2c5-dev/lib"/>
    </default_libs>

    <dataset_dir>/usr/share/n2c5-dev/jarvis/datasets</dataset_dir>

    <sessiondb store="driver:file;serializer:default;id:md5" expiry="+1M" cookie="N2C5_CGISESSID">
      <parameter name="Directory" value="/tmp"/>
    </sessiondb>

    <!-- This must be a non-SCREENS_USER account.  See comments in LoginSMF.pm code. -->
    <database name="smf" username="smf" password="s3cur3"
        connect="dbi:Oracle:host=10.42.2.151;port=1521;sid=SMF" />

    <!-- Custom Login Module for SMF. -->
    <login module="LoginSMF">
      <parameter name="login_groups" value="*"/> 
    </login>

    <!-- SELECT obj_name FROM iors WHERE obj_name LIKE '%smsTrigDaemon'; -->
    <bpl_ior_name>tcl-t-sms02-smsTrigDaemon</bpl_ior_name>

    <!-- Site-specific configuration of relevant profile fields. -->
    <profiles>
      <acct_type>
        <group id="credit" name="Credit Card Limits"
            collapsible="no" collapsed="no">
          <field tag="136" writers="*" name="Daily Limit $" 
            render="integer" type="long" minval="0" maxlen="4"/>
          <field tag="137" writers="*" name="Weekly Limit $" 
            render="integer" type="long" minval="0" maxlen="4"/>
          <field tag="138" writers="*" name="Monthly Limit $" 
            render="integer" type="long" minval="0" maxlen="4"/>
        </group>
      </acct_type>
      <acct_reference>
        <group id="default" name="Base Details" 
            collapsible="no" collapsed="no">
          <field tag="200" writers="*" name="First Name" 
            render="string" type="string"/>
          <field tag="201" writers="*" name="Last Name" 
            render="string" type="string"/>
          <field tag="37" writers="*"  name="Language" 
            render="language" type="long"/>
          <field tag="private_secret" writers="*" name="PIN" 
            render="password" type="string" maxlen="4" regex="^(|[0-9]{4}|\*\*\*\*)$"/>
          <field tag="204" name="First Recharge" 
            render="checkbox" type="byte"/>
        </group>
        <group id="credit" name="Credit Card Limits" 
            collapsible="no" collapsed="no">
          <field tag="136" writers="*" name="Daily Limit $" 
            render="integer" type="long" minval="0" maxlen="4"/>
          <field tag="137" writers="*" name="Weekly Limit $" 
            render="integer" type="long" minval="0" maxlen="4"/>
          <field tag="138" writers="*" name="Monthly Limit $" 
            render="integer" type="long" minval="0" maxlen="4"/>
        </group>
        <group id="announcement" name="Disable Pre-call Announcements" 
            collapsible="no" collapsed="no">
          <field tag="203" writers="*" name="Balance" 
            render="checkbox" type="byte"/>
          <field tag="240" writers="*" name="Time" 
            render="checkbox" type="byte"/>
        </group>
        <group id="speed" name="Speed Dials" 
            collapsible="yes" collapsed="yes">
          <field tag="231" writers="*" name="Speed Dial #1" 
            render="string" regex="^[0-9]*$" maxlen="20" type="string"/>
          <field tag="232" writers="*" name="Speed Dial #2" 
            render="string" regex="^[0-9]*$" maxlen="20" type="string"/>
          <field tag="233" writers="*" name="Speed Dial #3" 
            render="string" regex="^[0-9]*$" maxlen="20" type="string"/>
        </group>
        <group id="originating" name="Originating Filters" 
            collapsible="yes" collapsed="yes">
          <field tag="210" writers="*" name="Originating Whitelist Active" 
            render="checkbox" type="byte"/>
          <field tag="211" writers="*"  name="Originating Whitelist" 
            render="list" regex="^[0-9]*$" maxlen="20" type="tree"/>
          <field tag="212" writers="*"  name="Originating Whitelist Exceptions" 
            render="list" regex="^[0-9]*$" maxlen="20" type="tree"/>
          <field tag="213" writers="*" name="Originating Blacklist Active" 
            render="checkbox" type="byte"/>
          <field tag="214" writers="*"  name="Originating Blacklist" 
            render="list" regex="^[0-9]*$" maxlen="20" type="tree"/>
          <field tag="215" writers="*"  name="Originating Blacklist Exceptions" 
            render="list" regex="^[0-9]*$" maxlen="20" type="tree"/>
        </group>
        <group id="info2" collapsible="no" collapsed="no">
          <field tag="414" name="Account Sub-Type:" render="span" type="string"/>
        </group>
      </acct_reference>
    </profiles>

    <!-- Adjustment limits by SMF template.  Amount in "bigs" (i.e. dollars). -->
    <adjustment>
      <limit>
        <group name="ACS_BOSS" amount="200"/>
        <group name="CCS Customer Care" amount="10"/>
      </limit>
    </adjustment>

    <!-- Extra configuration for various unit types. -->
    <unit_type unit_name="cash">
      <!-- Note: Highlight entries need to be in ASCENDING total order.  Amount in "smalls".  -->
      <expenditure balance_name="Total Usage" label="Total Usage" combined="no"/>
      <expenditure balance_name="Total Usage" label="Total Value" combined="yes">
        <highlight total="10000000" class="grey"/>    <!-- $1000 -->
      </expenditure>
    </unit_type>

    <!-- Access is ** on the Page module, since it also serves our login page. -->
    <plugin dataset="generate-page" access="**" module="GeneratePage" add_headers="no">
      <parameter name="template_dir" value="/usr/share/n2c5-dev/template"/>
      <parameter name="dictionary" value="/usr/share/n2c5-dev/etc/dictionary.txt"/>
      <parameter name="definitions.edr_filter_functions" value="all,call,activity,credit_card"/>
    </plugin>

    <plugin dataset="subscriber-info" access="*" module="SubscriberInfo" 
      add_headers="yes" mime_type="application/json"/>
    <plugin dataset="subscriber-profile-update" access="*" module="SubscriberProfileUpdate" 
      add_headers="yes" mime_type="application/json"/>
    <plugin dataset="subscriber-wallet" access="*" module="SubscriberWallet" 
      add_headers="yes" mime_type="application/json"/>
    <plugin dataset="subscriber-wallet-update" access="*" module="SubscriberWalletUpdate" 
      add_headers="yes" mime_type="application/json"/>
    <plugin dataset="subscriber-wallet-recharge" access="*" module="SubscriberWalletRecharge" 
      add_headers="yes" mime_type="application/json"/>
    <plugin dataset="subscriber-bucket-expiry" access="*" module="SubscriberBucketExpiry" 
      add_headers="yes" mime_type="application/json"/>
    <plugin dataset="subscriber-edrs" access="*" module="SubscriberEdrs" 
      add_headers="yes" mime_type="application/json">
      <!-- List of modules in EdrProcess/<module>.pm to invoke the ::process () method -->
      <parameter name="process" value="Default,Vodafone"/>

      <!-- Do we trim trailing zeros off our littles?  If so, how far down to trim. -->
      <parameter name="trim_littles" value="2"/>

      <!-- How do we format costs?
          1. type [default]
              Separate values for each balance type (ie. General Cash, Promotional Cash).
              <balance type name> <value>[, <balance type name> <value>]
          2. unit
              Summed values for each balance type unit (ie. cash, SMSs, minutes).
              <value>[, <value>]
      -->
      <parameter name="cost_format" value="unit"/>
    </plugin>
    <plugin dataset="subscriber-cli-add" access="*" module="SubscriberCliAdd" 
      add_headers="yes" mime_type="application/json"/>
    <plugin dataset="subscriber-cli-delete" access="*" module="SubscriberCliDelete" 
      add_headers="yes" mime_type="application/json"/>
    <plugin dataset="voucher-replace" access="*" module="VoucherReplace" 
      add_headers="yes" mime_type="application/json"/>
    <plugin dataset="voucher-info" access="*" module="VoucherInfo" 
      add_headers="yes" mime_type="application/json"/>
    <plugin dataset="call-report" access="*" module="CallReport" 
      add_headers="yes" mime_type="application/json">
        <parameter name="img_dir" value="/usr/share/n2c5-dev/htdocs/img"/>
    </plugin>
    <plugin dataset="product-info" access="*" module="ProductInfo" 
      add_headers="yes" mime_type="application/json"/>
    <plugin dataset="product-profile-update" access="*" module="ProductProfileUpdate" 
      add_headers="yes" mime_type="application/json"/>
    <plugin dataset="rate-table-info" access="*" module="RateTableInfo" 
      add_headers="yes" mime_type="application/json"/>
  </app>
</jarvis>

Each configuration parameter is described a subsequent section of this chapter of the Technical Guide.