billmax documentation   BillMax Billing Solutions
  877.245.5629
  sales@billmax.com
 

Chapter 1. Overview

Provisioning by BillMax is done through a programs called BillMax Hooks. The basic concepts is that whenever data for a record of a designated table is modified or created through BillMax routines, a BillMax Hook is executed. The designated BillMax tables and the corresponding BillMax Hooks are:

BillMax Table BillMax Hook
account table /usr/local/billmax/local/account_hook
user table /usr/local/billmax/local/user_hook
service table /usr/local/billmax/local/service_hook
payhist table /usr/local/billmax/local/payhist_hook

Data for the BillMax Hooks is provided through UNIX environment variables. The variables provided to each hook depends on the BillMax Hook that is being executed.

If a new record is being added, the environment variable NEW is set to "1". In addition, most of the fields from the table are available in the environment. The variable names are NEW_columnname. For example, if a new Account is added with account.cfname set to "John", then the environment variable NEW_cfname will be available and the value will be "John".

If an existing record is being modified, the environment variable NEW is set to "0". In addition, most of the fields from the table are available in the environment. The variable names are OLD_columnname for the values in the record before modification, and NEW_columnname for values in the record after modification. For example, if the data for a account.cfname is modified with the old value being "John" and the new value "Mark", then the environment variable OLD_cfname will be available and the value will be "John" and the environment variable NEW_cfname will be available and the value will be "Mark". Note that fields that are not modified, the OLD_* and NEW_* variables will be available and will have the same value.

In addition to data from the designated table, data from other tables may be present. The following environment variables containing the associated table data is available for listed BillMax Hook:

/usr/local/billmax/local/account_hook
/usr/local/billmax/local/user_hook
/usr/local/billmax/local/service_hook
/usr/local/billmax/local/payhist_hook

Before any environment variables are set and the BillMax Hook is executed, all existing environment variables are deleted from the environment with the exception of the following:

These variables may or may not exist in the environment at the time of the BillMax Hook execution. If they do exist, they will not be deleted and therefore will be available to the BillMax Hook.

In addition, there may be the need to pass variables to the BillMax Hook that have nothing to do with a database table. For these instances, environment variables of which the name begins with KEEP_ may be set. These environment variables are not deleted from the environment and are available to the BillMax Hook.

Having a BillMax Hook for a designated table is optional. If there is no need for a BillMax Hook for a designated table, simply make sure that the BillMax Hook does not exist in /usr/local/billmax/local or is not executable.

Although it is discouraged, a BillMax Hook may change the data in the designated table. After a BillMax Hook is executed, the record is re-read into internal BillMax structures before processing continues.

Technical Aspects for a BillMax BillMax Hook

  1. Successful execution of a BillMax BillMax Hook should have a return code of "0"

  2. Unsuccessful execution of a BillMax BillMax Hook should have a non-zero return code. In addition, a descriptive error message should be printed to stderr or stdout.

  3. If a BillMax Hook returns a non-zero return code, then either the new record will not be created or the existing record will not be modified.

  4. A BillMax Hook is run as UNIX user RUNHOOK_USER as defined in /usr/local/billmax/local/billmax.conf.

  5. A BillMax Hook is run as UNIX group RUNHOOK_GROUP as defined in /usr/local/billmax/local/billmax.conf.

  6. A BillMax Hook must be executable by the RUNHOOK_USER or RUNHOOK_GROUP.

  7. Only one instance of a BillMax Hook is active at anytime. Multiple calls to a BillMax Hook triggered by the actions of a Customer Service Representative will be executed serially.

  8. A BillMax Hook is called anytime data is modified in a designated table. The data changes may or may not have any Provisioning implications. The uses of a BillMax Hook are not limited to Provisioning.

  9. A BillMax Hook may be called multiple times when executing a single action.


Document Revision A for BillMax 2.2.0   -   Copyright © 1997-2006 The iSpark Group, Inc.

All rights reserved. No part of this documentation may be reproduced or transmitted in any fashion without written permission by The iSpark Group, Inc. This documentation is for the sole use of licensees of the BillMax billing software created by The iSpark Group, Inc. Making the documentation available to a non-licensee of BillMax without written permission of The iSpark Group, Inc. is a violation of the use of this documentation.

While precautions have been taken in the preparation of this documentation, The iSpark Group, Inc. assumes neither liability nor responsibility for errors or omissions, or for damages resulting from the use of the information contained herein.

All terms mentioned that are known to be trademarks have been appropriately capitalized. Use of the a trademark does not affect the validity of any trademark or service mark.

Links to third-party Web sites are provided for convenience. The iSpark Group, Inc. is not responsible for any content contained in the third-party Web sites.

Comments about this documentation may be sent to doc@billmax.com