Telrate CGI 
------------

Telrate.cgi is a web interface to isdnrate for displaying tables & graphics of
provider costs.

Installation
------------

- Automatic

 $ ./configure
 # make install
(Sorry n/y) 
 

- Manually

extract index.html,info.html,pics to /usr/local/httpd/htdocs/somedir
(default is telrate, that's easiest)

# cd /usr/local/httpd/htdocs
# tar -xzf telrate.tgz

make it readable for your webserver
 

edit telrate.cgi:
--------------
 country $CC='de' ...
 location of code file ( /usr/lib/isdn/code-$CC.dat )
     ( this file is actually ./tools/zone/CC/code )
 location of isdnrate (only if pipe's are used not sockets)
 location of mktemp (should be ok)
 
 location of index.html, info.html, pic, (default /telrate/ under htdocs)
 
 if your /tmp ist not writable by all users, turn of $use_sockets
 or change the location of the unix socket in both isdnrate.c and telrate.cgi.
 
 make a tmp dir below htdocs
 # mkdir /usr/local/httpd/htdocs/tmp
 # chmod 700 /usr/local/httpd/htdocs/tmp
 # chown wwwrun.nogrup tmp
  (or whatever uid.gid your webserver runs with)

in /etc/httpd/srm.conf  or httpd.conf you may enable mod_perl for
perl script invocation:

Apache config:
------------------

ScriptAlias /cgi-bin/ "/usr/local/httpd/cgi-bin/"
ScriptAlias /perl/ "/usr/local/httpd/cgi-bin/"
# enable mod_perl for /perl/
#

<Location /perl>
AddHandler  perl-script .pl
AddHandler  perl-script .cgi
PerlHandler Apache::Registry
PerlModule = CGI GD IO::Handle
Options +ExecCGI
</Location>

# enable mod_perl for /cgi-perl/ via PerlRun
#

<Location /cgi-bin>
AddHandler  perl-script .pl
PerlHandler Apache::PerlRun
PerlSendHeader On
Options +ExecCGI
</Location>

-----------------
End Apache config

  
 # cp telrate.cgi /usr/local/httpd/cgi-bin
 # chmod 755 /usr/local/httpd/cgi-bin/telrate.cgi
 # chmod 644 /etc/isdn/isdn.conf  
 

NB: telrate.cgi uses the following perl modules:
 CGI, GD, IO::Handle und Socket
 if you don't have these, point your browser to www.perl.com, 
 and look for CPAN mirrors near your location.
 
 
 index.html, info.html
 ---------------------
 
If your script-url ist not /perl/ change it to /cgi-bin in both files or
configure apache to use /perl for your /cgi-bin.
If you expanded to a different dir then /telrate/ you have to adjust 
IMG tags too.


Running the Program
-------------------

if $use_sockets is on, start the server instance of isdnlog/bin/isdnrate with
options -D2 [-v]
as soon as you see "Setup sockets" and "Going background" you can point 
your browser to 

/telrate/index.html

Enjoy