Author: Ariel Pereira


See the COPYING for license information.

Description
Dump information from a Phone Box which prints information via serial port.
The data is captured in a postgresql database, what let us make several kind of queryies.
Supports Panasonic and Goldstar PBXs.

***
The readserial script is based on a program written by Paul Haas, the
original program can be reached at http://hamjudo.com/rcx/talkrcx.txt

***


Forums you can visit this site.


Download latest package from here.


Instalation Instructions
REQUIRES:
        perl, perl-pg
        postgresql
        apache
        php


1) Modify the file /usr/local/etc/pblogan.rc to meet your needs.

2) copy the usr/local/bin/readserial script to a directory in your system. You should modify the port definition to meet your hardware configuration

3) This script will create a plain text log file in /var/log/central/, this directory MUST exist.

4) I've put a line in my inittab to respawn this script, avoiding a big downtime

        rs:35:respawn:/path/to/the/file/readserial

For testing purposes, just run readserial from the command line, and make a tail -f centralita.log to watch what's going on.
Make some calls to check it out.

5) At this point, you should find a file called "centralita.log" in the /var/log/central directory.

*** !!! IF SO ... you can go on. !!! ***

6) Create a database called llamadas

        createdb llamadas

There is a llamadas.dump in usr/local/bin, use it to create the database which will hold the data.

        psql -d llamadas -f llamadas.dump

*** THE CONTAINED SAMPLE DATA IN THE DATABASE IS RELATIVE TO URUGUAY ***
The table costo, defines how much a pulse costs.
The table tarifa, defines how many pulses will be computed depending on the time of the day.
The table internos, identifies the phone sets connected to the Phone Box.



7) Copy phonedb script wherever you want, and modify the parameters at the begining of the file to meet your needs. You must modify the host variable, and shouldn't modify anything else.

NOTE: My case, is based on two hosts, one connected to the PBX, and one that has the database running. The /var/log/central y exported via nfs to the database host.

8) I've also put the phondb script in the inittab in the same way as readserial.

        pb:35:respawn:/path/to/the/file/phonedb

This will read from /var/log/central the file centralita.log and feed the database.

9) Verify if the database is updated the way it should.

10) Copy the home/httpd/html/phonedb/* to the directory where you want these scripts to be found by apache.

11) Edit the file include.inc, and modify de host variable to meet the host where the db is installed.

12) Open a browser and point it to the directory you copied the files.


Wish you luck!!


SourceForge Logo