				###############
				#             #
				#  ALCA-LINE  #
				#             #
				###############

   Alca-Line, a set of tools for people administrating an Alcatel 4400 Pabx.





Licence
=======
This software is currently GPL but this status may change in the future

System requirements
===================
- CPU : depends on how fast you want the system to be ;-) More serioulsy a
  500 MHz pentium is enough
- Memory : at least 256 Mo free memory, but the more the database, the more 
  you'll need memory to handle datasets in memory rather than on disk
- Disk : my test database (see at the end of this documents) uses around 350 Mo
  on the disk, but the database expansion process (ie when the tax ticket
  format changes) may use 5 to 10 times this amount of space, probably because
  of database's rollbacks
  Taxdata files storage is around 70 Mo for 600.000 tickets.
- Windows + Cygwin (around  Mo for a typical install, including Cygwin's
  packages that takes around 500 Mo on disk) or Linux system
- Database : Postgresql 8.2.1 minimum

Installation
============
* On Windows:

- Download and install Cygwin including postgres developpement package, 
  development tools and network tools
- Download and install Postgresql 8.2  for Windows
- Download and install Apache 2.2 for Windows

* On Linux :

- well, everything shouldbe there ;-), just check you have development tools
  (C compiler, make..) and that postgresql, including dev library, and
  apache are installed

* On both systems :

- increase the ApacheTimeout (add for example "TimeOut 3000" directive in the
  config file (httpd.conf) as the default timeout (300 seconds) may be 
  insuficient for very very large reports (or with reports that still need
  serious optimization)
- Into src directory :
   o update Makefile to reflect installation target directory
   o update "Definitions" to reflect your system properties
   o update "RecupData' according to your Alcatel 4400 configuration
   o update the prefixes.txt file (geographic zone regexp file). The easiest way
     to do this is to import a first set of data, to find wich ticket are said
     to be in an UNKNOWN zone (geozone table), to amend the prefixes to 
     recognize these tickets and to rebuild the whole database
   o run "make" to build binaries
   o run "make install" install binaries and script
- Install RecupData as a cron jobs to download taxfile once a day
- Create database using CreateDatabase
- Install ImportData as a cron job to fill database with taxfiles. Note that
  once the tax files are imported you may delete them or move then to another
  directory. They may be redownloaded from the Pabx as there are not deleted on
  it, but the import process won't reimport them, exect if corresponding data
  are all deleted from the database.
- test that http://127.0.0.1/testenv.cgi is operational
- use reports to analyze taxdata when needed


Usage
=====


Note
====
* Ticket format

When a large database is already imported and a ticketformat change occurs
(column type change or column size change) importation of first newly formated
ticket may take a very long time and may fail if there's not enough resources
on the database server.

This happens only once after some system upgrade implying taxfile format
change. Running a "vacuum" on the database before importing new tickets may
be a good idea (more generally it is recommended to run a "vacuum" on a regular
basis).

Hint: when reimporting a long period datafiles, import the last taxdat file
first to create the database in its definitive format, then import all taxdat
files that will naturally fit into the already extended table.

* Date and time

Many reports rely on date and time data which a generated by the Pabx. Thus,
controling that date/time is accurate on the system is mandatory. Alca-Line 
will (soon) include a tool to automatically synchronize internal clock with a
PC (that can be synchronized with a NTP clock on the Internet or with a radio
controlled clock such a a GPS).

* Pabx change or reset

If Pabx is changed or reinstalled, tax file names will be reset, potentialy
causing a failure in the import system. In such a case you must :
- remove all files in the taxdata directory
- reset taxdatid colum in the taxdata table (update taxdata set taxdatid = NULL)


Tests and developpement
=======================

Testing and development are made on a Windows 2000 computer running Cygwin,
Postgresql 8.2.1 and Apache 2.2.3.
Test data are a 4+ year historic, containing 3 ticket versions (4.8, 4.9, and
5.1) in 23.000+ files with 600.000 call details.

Known bugs
==========

* Html pages are horible
* Some parts are written in shell script
* DST is not supported


Thanks
======
- Eric Stern, alpha tester and samples provider
- Mathieu Cousin, former collegue and talented archivist
