Enable Credit Control

  1. Initialize the database for the credit_check application. (Skip this step if already done during OSS installation)

    SQL> @db_init_prepaid.sql
    
  2. Enable the CreditUpdate trigger.

    SQL> @ALTER TRIGGER CreditUpdate enable;
    
  3. Configure the Credit Controls section of NexOSS.etc with your database credentials. ($NexOSS_HOME/etc/NexOSS.etc)

    ## credit_check
    ## The credit_check application must be configured to connect to the
    ## billing database in order to check the credit status of each
    ## customer. If the NexOSS cdr_rate application is being used, the
    ## parameters defined in Section 1.1 of this file should be re-entered
    ## here to enable the credit_check application to connect to the NexOSS
    ## database.
    ##
    CreditCheck.ExternalBillingJDBCDriver=oracle.jdbc.driver.OracleDriver
    CreditCheck.ExternalBillingDBConnectURL=jdbc:oracle:thin:@localhost:1521:DBname
    CreditCheck.ExternalBillingDBUser=username
    CreditCheck.ExternalBillingDBPassword=password
    
  4. Provision data for a customer using SQL commands.

    SQL> set pagesize 10000 (optional)
    SQL> set linesize 175 (optional)
    SQL> define _editor=vi (optional)
    SQL>
    SQL> desc CreditStatus (list the correct field names)
    Name Null? Type
    
    CUSTOMERNAME NOT NULL VARCHAR2(25)
    CURRENCY NOT NULL VARCHAR2(4)
    RUNNINGTOTAL NOT NULL NUMBER(20,7)
    ENABLETHRESHOLD NOT NULL NUMBER(20,7)
    DISABLETHRESHOLD NOT NULL NUMBER(20,7)
    INSERTED NOT NULL DATE
    UPDATED NOT NULL DATE
    
    SQL> insert into creditStatus (SQL command required to insert entries into the CreditStatus table)
    2 (CUSTOMERNAME,CURRENCY,RUNNINGTOTAL,ENABLETHRESHOLD,DISABLETHRESHOLD,INSERTED,UPDATED)
    3 values
    4 ('PSTN User','USD',1000,400,200,sysdate,sysdate) (customer name must match names in NexOSS GUI)
    5 /
    1 row created.
    SQL> commit;
    SQL> select * from CreditStatus; (view the CreditStatus table)
    
    CUSTOMERNAME CURR RUNNINGTOTAL ENABLETHRESHOLD DISABLETHRESHOLD
    
    INSERTED UPDATED
    
    PSTN User USD 1000 400 200
    22-JAN-08 22-JAN-08
    
  5. Set credit_check to run automatically with the cycle script run_NexOSS.sh by uncommenting the lines below in run_rate_cdrs.sh.

    $ cd $NexOSS_HOME/unix/run
    $ vi run_rate_cdrs.sh
    ~
    # ./start_credit_check.sh $*
    # ./start_config_update.sh $*
    

Note: Credit a customer for receipt of prepaid funds using SQL commands.

SQL> Update CreditStatus
2 set RunningTotal = RunningTotal + 500
3 where CustomerName = 'PSTN User'
4 and Currency = 'USD';
5 /
SQL> commit;