Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Configuring Scripts That Update Accounts (SRC CLI)

    You can set up scripts to update balances in the accounts from which the usage of a service is charged and update accounts by assigning values to variables for the account balances.

    Use the following statements to configure scripts that update accounts:

    shared vta group name processor db-engine account-update-script name{script script;}

    To configure scripts that update accounts:

    1. From configuration mode, access the statement used to configure scripts that update accounts. For example, to configure a script called DebtQuotaUsage in the SRC VTA group called vta1:
      [edit]user@host# edit shared vta group vta1 processor db-engine account-update-script DebtQuotaUsage
    2. Specify the script parameters.
      [edit shared vta group vta1 processor db-engine account-update-script DebtQuotaUsage]user@host# set script script

      Enter a JavaScript program that updates a subscriber’s account. The script can refer to the name of any attributes in the event being processed. An account can be updated by assigning values to the following parameters:

      • balance_<accountName>—Values written to this parameter are put in the balance field of the account.
      • status_<accountName>—Values written to this parameter are put in the status field of the account.
      • lastUpdateTime_<accountName>—Values written to this parameter are put in the last_update_time field of the account.

        For example:

        [edit shared vta group vta1 processor db-engine account-update-script DebtQuotaUsage]user@host# set script <balance_PeriodicQuota>=<balance_PeriodicQuota>-\ <currentUsage>;<lastUpdateTime_PeriodicQuota>=<currentTime>;

    Modified: 2012-06-25