isdnlog-3.72
- new rates for 01051 - next version of isdnbill - isdnlog/tools/telnum.c ... cleanup - isdnlog/tools/isdnrate.c ... -s Service - isdnlog/tools/rate.{c,h} ... -s - isdnlog/tools/NEWS ... -s - doc/isdnrate.man .. updated -o, -s - doc/rate-files.man ... updated - isdnlog/tools/dest/README.makedest ... updt. - isdnlog/isdnlog/isdnlog.8.in .. updt. Telrate - isdnlog/tools/telrate/README-telrate - isdnlog/tools/telrate/config.in NEW - isdnlog/tools/telrate/configure NEW - isdnlog/tools/telrate/Makefile.in NEW - isdnlog/tools/telrate/index.html.in was index.html - isdnlog/tools/telrate/info.html.in was info.html - isdnlog/tools/telrate/telrate.cgi.in was telrate.cgi - isdnlog/tools/telrate/leo.sample NEW sample config - isdnlog/tools/telrate/alex.sample NEW sample config
This commit is contained in:
parent
688d0442d3
commit
3ee031023e
|
@ -95,6 +95,7 @@ libyien libyen
|
||||||
liechtensctein liechtenstein
|
liechtensctein liechtenstein
|
||||||
madaira madeira
|
madaira madeira
|
||||||
maderia madeira
|
maderia madeira
|
||||||
|
malayisa malaysia
|
||||||
marianen (nördliche) marianen (saipannord-)
|
marianen (nördliche) marianen (saipannord-)
|
||||||
marokka marokko
|
marokka marokko
|
||||||
marshall inseln marshallinseln
|
marshall inseln marshallinseln
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
## $Id: Makefile.in,v 1.126 1999/11/28 19:32:41 akool Exp $
|
## $Id: Makefile.in,v 1.127 1999/12/01 21:47:23 akool Exp $
|
||||||
##
|
##
|
||||||
## ISDN accounting for isdn4linux.
|
## ISDN accounting for isdn4linux.
|
||||||
##
|
##
|
||||||
|
@ -19,6 +19,31 @@
|
||||||
## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
##
|
##
|
||||||
## $Log: Makefile.in,v $
|
## $Log: Makefile.in,v $
|
||||||
|
## Revision 1.127 1999/12/01 21:47:23 akool
|
||||||
|
## isdnlog-3.72
|
||||||
|
## - new rates for 01051
|
||||||
|
## - next version of isdnbill
|
||||||
|
##
|
||||||
|
## - isdnlog/tools/telnum.c ... cleanup
|
||||||
|
## - isdnlog/tools/isdnrate.c ... -s Service
|
||||||
|
## - isdnlog/tools/rate.{c,h} ... -s
|
||||||
|
## - isdnlog/tools/NEWS ... -s
|
||||||
|
## - doc/isdnrate.man .. updated -o, -s
|
||||||
|
## - doc/rate-files.man ... updated
|
||||||
|
## - isdnlog/tools/dest/README.makedest ... updt.
|
||||||
|
## - isdnlog/isdnlog/isdnlog.8.in .. updt.
|
||||||
|
##
|
||||||
|
## Telrate
|
||||||
|
## - isdnlog/tools/telrate/README-telrate
|
||||||
|
## - isdnlog/tools/telrate/config.in NEW
|
||||||
|
## - isdnlog/tools/telrate/configure NEW
|
||||||
|
## - isdnlog/tools/telrate/Makefile.in NEW
|
||||||
|
## - isdnlog/tools/telrate/index.html.in was index.html
|
||||||
|
## - isdnlog/tools/telrate/info.html.in was info.html
|
||||||
|
## - isdnlog/tools/telrate/telrate.cgi.in was telrate.cgi
|
||||||
|
## - isdnlog/tools/telrate/leo.sample NEW sample config
|
||||||
|
## - isdnlog/tools/telrate/alex.sample NEW sample config
|
||||||
|
##
|
||||||
## Revision 1.126 1999/11/28 19:32:41 akool
|
## Revision 1.126 1999/11/28 19:32:41 akool
|
||||||
## isdnlog-3.71
|
## isdnlog-3.71
|
||||||
##
|
##
|
||||||
|
@ -867,7 +892,7 @@ SERVICEFILE = /etc/services
|
||||||
# DON'T EDIT BELOW THIS LINE
|
# DON'T EDIT BELOW THIS LINE
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
VERSION = 3.71
|
VERSION = 3.72
|
||||||
|
|
||||||
MANPAGES = isdnlog/callerid.conf.5 isdnlog/isdn.conf.5 \
|
MANPAGES = isdnlog/callerid.conf.5 isdnlog/isdn.conf.5 \
|
||||||
isdnlog/isdnformat.5 isdnlog/isdnlog.5 isdnlog/isdnlog.8 \
|
isdnlog/isdnformat.5 isdnlog/isdnlog.5 isdnlog/isdnlog.8 \
|
||||||
|
|
|
@ -368,7 +368,7 @@ T:_RUMF
|
||||||
|
|
||||||
N:Russische Föderat. (westl.)
|
N:Russische Föderat. (westl.)
|
||||||
A:Russische Foderat. (westl.)
|
A:Russische Foderat. (westl.)
|
||||||
A:Rußland (westl.), GUS (Russische Föderation), GUS
|
A:Rußland (westl.), GUS (Russische Föderation), GUS, Russische Förderation West
|
||||||
C:+7863, +7862, +7861, +7820, +7817, +7816, +7815, +7814
|
C:+7863, +7862, +7861, +7820, +7817, +7816, +7815, +7814
|
||||||
C:+7811, +7543, +7517, +75112, +75110, +7510, +7505, +7503, +7501, +709246
|
C:+7811, +7543, +7517, +75112, +75110, +7510, +7505, +7503, +7501, +709246
|
||||||
C:+709245, +709244, +709243, +709237, +7091, +7087, +7086, +7085, +7084
|
C:+709245, +709244, +709243, +709237, +7091, +7087, +7086, +7085, +7084
|
||||||
|
@ -396,7 +396,7 @@ R:RU
|
||||||
T:MOW
|
T:MOW
|
||||||
|
|
||||||
N:Russische Forderation (ostl.)
|
N:Russische Forderation (ostl.)
|
||||||
A:Rußland, Rußland (östl.), Russische Föderation, Russian Federation
|
A:Rußland, Rußland (östl.), Russische Föderation, Russian Federation, Russische Förderation Ost
|
||||||
C:+7
|
C:+7
|
||||||
T:SU
|
T:SU
|
||||||
|
|
||||||
|
@ -835,15 +835,15 @@ E:Germany
|
||||||
C:+49
|
C:+49
|
||||||
T:DE
|
T:DE
|
||||||
|
|
||||||
N:Deutschland Mobilfunk
|
# N:Deutschland Mobilfunk
|
||||||
C:+491610,+491611,+491612,+491613,+491614,+491615,+491616,+491617,+491619 # C
|
# C:+491610,+491611,+491612,+491613,+491614,+491615,+491616,+491617,+491619 # C
|
||||||
C:+491618 # T-C-Tel Voice Mail
|
# C:+491618 # T-C-Tel Voice Mail
|
||||||
C:+49170,+49171,+49175 # D1
|
# C:+49170,+49171,+49175 # D1
|
||||||
C:+49172,+49173,+49174 # D2
|
# C:+49172,+49173,+49174 # D2
|
||||||
C:+49177,+49178 # Eplus
|
# C:+49177,+49178 # Eplus
|
||||||
C:+49176,+49179 # E2
|
# C:+49176,+49179 # E2
|
||||||
R:DE
|
# R:DE
|
||||||
T:_DEMF
|
# T:_DEMF
|
||||||
|
|
||||||
N:Deutschland Mobilfunk C-Tel Voice Mail
|
N:Deutschland Mobilfunk C-Tel Voice Mail
|
||||||
A:C-Tel Voice Mail
|
A:C-Tel Voice Mail
|
||||||
|
@ -854,7 +854,7 @@ T:_DEMCM
|
||||||
N:Deutschland Mobilfunk C-Netz
|
N:Deutschland Mobilfunk C-Netz
|
||||||
A:C-Netz
|
A:C-Netz
|
||||||
C:+491610,+491611,+491612,+491613,+491614,+491615,+491616,+491617,+491619
|
C:+491610,+491611,+491612,+491613,+491614,+491615,+491616,+491617,+491619
|
||||||
R:_DEMF
|
R:DE
|
||||||
T:_DEMC
|
T:_DEMC
|
||||||
|
|
||||||
N:Deutschland Mobilfunk D1
|
N:Deutschland Mobilfunk D1
|
||||||
|
|
|
@ -1,10 +1,16 @@
|
||||||
.\" $Id: isdnlog.8.in,v 1.2 1998/12/29 15:53:50 paul Exp $
|
.\" $Id: isdnlog.8.in,v 1.3 1999/12/01 21:47:24 akool Exp $
|
||||||
.\" CHECKIN $Date: 1998/12/29 15:53:50 $
|
.\" CHECKIN $Date: 1999/12/01 21:47:24 $
|
||||||
.TH isdnlog 8 "@MANDATE_ISDNLOG8@" "ISDN 4 Linux @I4LVERSION@" "Linux System Administration"
|
.TH isdnlog 8 "@MANDATE_ISDNLOG8@" "ISDN 4 Linux @I4LVERSION@" "Linux System Administration"
|
||||||
.PD 0
|
.PD 0
|
||||||
.SH NAME
|
.SH NAME
|
||||||
isdnlog \- isdn log system (and more)
|
isdnlog \- isdn log system (and more)
|
||||||
|
|
||||||
|
.SH "DESCRIPTION"
|
||||||
|
Isdnlog gets information from your isdn card, decodes this
|
||||||
|
information, and can do anything with it, such as logging, starting
|
||||||
|
programs, and more. All options to isdnlog can be given as command line
|
||||||
|
flags, or you can specify a file with options (recommended).
|
||||||
|
|
||||||
.SH "RESTRICTION"
|
.SH "RESTRICTION"
|
||||||
Isdnlog only works with the HiSax isdn driver. Other cards with their
|
Isdnlog only works with the HiSax isdn driver. Other cards with their
|
||||||
own driver are not supported. Additionally you need to enable d-channel logging
|
own driver are not supported. Additionally you need to enable d-channel logging
|
||||||
|
@ -17,12 +23,6 @@ isdn card, with crossed lines. Such a card is not usable for communicating,
|
||||||
but can log
|
but can log
|
||||||
outgoing calls from any device (see dual option below).
|
outgoing calls from any device (see dual option below).
|
||||||
|
|
||||||
.SH "DESCRIPTION"
|
|
||||||
Isdnlog gets information from your isdn card, decodes this
|
|
||||||
information, and can do anything with it, such as logging, starting
|
|
||||||
programs, and more. All options to isdnlog can be given as command line
|
|
||||||
flags, or you can specify a file with options (recommended).
|
|
||||||
|
|
||||||
.SH "GENERAL OPTIONS"
|
.SH "GENERAL OPTIONS"
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
|
@ -30,8 +30,10 @@ flags, or you can specify a file with options (recommended).
|
||||||
show version information and exit.
|
show version information and exit.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B \-fFILE
|
.BI \-f FILE
|
||||||
read options from the config file FILE. The first line should be
|
read options from the config file
|
||||||
|
.IR FILE .
|
||||||
|
The first line should be
|
||||||
"[options]". You may use blank lines and comments (starting with a #).
|
"[options]". You may use blank lines and comments (starting with a #).
|
||||||
All config files for isdnlog have the format described in isdn.conf(5).
|
All config files for isdnlog have the format described in isdn.conf(5).
|
||||||
Debug options must be given on the command line, they cannot be stored in a
|
Debug options must be given on the command line, they cannot be stored in a
|
||||||
|
@ -47,38 +49,34 @@ Isdnlog has a replay mode for debugging, where you can simulate previous
|
||||||
recorded events. In that case use "-" instead of a device.
|
recorded events. In that case use "-" instead of a device.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B \-r
|
.B \-A\fIx\fB amt="value"
|
||||||
Replay a debug file (e.g. /tmp/isdnctrl0) to find bugs. With this flag
|
|
||||||
you should give a filename with the debug information instead of a device.
|
|
||||||
It will also work with files not created by isdnlog (e.g.
|
|
||||||
"cat /dev/isdnctrl0").
|
|
||||||
|
|
||||||
.TP
|
|
||||||
.B \-n newline={yes|no}
|
|
||||||
Display throughput messages on the same line (only useful with logging to
|
|
||||||
stderr or a console device).
|
|
||||||
|
|
||||||
.TP
|
|
||||||
.B \-Wx width="value"
|
|
||||||
Limit all messages to X characters per line.
|
|
||||||
|
|
||||||
.TP
|
|
||||||
.B \-Ax amt="value"
|
|
||||||
Set digits necessary to get an outside line, when connected through a PABX.
|
Set digits necessary to get an outside line, when connected through a PABX.
|
||||||
You can
|
You can
|
||||||
give several codes padded with a ":" (e.g. -A0:80:81:82).
|
give several codes padded with a ":" (e.g. -A0:80:81:82).
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B \-0x:y trim="value:value"
|
.B \-B\fIvbn\fB vbn="value"
|
||||||
Suppress leading zeroes. If isdnlog is connected through a PABX, it is
|
Set the provider preselectio to the given value. More prefixes may be separated
|
||||||
|
by a ":".
|
||||||
|
.br
|
||||||
|
Values are e.g. "010" for DE, "10" for AT, "16:17" for NL, "9" for FR.
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.B \-R\fIprefix\fB preselected="value"
|
||||||
|
Set the preselected (i.e the provider choosen, if no prefix is dialed)
|
||||||
|
provider to value. Value should be without \fIvbn\fR.
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.B \-0\fIx:y\fB trim="value:value"
|
||||||
|
Suppress leading digits. If isdnlog is connected through a PABX, it is
|
||||||
sometimes not possible to let isdnlog distinguish between a national and an
|
sometimes not possible to let isdnlog distinguish between a national and an
|
||||||
international call, even with help of the
|
international call, even with help of the
|
||||||
.B \-A
|
.B \-A
|
||||||
option.
|
option.
|
||||||
.br
|
.br
|
||||||
This option requires two digits separated with ":" as an argument. These digits
|
This option requires two values separated with ":" as an argument. These values
|
||||||
tell isdnlog how many leading zeroes to remove from incoming and outgoing calls
|
tell isdnlog how many leading digits to remove from incoming and outgoing calls
|
||||||
respectively. If only one digit is given, it is used for both values.
|
respectively. If only one value is given, it is used for both incoming and outgoing calls.
|
||||||
.br
|
.br
|
||||||
Don't use this in combination with the
|
Don't use this in combination with the
|
||||||
.B \-A
|
.B \-A
|
||||||
|
@ -100,16 +98,50 @@ will be shown. With this option the causes for the other devices are also
|
||||||
displayed.
|
displayed.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B \-2x dual="value"
|
.B \-u\fIx\fB ignoreRR="value"
|
||||||
|
Ignore "housekeeping" frames.
|
||||||
|
.I x
|
||||||
|
may be 1 (ignore RR=Receiver ready) or 2 (ignore EMP=Euracom Management Protokoll) frames.
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.B \-U\fIx\fB ignoreCOLP="value"
|
||||||
|
Ignore COLP/CLIP frames.
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.B \-2\fIx\fB dual="value"
|
||||||
Enable dual mode. You need this if you have a second isdn card attached with
|
Enable dual mode. You need this if you have a second isdn card attached with
|
||||||
crossed lines so it can listen to what other isdn devices like telephones
|
crossed lines so it can listen to what other isdn devices like telephones
|
||||||
are doing. With x=2 you can increase the debug output - every single
|
are doing. With \fIx\fR=2 you can increase the debug output - every single
|
||||||
digit will be displayed.
|
digit will be displayed.
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.B \-1
|
||||||
|
A HFC-based card is used for echo mode. Enable echo mode for the HFC card with
|
||||||
|
.br
|
||||||
|
.I hisaxctrl id 10 1
|
||||||
|
.br
|
||||||
|
.I hisaxctrl id 12 1
|
||||||
|
|
||||||
.SH "DEBUG MODULE"
|
.SH "DEBUG MODULE"
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B \-vX log=X
|
.B \-r
|
||||||
|
Replay a debug file (e.g. /tmp/isdnctrl0) to find bugs. With this flag
|
||||||
|
you should give a filename with the debug information instead of a device.
|
||||||
|
It will also work with files not created by isdnlog (e.g.
|
||||||
|
"cat /dev/isdnctrl0").
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.B \-n newline={yes|no}
|
||||||
|
Display throughput messages on the same line (only useful with logging to
|
||||||
|
stderr or a console device).
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.B \-W\fIX\fR width="value"
|
||||||
|
Limit all messages to X characters per line.
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.B \-v\fIX\fR log=X
|
||||||
Isdnlog can copy all information to /tmp/DEVICE (e.g. /tmp/isdnctrl0 if
|
Isdnlog can copy all information to /tmp/DEVICE (e.g. /tmp/isdnctrl0 if
|
||||||
you started isdnlog with /dev/isdnctrl0). Choose what debugging you want
|
you started isdnlog with /dev/isdnctrl0). Choose what debugging you want
|
||||||
from the following list, add the corresponding numbers together and use
|
from the following list, add the corresponding numbers together and use
|
||||||
|
@ -237,20 +269,20 @@ You should log at least 0x7 (errors, warnings, notice) messages.
|
||||||
Log estimated time till next charge signal.
|
Log estimated time till next charge signal.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B \-mX stdout="value"
|
.B \-m\fIX\fB stdout="value"
|
||||||
Log to stderr.
|
Log to stderr.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B \-OX outfile="path"
|
.B \-O\fIX\fB outfile="path"
|
||||||
Log to file X instead of stderr. Isdnlog will close this device when it
|
Log to file \fIX\fR instead of stderr. Isdnlog will close this device when it
|
||||||
gets a signal -SIGHUP (-1). Only valid with -m option.
|
gets a signal -SIGHUP (-1). Only valid with -m option.
|
||||||
.br
|
.br
|
||||||
If the name starts with a "+", new data will be appended to the existing file.
|
If the name starts with a "+", new data will be appended to the existing file.
|
||||||
Default behaviour is to truncate the file when isdnlog opens it.
|
Default behaviour is to truncate the file when isdnlog opens it.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B \-C X console="path"
|
.B \-C \fIX\fB console="path"
|
||||||
Log to console X instead of stderr. You can use -O and -C together,
|
Log to console \fIX\fR instead of stderr. You can use -O and -C together,
|
||||||
so that isdnlog copies output to both. Specify a full pathname.
|
so that isdnlog copies output to both. Specify a full pathname.
|
||||||
Beware: you
|
Beware: you
|
||||||
.ul
|
.ul
|
||||||
|
@ -263,50 +295,53 @@ With this flag, isdnlog will generate output for monitor programs like
|
||||||
imon, imontty or isdnmon. You must also give -m with 0x800 enabled.
|
imon, imontty or isdnmon. You must also give -m with 0x800 enabled.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B \-lX syslog="value"
|
.B \-l\fIX\fB syslog="value"
|
||||||
Log to syslog. X is the log code. You can log to syslog and to stdout at
|
Log to syslog. \fIX\fR is the log code. You can log to syslog and to stdout at
|
||||||
the same time.
|
the same time.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B \-xX xisdn="value"
|
.B \-x\fIX\fB xisdn="value"
|
||||||
Pass information to x11 client. X is the log code. You can pass
|
Pass information to x11 client. X is the log code. You can pass
|
||||||
information to x11 clients and log to syslog and/or stdout at the same
|
information to x11 clients and log to syslog and/or stdout at the same
|
||||||
time.
|
time.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B \-cX calls="value"
|
.B \-p\fIPORT\fB port="value"
|
||||||
Only with -xX : save the last X calls and pass this information to an
|
Pass information to x11 client on this \fIPORT\fR.
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.B \-c\fIX\fB calls="value"
|
||||||
|
Only with -x\fIX\fR : save the last \fIX\fR calls and pass this information to an
|
||||||
x11 client. Default value is 100.
|
x11 client. Default value is 100.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B \-LX xlog="value"
|
.B \-L\fIX\fB xlog="value"
|
||||||
Only with -xX : save the last X messages and pass this information to an
|
Only with -x\fIX\fR : save the last \fIX\fR messages and pass this information to an
|
||||||
x11 client. Default value is 500.
|
x11 client. Default value is 500.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B \-wX thruput="value"
|
.B \-w\fIX\fB thruput="value"
|
||||||
If you enabled throughput logging (0x400), isdnlog will log the throughput
|
If you enabled throughput logging (0x400), isdnlog will log the throughput
|
||||||
every X seconds.
|
every \fIX\fR seconds.
|
||||||
|
|
||||||
.SH "TIME MODULE"
|
.SH "TIME MODULE"
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B \-tX time={0|1|2}
|
.B \-t\fIX\fB time={0|1|2}
|
||||||
Isdnlog will set your local system time to the time transmitted by your
|
Isdnlog will set your local system time to the time transmitted by your
|
||||||
isdn service provider: -t1 = once, -t2 = every time.
|
isdn service provider: -t1 = once, -t2 = every time.
|
||||||
|
|
||||||
.SH "CHARGEHUP MODULE"
|
.SH "CHARGEHUP MODULE"
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B \-hX hangup="value"
|
.B \-h\fIX\fB hangup="value"
|
||||||
The isdn kernel system has a chargehup system, so it will hang up a few
|
The isdn kernel system has a chargehup system, so it will hang up a few
|
||||||
seconds before the next charge signal. If you don't get a charge
|
seconds before the next charge signal. If you don't get a charge
|
||||||
signal from your phone company, isdnlog can emulate it.
|
signal from your phone company, isdnlog can emulate it.
|
||||||
|
|
||||||
On every outgoing connection, isdnlog will calculate the charge
|
On every outgoing connection, isdnlog will calculate the charge
|
||||||
time from day of week, time of day and the distance zone of the
|
time from day of week, time of day and the distance zone of the
|
||||||
connection. So you need to list the system in isdn.conf with a ZONE=
|
connection.
|
||||||
line.
|
|
||||||
|
|
||||||
The kernel needs to know how long the charge time is, and how many
|
The kernel needs to know how long the charge time is, and how many
|
||||||
seconds before the next charge signal it should hang up. You have to set
|
seconds before the next charge signal it should hang up. You have to set
|
||||||
|
@ -322,18 +357,6 @@ isdnctrl, but this would have the same effect).
|
||||||
You should run isdnlog with -t1 or better with -t2, so isdnlog sets the
|
You should run isdnlog with -t1 or better with -t2, so isdnlog sets the
|
||||||
local time in sync with telephone switching office.
|
local time in sync with telephone switching office.
|
||||||
|
|
||||||
.TP
|
|
||||||
.B \-F cityweekend=y
|
|
||||||
Deutsche Telekom offer an option where on weekends and national holidays,
|
|
||||||
you are charged one unit every four minutes, instead of the normal rate
|
|
||||||
of one unit every 2.5 minutes from 5:00 - 21:00. Isdnlog must be informed
|
|
||||||
of this option when the chargehup option is used, or it will hangup at
|
|
||||||
completely the wrong time. As the charge info delivered is
|
|
||||||
.B not
|
|
||||||
modified, only the final bill you get is lower, isdnlog also needs to
|
|
||||||
override the charge info if it is delivered.
|
|
||||||
|
|
||||||
|
|
||||||
.SH "START MODULE"
|
.SH "START MODULE"
|
||||||
|
|
||||||
isdnlog can react on any event and start programs. This feature is
|
isdnlog can react on any event and start programs. This feature is
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: isdnbill.c,v 1.4 1999/11/28 19:32:41 akool Exp $
|
/* $Id: isdnbill.c,v 1.5 1999/12/01 21:47:25 akool Exp $
|
||||||
*
|
*
|
||||||
* ISDN accounting for isdn4linux. (Billing-module)
|
* ISDN accounting for isdn4linux. (Billing-module)
|
||||||
*
|
*
|
||||||
|
@ -40,6 +40,7 @@
|
||||||
#define CALLED 1
|
#define CALLED 1
|
||||||
|
|
||||||
#define MAXMYMSN 20
|
#define MAXMYMSN 20
|
||||||
|
#define MAXSI 10
|
||||||
|
|
||||||
#define FREECALL 0
|
#define FREECALL 0
|
||||||
#define ORTSZONE 1
|
#define ORTSZONE 1
|
||||||
|
@ -54,8 +55,15 @@
|
||||||
#define SUBTOTAL 0
|
#define SUBTOTAL 0
|
||||||
#define TOTAL 1
|
#define TOTAL 1
|
||||||
|
|
||||||
#define COUNTRYLEN 30
|
#define COUNTRYLEN 32
|
||||||
#define PROVLEN 20
|
#define PROVLEN 20
|
||||||
|
#define MSNLEN 6
|
||||||
|
|
||||||
|
#undef ME
|
||||||
|
#undef OTHER
|
||||||
|
|
||||||
|
#define ME (c.dialout ? CALLING : CALLED)
|
||||||
|
#define OTHER (c.dialout ? CALLED : CALLING)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char num[2][64];
|
char num[2][64];
|
||||||
|
@ -73,7 +81,6 @@ typedef struct {
|
||||||
char currency[64];
|
char currency[64];
|
||||||
double pay;
|
double pay;
|
||||||
int provider;
|
int provider;
|
||||||
int zone;
|
|
||||||
|
|
||||||
double compute;
|
double compute;
|
||||||
int computed;
|
int computed;
|
||||||
|
@ -81,6 +88,9 @@ typedef struct {
|
||||||
char country[BUFSIZ];
|
char country[BUFSIZ];
|
||||||
char sprovider[BUFSIZ];
|
char sprovider[BUFSIZ];
|
||||||
char error[BUFSIZ];
|
char error[BUFSIZ];
|
||||||
|
int zone;
|
||||||
|
int ihome;
|
||||||
|
int known[2];
|
||||||
} CALLER;
|
} CALLER;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -90,7 +100,7 @@ typedef struct {
|
||||||
double duration;
|
double duration;
|
||||||
double compute;
|
double compute;
|
||||||
double aktiv;
|
double aktiv;
|
||||||
char *alias[8];
|
char *alias;
|
||||||
} MSNSUM;
|
} MSNSUM;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -110,17 +120,32 @@ typedef struct {
|
||||||
double aktiv;
|
double aktiv;
|
||||||
} ZONESUM;
|
} ZONESUM;
|
||||||
|
|
||||||
static CALLER curcall;
|
typedef struct {
|
||||||
static MSNSUM msnsum[2][MAXMYMSN];
|
char msn[32];
|
||||||
|
int ncalls;
|
||||||
|
double pay;
|
||||||
|
double duration;
|
||||||
|
double compute;
|
||||||
|
} PARTNER;
|
||||||
|
|
||||||
|
static char options[] = "nv:V";
|
||||||
|
static char usage[] = "%s: usage: %s [ -%s ]\n";
|
||||||
|
|
||||||
|
|
||||||
|
static CALLER c;
|
||||||
|
static MSNSUM msnsum[2][MAXSI][MAXMYMSN];
|
||||||
static PROVSUM provsum[2][MAXPROVIDER];
|
static PROVSUM provsum[2][MAXPROVIDER];
|
||||||
static ZONESUM zonesum[2][MAXZONE];
|
static ZONESUM zonesum[2][MAXZONE];
|
||||||
|
static PARTNER *partner[2];
|
||||||
|
static TELNUM number[2];
|
||||||
static char rstr[BUFSIZ];
|
static char rstr[BUFSIZ];
|
||||||
|
static char home[BUFSIZ];
|
||||||
static int nhome = 0;
|
static int nhome = 0;
|
||||||
static int homei = 0;
|
|
||||||
|
|
||||||
int verbose = 0;
|
int verbose = 0;
|
||||||
|
|
||||||
|
static int onlynumbers = 0;
|
||||||
|
|
||||||
|
|
||||||
int print_msg(int Level, const char *fmt, ...)
|
int print_msg(int Level, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
|
@ -155,16 +180,16 @@ int print_in_modules(const char *fmt, ...)
|
||||||
} /* print_in_modules */
|
} /* print_in_modules */
|
||||||
|
|
||||||
|
|
||||||
static int when(time_t connect, char *s)
|
static void when(char *s, int *day, int *month)
|
||||||
{
|
{
|
||||||
auto struct tm *tm = localtime(&connect);
|
auto struct tm *tm = localtime(&c.connect);
|
||||||
|
|
||||||
|
|
||||||
|
*day = tm->tm_mday;
|
||||||
|
*month = tm->tm_mon + 1;
|
||||||
|
|
||||||
sprintf(s, "%02d.%02d.%04d %02d:%02d:%02d",
|
sprintf(s, "%02d.%02d.%04d %02d:%02d:%02d",
|
||||||
tm->tm_mday, tm->tm_mon + 1, tm->tm_year + 1900,
|
*day, *month, tm->tm_year + 1900, tm->tm_hour, tm->tm_min, tm->tm_sec);
|
||||||
tm->tm_hour, tm->tm_min, tm->tm_sec);
|
|
||||||
|
|
||||||
return(tm->tm_mon + 1);
|
|
||||||
} /* when */
|
} /* when */
|
||||||
|
|
||||||
|
|
||||||
|
@ -216,36 +241,56 @@ char *timestr(double n)
|
||||||
|
|
||||||
static void total(int w)
|
static void total(int w)
|
||||||
{
|
{
|
||||||
register int i;
|
register int i, j;
|
||||||
|
auto int ncalls = 0;
|
||||||
|
auto double duration = 0.0, pay = 0.0, compute = 0.0;
|
||||||
|
|
||||||
|
|
||||||
printf("------------------------------------------------------------------------------\n");
|
printf("------------------------------------------------------------------------------\n");
|
||||||
|
|
||||||
printf("\nMSN calls Duration Charge Computed\n");
|
printf("\nMSN calls Duration Charge Computed\n");
|
||||||
printf("------------------------------------------------\n");
|
printf("---------------------------------------------------------------\n");
|
||||||
|
|
||||||
for (i = 0; i < nhome; i++) {
|
for (i = 0; i < nhome; i++) {
|
||||||
if (msnsum[w][i].ncalls)
|
for (j = 0; j < MAXSI; j++) {
|
||||||
printf("%6s %5d %s DM %8.3f DM %8.3f\n",
|
if (msnsum[w][j][i].ncalls) {
|
||||||
msnsum[w][i].msn,
|
printf("%6s,%d %-12s %5d %s DM %8.3f DM %8.3f\n",
|
||||||
msnsum[w][i].ncalls,
|
msnsum[w][j][i].msn,
|
||||||
timestr(msnsum[w][i].duration),
|
j,
|
||||||
msnsum[w][i].pay,
|
msnsum[w][j][i].alias,
|
||||||
msnsum[w][i].compute);
|
msnsum[w][j][i].ncalls,
|
||||||
|
timestr(msnsum[w][j][i].duration),
|
||||||
|
msnsum[w][j][i].pay,
|
||||||
|
msnsum[w][j][i].compute);
|
||||||
|
|
||||||
|
ncalls += msnsum[w][j][i].ncalls;
|
||||||
|
duration += msnsum[w][j][i].duration;
|
||||||
|
pay += msnsum[w][j][i].pay;
|
||||||
|
compute += msnsum[w][j][i].compute;
|
||||||
|
} /* if */
|
||||||
|
|
||||||
if (w == SUBTOTAL) {
|
if (w == SUBTOTAL) {
|
||||||
strcpy(msnsum[TOTAL][i].msn, msnsum[SUBTOTAL][i].msn);
|
strcpy(msnsum[TOTAL][j][i].msn, msnsum[SUBTOTAL][j][i].msn);
|
||||||
msnsum[TOTAL][i].ncalls += msnsum[SUBTOTAL][i].ncalls;
|
msnsum[TOTAL][j][i].alias = msnsum[SUBTOTAL][j][i].alias;
|
||||||
msnsum[TOTAL][i].duration += msnsum[SUBTOTAL][i].duration;
|
msnsum[TOTAL][j][i].ncalls += msnsum[SUBTOTAL][j][i].ncalls;
|
||||||
msnsum[TOTAL][i].pay += msnsum[SUBTOTAL][i].pay;
|
msnsum[TOTAL][j][i].duration += msnsum[SUBTOTAL][j][i].duration;
|
||||||
msnsum[TOTAL][i].compute += msnsum[SUBTOTAL][i].compute;
|
msnsum[TOTAL][j][i].pay += msnsum[SUBTOTAL][j][i].pay;
|
||||||
|
msnsum[TOTAL][j][i].compute += msnsum[SUBTOTAL][j][i].compute;
|
||||||
|
|
||||||
msnsum[SUBTOTAL][i].ncalls = 0;
|
msnsum[SUBTOTAL][j][i].ncalls = 0;
|
||||||
msnsum[SUBTOTAL][i].duration = 0;
|
msnsum[SUBTOTAL][j][i].duration = 0;
|
||||||
msnsum[SUBTOTAL][i].pay = 0;
|
msnsum[SUBTOTAL][j][i].pay = 0;
|
||||||
msnsum[SUBTOTAL][i].compute = 0;
|
msnsum[SUBTOTAL][j][i].compute = 0;
|
||||||
} /* if */
|
} /* if */
|
||||||
} /* for */
|
} /* for */
|
||||||
|
} /* for */
|
||||||
|
|
||||||
|
printf("---------------------------------------------------------------\n");
|
||||||
|
printf(" %5d %s DM %8.3f DM %8.3f\n",
|
||||||
|
ncalls,
|
||||||
|
timestr(duration),
|
||||||
|
pay,
|
||||||
|
compute);
|
||||||
|
|
||||||
|
|
||||||
printf("\nProvider calls Duration Charge Computed failures avail\n");
|
printf("\nProvider calls Duration Charge Computed failures avail\n");
|
||||||
|
@ -258,7 +303,7 @@ static void total(int w)
|
||||||
else
|
else
|
||||||
printf("%s%03d", vbn, i - 100);
|
printf("%s%03d", vbn, i - 100);
|
||||||
|
|
||||||
printf(":%-24s", getProvider(pnum2prefix(i, 0)));
|
printf(":%-24s", getProvider(pnum2prefix(i, c.connect)));
|
||||||
|
|
||||||
printf("%5d %s DM %8.3f DM %8.3f %8d %5.1f%%\n",
|
printf("%5d %s DM %8.3f DM %8.3f %8d %5.1f%%\n",
|
||||||
provsum[w][i].ncalls,
|
provsum[w][i].ncalls,
|
||||||
|
@ -307,7 +352,7 @@ static void total(int w)
|
||||||
timestr(zonesum[w][i].duration),
|
timestr(zonesum[w][i].duration),
|
||||||
zonesum[w][i].pay,
|
zonesum[w][i].pay,
|
||||||
zonesum[w][i].compute,
|
zonesum[w][i].compute,
|
||||||
zonesum[w][i].pay - zonesum[w][i].aktiv);
|
zonesum[w][i].aktiv);
|
||||||
} /* if */
|
} /* if */
|
||||||
|
|
||||||
if (w == SUBTOTAL) {
|
if (w == SUBTOTAL) {
|
||||||
|
@ -329,31 +374,62 @@ static void total(int w)
|
||||||
} /* total */
|
} /* total */
|
||||||
|
|
||||||
|
|
||||||
|
static void showpartner()
|
||||||
|
{
|
||||||
|
register int i, k;
|
||||||
|
|
||||||
|
|
||||||
|
for (k = 0; k < 2; k++) {
|
||||||
|
switch (k) {
|
||||||
|
case 0 : printf("Angerufene Partner:\n"); break;
|
||||||
|
case 1 : printf("Anrufer:\n"); break;
|
||||||
|
} /* switch */
|
||||||
|
|
||||||
|
for (i = 0; i < knowns; i++)
|
||||||
|
if (partner[k][i].ncalls)
|
||||||
|
printf("%-32s %-32s %5d %10.3f %s %10.3f\n",
|
||||||
|
partner[k][i].msn,
|
||||||
|
known[i]->who,
|
||||||
|
partner[k][i].ncalls,
|
||||||
|
partner[k][i].pay,
|
||||||
|
timestr(partner[k][i].duration),
|
||||||
|
partner[k][i].compute);
|
||||||
|
} /* for */
|
||||||
|
} /* showpartner */
|
||||||
|
|
||||||
|
|
||||||
static char *numtonam(int n)
|
static char *numtonam(int n)
|
||||||
{
|
{
|
||||||
register int i, j = -1;
|
register int i, j = -1;
|
||||||
|
|
||||||
|
|
||||||
|
if (onlynumbers)
|
||||||
|
return(NULL);
|
||||||
|
|
||||||
for (i = 0; i < knowns; i++) {
|
for (i = 0; i < knowns; i++) {
|
||||||
if (!num_match(known[i]->num, curcall.num[n])) {
|
if (!num_match(known[i]->num, c.num[n])) {
|
||||||
j = i;
|
j = i;
|
||||||
|
|
||||||
if (known[i]->si == curcall.si1)
|
if (known[i]->si == c.si1) {
|
||||||
|
c.known[n] = i;
|
||||||
return(known[i]->who);
|
return(known[i]->who);
|
||||||
} /* if */
|
} /* if */
|
||||||
|
} /* if */
|
||||||
} /* for */
|
} /* for */
|
||||||
|
|
||||||
|
c.known[n] = j;
|
||||||
|
|
||||||
return((j == -1) ? NULL : known[j]->who);
|
return((j == -1) ? NULL : known[j]->who);
|
||||||
} /* numtonam */
|
} /* numtonam */
|
||||||
|
|
||||||
|
|
||||||
static void justify(char *fromnum, char *tonum, int dialout, TELNUM number)
|
static void justify(char *fromnum, char *tonum, TELNUM number)
|
||||||
{
|
{
|
||||||
register char *p1, *p2;
|
register char *p1, *p2;
|
||||||
auto char s[BUFSIZ], sx[BUFSIZ];
|
auto char s[BUFSIZ], sx[BUFSIZ], sy[BUFSIZ];
|
||||||
|
|
||||||
|
|
||||||
p1 = numtonam(dialout ? CALLED : CALLING);
|
p1 = numtonam(c.dialout ? CALLED : CALLING);
|
||||||
|
|
||||||
if (*number.msn)
|
if (*number.msn)
|
||||||
sprintf(sx, "%s%s%s", number.area, (*number.area ? "/" : ""), number.msn);
|
sprintf(sx, "%s%s%s", number.area, (*number.area ? "/" : ""), number.msn);
|
||||||
|
@ -365,11 +441,11 @@ static void justify(char *fromnum, char *tonum, int dialout, TELNUM number)
|
||||||
else
|
else
|
||||||
sprintf(s, "%s%s", (*number.country ? "0" : ""), sx);
|
sprintf(s, "%s%s", (*number.country ? "0" : ""), sx);
|
||||||
|
|
||||||
p2 = msnsum[SUBTOTAL][homei].alias[curcall.si1];
|
p2 = msnsum[SUBTOTAL][c.si1][c.ihome].alias;
|
||||||
|
|
||||||
printf("%12s %s %-17s",
|
printf("%12s %s %-21s",
|
||||||
p2 ? p2 : fromnum,
|
p2 ? p2 : fromnum,
|
||||||
(dialout ? "->" : "<-"),
|
(c.dialout ? "->" : "<-"),
|
||||||
p1 ? p1 : s);
|
p1 ? p1 : s);
|
||||||
|
|
||||||
*s = 0;
|
*s = 0;
|
||||||
|
@ -387,6 +463,11 @@ static void justify(char *fromnum, char *tonum, int dialout, TELNUM number)
|
||||||
strcat(s, ", ");
|
strcat(s, ", ");
|
||||||
|
|
||||||
strcat(s, number.sarea);
|
strcat(s, number.sarea);
|
||||||
|
|
||||||
|
if (c.dialout) {
|
||||||
|
sprintf(sy, ",%d", c.zone);
|
||||||
|
strcat(s, sy);
|
||||||
|
} /* if */
|
||||||
} /* if */
|
} /* if */
|
||||||
|
|
||||||
if (!*s)
|
if (!*s)
|
||||||
|
@ -395,193 +476,55 @@ static void justify(char *fromnum, char *tonum, int dialout, TELNUM number)
|
||||||
|
|
||||||
s[COUNTRYLEN] = 0; /* clipping */
|
s[COUNTRYLEN] = 0; /* clipping */
|
||||||
|
|
||||||
sprintf(curcall.country, "%-*s", COUNTRYLEN, s);
|
sprintf(c.country, "%-*s", COUNTRYLEN, s);
|
||||||
} /* justify */
|
} /* justify */
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char *argv[], char *envp[])
|
static void findme()
|
||||||
{
|
{
|
||||||
register char *pl, *pr, *p;
|
register int i;
|
||||||
#ifdef DEBUG
|
register char *p;
|
||||||
auto FILE *f = fopen("/www/log/isdn.log", "r");
|
auto char s[BUFSIZ];
|
||||||
#else
|
|
||||||
auto FILE *f = fopen("/var/log/isdn.log", "r");
|
|
||||||
#endif
|
|
||||||
auto char s[BUFSIZ], sx[BUFSIZ], home[BUFSIZ];
|
|
||||||
auto int z, i, l, col, month = -1;
|
|
||||||
auto TELNUM number[2];
|
|
||||||
auto double dur;
|
|
||||||
auto RATE Rate;
|
|
||||||
auto char *version;
|
|
||||||
auto char *myname = basename(argv[0]);
|
|
||||||
|
|
||||||
|
|
||||||
if (f != (FILE *)NULL) {
|
sprintf(s, "%*s", -MSNLEN, number[ME].msn);
|
||||||
|
s[MSNLEN] = 0;
|
||||||
|
|
||||||
*home = 0;
|
p = strstr(home, s);
|
||||||
|
|
||||||
set_print_fct_for_tools(print_in_modules);
|
|
||||||
|
|
||||||
if (readconfig(myname) != 0)
|
|
||||||
return(1);
|
|
||||||
|
|
||||||
initHoliday("/usr/lib/isdn/holiday-de.dat", &version);
|
|
||||||
|
|
||||||
initDest("/usr/lib/isdn/dest.gdbm", &version);
|
|
||||||
|
|
||||||
initRate("/etc/isdn/rate.conf", "/usr/lib/isdn/rate-de.dat", "/usr/lib/isdn/zone-de-%s.gdbm", &version);
|
|
||||||
|
|
||||||
memset(&msnsum, 0, sizeof(msnsum));
|
|
||||||
memset(&provsum, 0, sizeof(provsum));
|
|
||||||
memset(&zonesum, 0, sizeof(zonesum));
|
|
||||||
|
|
||||||
while (fgets(s, BUFSIZ, f)) {
|
|
||||||
pl = s;
|
|
||||||
col = 0;
|
|
||||||
|
|
||||||
memset(&curcall, 0, sizeof(curcall));
|
|
||||||
|
|
||||||
while ((pr = strchr(pl, '|'))) {
|
|
||||||
memcpy(sx, pl, (l = (pr - pl)));
|
|
||||||
sx[l] = 0;
|
|
||||||
pl = pr + 1;
|
|
||||||
|
|
||||||
switch (col++) {
|
|
||||||
case 0 : break;
|
|
||||||
|
|
||||||
case 1 : deb(sx);
|
|
||||||
strcpy(curcall.num[CALLING], sx);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 2 : deb(sx);
|
|
||||||
strcpy(curcall.num[CALLED], sx);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 3 : dur = atoi(sx); break;
|
|
||||||
|
|
||||||
case 4 : curcall.duration = atol(sx) / HZ;
|
|
||||||
|
|
||||||
if (abs((int)dur - (int)curcall.duration) > 1)
|
|
||||||
curcall.duration = dur;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 5 : curcall.connect = atol(sx); break;
|
|
||||||
case 6 : curcall.units = atoi(sx); break;
|
|
||||||
case 7 : curcall.dialout = *sx == 'O'; break;
|
|
||||||
case 8 : curcall.cause = atoi(sx); break;
|
|
||||||
case 9 : curcall.ibytes = atoi(sx); break;
|
|
||||||
case 10 : curcall.obytes = atoi(sx); break;
|
|
||||||
case 11 : strcpy(curcall.version, sx); break;
|
|
||||||
case 12 : curcall.si1 = atoi(sx); break;
|
|
||||||
case 13 : curcall.si2 = atoi(sx); break;
|
|
||||||
case 14 : curcall.currency_factor = atof(sx); break;
|
|
||||||
case 15 : strcpy(curcall.currency, sx); break;
|
|
||||||
case 16 : curcall.pay = atof(sx); break;
|
|
||||||
case 17 : curcall.provider = atoi(sx); break;
|
|
||||||
case 18 : break;
|
|
||||||
} /* switch */
|
|
||||||
|
|
||||||
} /* while */
|
|
||||||
|
|
||||||
/* Repair wrong entries from older isdnlog-versions ... */
|
|
||||||
|
|
||||||
if (!curcall.provider || (curcall.provider == UNKNOWN))
|
|
||||||
curcall.provider = preselect;
|
|
||||||
|
|
||||||
if (curcall.dialout && (strlen(curcall.num[CALLED]) > 3) && !getSpecial(curcall.num[CALLED])) {
|
|
||||||
sprintf(s, "0%s", curcall.num[CALLED] + 3);
|
|
||||||
|
|
||||||
if (getSpecial(s))
|
|
||||||
strcpy(curcall.num[CALLED], s);
|
|
||||||
} /* if */
|
|
||||||
|
|
||||||
if (!curcall.dialout && (strlen(curcall.num[CALLING]) > 3) && !getSpecial(curcall.num[CALLING])) {
|
|
||||||
sprintf(s, "0%s", curcall.num[CALLING] + 3);
|
|
||||||
|
|
||||||
if (getSpecial(s))
|
|
||||||
strcpy(curcall.num[CALLING], s);
|
|
||||||
} /* if */
|
|
||||||
|
|
||||||
/* if (curcall.dialout) */
|
|
||||||
/* if (curcall.duration) */
|
|
||||||
/* if (curcall.provider != UNKNOWN) */
|
|
||||||
|
|
||||||
if (*curcall.num[CALLING] && *curcall.num[CALLED]) {
|
|
||||||
|
|
||||||
i = when(curcall.connect, s);
|
|
||||||
|
|
||||||
if (month == -1)
|
|
||||||
month = i;
|
|
||||||
else if (i != month) {
|
|
||||||
total(SUBTOTAL);
|
|
||||||
month = i;
|
|
||||||
} /* if */
|
|
||||||
|
|
||||||
printf("%s%s ", s, timestr(curcall.duration));
|
|
||||||
|
|
||||||
normalizeNumber(curcall.num[CALLING], &number[CALLING], TN_ALL);
|
|
||||||
normalizeNumber(curcall.num[CALLED], &number[CALLED], TN_ALL);
|
|
||||||
|
|
||||||
if (curcall.dialout) {
|
|
||||||
|
|
||||||
p = strstr(home, number[CALLING].msn);
|
|
||||||
|
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
strcat(home, number[CALLING].msn);
|
strcat(home, s);
|
||||||
strcat(home, "|");
|
strcat(home, "|");
|
||||||
|
|
||||||
p = strstr(home, number[CALLING].msn);
|
p = strstr(home, s);
|
||||||
homei = (int)(p - home) / 7;
|
c.ihome = (int)(p - home) / 7;
|
||||||
|
|
||||||
strcpy(msnsum[SUBTOTAL][homei].msn, number[CALLING].msn);
|
i = c.si1;
|
||||||
|
|
||||||
i = curcall.si1;
|
for (c.si1 = 0; c.si1 < MAXSI; c.si1++) {
|
||||||
|
strcpy(msnsum[SUBTOTAL][c.si1][c.ihome].msn, number[ME].msn);
|
||||||
|
msnsum[SUBTOTAL][c.si1][c.ihome].alias = numtonam(ME);
|
||||||
|
} /* for */
|
||||||
|
|
||||||
for (curcall.si1 = 1; curcall.si1 < 8; curcall.si1++)
|
c.si1 = i;
|
||||||
msnsum[SUBTOTAL][homei].alias[curcall.si1] = numtonam(CALLING);
|
|
||||||
|
|
||||||
curcall.si1 = i;
|
|
||||||
|
|
||||||
nhome++;
|
nhome++;
|
||||||
} /* if */
|
} /* if */
|
||||||
|
|
||||||
homei = (int)(p - home) / 7;
|
c.ihome = (int)(p - home) / 7;
|
||||||
msnsum[SUBTOTAL][homei].ncalls++;
|
} /* findme */
|
||||||
|
|
||||||
justify(number[CALLING].msn, curcall.num[CALLED], curcall.dialout, number[CALLED]);
|
|
||||||
|
|
||||||
provsum[SUBTOTAL][curcall.provider].ncalls++;
|
|
||||||
|
|
||||||
strcpy(s, getProvider(pnum2prefix(curcall.provider, 0)));
|
|
||||||
s[PROVLEN] = 0;
|
|
||||||
|
|
||||||
if (curcall.provider < 100)
|
|
||||||
sprintf(curcall.sprovider, " %s%02d:%-*s", vbn, curcall.provider, PROVLEN, s);
|
|
||||||
else
|
|
||||||
sprintf(curcall.sprovider, "%s%03d:%-*s", vbn, curcall.provider - 100, PROVLEN, s);
|
|
||||||
|
|
||||||
|
|
||||||
if (!curcall.duration) {
|
static void findrate()
|
||||||
printf(" %s%s", curcall.country, curcall.sprovider);
|
{
|
||||||
|
auto RATE Rate;
|
||||||
if ((curcall.cause != 0x1f) && /* Normal, unspecified */
|
auto char *version;
|
||||||
(curcall.cause != 0x10)) /* Normal call clearing */
|
|
||||||
printf(" %s", qmsg(TYPE_CAUSE, VERSION_EDSS1, curcall.cause));
|
|
||||||
|
|
||||||
if ((curcall.cause == 0x22) || /* No circuit/channel available */
|
|
||||||
(curcall.cause == 0x2a) || /* Switching equipment congestion */
|
|
||||||
(curcall.cause == 0x2f)) /* Resource unavailable, unspecified */
|
|
||||||
provsum[SUBTOTAL][curcall.provider].failed++;
|
|
||||||
|
|
||||||
printf("\n");
|
|
||||||
continue;
|
|
||||||
} /* if */
|
|
||||||
|
|
||||||
|
|
||||||
clearRate(&Rate);
|
clearRate(&Rate);
|
||||||
Rate.start = curcall.connect;
|
Rate.start = c.connect;
|
||||||
Rate.now = curcall.connect + curcall.duration;
|
Rate.now = c.connect + c.duration;
|
||||||
Rate.prefix = pnum2prefix(curcall.provider, 0);
|
Rate.prefix = pnum2prefix(c.provider, c.connect);
|
||||||
|
|
||||||
Rate.src[0] = number[CALLING].country;
|
Rate.src[0] = number[CALLING].country;
|
||||||
Rate.src[1] = number[CALLING].area;
|
Rate.src[1] = number[CALLING].area;
|
||||||
|
@ -592,32 +535,260 @@ int main(int argc, char *argv[], char *envp[])
|
||||||
Rate.dst[2] = number[CALLED].msn;
|
Rate.dst[2] = number[CALLED].msn;
|
||||||
|
|
||||||
if (getRate(&Rate, &version) != UNKNOWN) {
|
if (getRate(&Rate, &version) != UNKNOWN) {
|
||||||
z = Rate.z;
|
c.zone = Rate.z;
|
||||||
|
|
||||||
if (!z && (*number[CALLED].country && strcmp(number[CALLED].country, mycountry)))
|
if (!c.zone && (*number[CALLED].country && strcmp(number[CALLED].country, mycountry)))
|
||||||
z = AUSLAND;
|
c.zone = AUSLAND;
|
||||||
else if (getSpecial(curcall.num[CALLED]))
|
else if (getSpecial(c.num[CALLED]))
|
||||||
z = SONDERRUFNUMMERN;
|
c.zone = SONDERRUFNUMMERN;
|
||||||
else if (z == UNKNOWN)
|
else if (c.zone == UNKNOWN)
|
||||||
z = ELSEWHERE;
|
c.zone = ELSEWHERE;
|
||||||
|
|
||||||
zonesum[SUBTOTAL][z].ncalls++;
|
zonesum[SUBTOTAL][c.zone].ncalls++;
|
||||||
|
|
||||||
curcall.compute = Rate.Charge;
|
c.compute = Rate.Charge;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
z = ELSEWHERE;
|
c.zone = ELSEWHERE;
|
||||||
curcall.compute = curcall.pay;
|
c.compute = c.pay;
|
||||||
sprintf(curcall.error, " ??? %s", version);
|
sprintf(c.error, " ??? %s", version);
|
||||||
|
} /* else */
|
||||||
|
} /* findrate */
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, char *argv[], char *envp[])
|
||||||
|
{
|
||||||
|
register char *pl, *pr, *p, x;
|
||||||
|
#ifdef DEBUG
|
||||||
|
auto FILE *f = fopen("/www/log/isdn.log", "r");
|
||||||
|
#else
|
||||||
|
auto FILE *f = fopen("/var/log/isdn.log", "r");
|
||||||
|
#endif
|
||||||
|
auto char s[BUFSIZ], sx[BUFSIZ];
|
||||||
|
auto int l, col, day, lday = -1, month, lmonth = -1;
|
||||||
|
auto double dur;
|
||||||
|
auto char *version;
|
||||||
|
auto char *myname = basename(argv[0]);
|
||||||
|
auto int opt;
|
||||||
|
|
||||||
|
|
||||||
|
if (f != (FILE *)NULL) {
|
||||||
|
|
||||||
|
while ((opt = getopt(argc, argv, options)) != EOF)
|
||||||
|
switch (opt) {
|
||||||
|
case 'n' : onlynumbers++;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'v' : verbose = atoi(optarg);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'V' : print_version(myname);
|
||||||
|
exit(0);
|
||||||
|
|
||||||
|
case '?' : printf(usage, argv[0], argv[0], options);
|
||||||
|
return(1);
|
||||||
|
} /* switch */
|
||||||
|
|
||||||
|
|
||||||
|
*home = 0;
|
||||||
|
|
||||||
|
set_print_fct_for_tools(print_in_modules);
|
||||||
|
|
||||||
|
if (!readconfig(myname)) {
|
||||||
|
|
||||||
|
initHoliday(holifile, &version);
|
||||||
|
|
||||||
|
if (verbose)
|
||||||
|
fprintf(stderr, "%s\n", version);
|
||||||
|
|
||||||
|
initDest(destfile, &version);
|
||||||
|
|
||||||
|
if (verbose)
|
||||||
|
fprintf(stderr, "%s\n", version);
|
||||||
|
|
||||||
|
initRate(rateconf, ratefile, zonefile, &version);
|
||||||
|
|
||||||
|
if (verbose)
|
||||||
|
fprintf(stderr, "%s\n", version);
|
||||||
|
|
||||||
|
|
||||||
|
memset(&msnsum, 0, sizeof(msnsum));
|
||||||
|
memset(&provsum, 0, sizeof(provsum));
|
||||||
|
memset(&zonesum, 0, sizeof(zonesum));
|
||||||
|
|
||||||
|
partner[0] = (PARTNER *)calloc(knowns, sizeof(PARTNER));
|
||||||
|
partner[1] = (PARTNER *)calloc(knowns, sizeof(PARTNER));
|
||||||
|
|
||||||
|
while (fgets(s, BUFSIZ, f)) {
|
||||||
|
pl = s;
|
||||||
|
col = 0;
|
||||||
|
|
||||||
|
memset(&c, 0, sizeof(c));
|
||||||
|
|
||||||
|
while ((pr = strchr(pl, '|'))) {
|
||||||
|
memcpy(sx, pl, (l = (pr - pl)));
|
||||||
|
sx[l] = 0;
|
||||||
|
pl = pr + 1;
|
||||||
|
|
||||||
|
switch (col++) {
|
||||||
|
case 0 : break;
|
||||||
|
|
||||||
|
case 1 : deb(sx);
|
||||||
|
strcpy(c.num[CALLING], sx);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2 : deb(sx);
|
||||||
|
strcpy(c.num[CALLED], sx);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 3 : dur = atoi(sx); break;
|
||||||
|
|
||||||
|
case 4 : c.duration = atol(sx) / HZ;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 5 : c.connect = atol(sx); break;
|
||||||
|
case 6 : c.units = atoi(sx); break;
|
||||||
|
case 7 : c.dialout = *sx == 'O'; break;
|
||||||
|
case 8 : c.cause = atoi(sx); break;
|
||||||
|
case 9 : c.ibytes = atoi(sx); break;
|
||||||
|
case 10 : c.obytes = atoi(sx); break;
|
||||||
|
case 11 : strcpy(c.version, sx); break;
|
||||||
|
case 12 : c.si1 = atoi(sx); break;
|
||||||
|
case 13 : c.si2 = atoi(sx); break;
|
||||||
|
case 14 : c.currency_factor = atof(sx); break;
|
||||||
|
case 15 : strcpy(c.currency, sx); break;
|
||||||
|
case 16 : c.pay = atof(sx); break;
|
||||||
|
case 17 : c.provider = atoi(sx); break;
|
||||||
|
case 18 : break;
|
||||||
|
} /* switch */
|
||||||
|
|
||||||
|
} /* while */
|
||||||
|
|
||||||
|
|
||||||
|
/* Repair wrong entries from older (or current?) isdnlog-versions ... */
|
||||||
|
|
||||||
|
if (abs((int)dur - (int)c.duration) > 1) {
|
||||||
|
if (verbose)
|
||||||
|
fprintf(stderr, "REPAIR: Duration %f -> %f\n", c.duration, dur);
|
||||||
|
|
||||||
|
c.duration = dur;
|
||||||
|
} /* if */
|
||||||
|
|
||||||
|
if (!memcmp(c.num[CALLED], "+4910", 5)) {
|
||||||
|
p = c.num[CALLED] + 7;
|
||||||
|
x = *p;
|
||||||
|
*p = 0;
|
||||||
|
|
||||||
|
c.provider = atoi(c.num[CALLED] + 5);
|
||||||
|
|
||||||
|
*p = x;
|
||||||
|
|
||||||
|
memmove(c.num[CALLED] + 3, c.num[CALLED] + 8, strlen(c.num[CALLED]) - 7);
|
||||||
|
|
||||||
|
if (verbose)
|
||||||
|
fprintf(stderr, "REPAIR: Provider=%d\n", c.provider);
|
||||||
|
} /* if */
|
||||||
|
|
||||||
|
if (!c.provider || (c.provider == UNKNOWN)) {
|
||||||
|
if (verbose)
|
||||||
|
fprintf(stderr, "REPAIR: Provider %d -> %d\n", c.provider, preselect);
|
||||||
|
|
||||||
|
c.provider = preselect;
|
||||||
|
} /* if */
|
||||||
|
|
||||||
|
if (c.dialout && (strlen(c.num[CALLED]) > 3) && !getSpecial(c.num[CALLED])) {
|
||||||
|
sprintf(s, "0%s", c.num[CALLED] + 3);
|
||||||
|
|
||||||
|
if (getSpecial(s)) {
|
||||||
|
if (verbose)
|
||||||
|
fprintf(stderr, "REPAIR: Callee %s -> %s\n", c.num[CALLED], s);
|
||||||
|
|
||||||
|
strcpy(c.num[CALLED], s);
|
||||||
|
} /* if */
|
||||||
|
} /* if */
|
||||||
|
|
||||||
|
if (!c.dialout && (strlen(c.num[CALLING]) > 3) && !getSpecial(c.num[CALLING])) {
|
||||||
|
sprintf(s, "0%s", c.num[CALLING] + 3);
|
||||||
|
|
||||||
|
if (getSpecial(s)) {
|
||||||
|
if (verbose)
|
||||||
|
fprintf(stderr, "REPAIR: Caller %s -> %s\n", c.num[CALLING], s);
|
||||||
|
|
||||||
|
strcpy(c.num[CALLING], s);
|
||||||
|
} /* if */
|
||||||
|
} /* if */
|
||||||
|
|
||||||
|
/* if (c.dialout) */
|
||||||
|
/* if (c.duration) */
|
||||||
|
/* if (c.provider != UNKNOWN) */
|
||||||
|
|
||||||
|
if (*c.num[CALLING] && *c.num[CALLED]) {
|
||||||
|
|
||||||
|
when(s, &day, &month);
|
||||||
|
|
||||||
|
if (lmonth == -1)
|
||||||
|
lmonth = month;
|
||||||
|
else if (month != lmonth) {
|
||||||
|
total(SUBTOTAL);
|
||||||
|
lmonth = month;
|
||||||
|
} /* if */
|
||||||
|
|
||||||
|
if (lday == -1)
|
||||||
|
lday = day;
|
||||||
|
else if (day != lday) {
|
||||||
|
printf("\n");
|
||||||
|
lday = day;
|
||||||
} /* else */
|
} /* else */
|
||||||
|
|
||||||
if ((z == 1) || (z == 2)) {
|
printf("%s%s ", s, timestr(c.duration));
|
||||||
auto struct tm *tm = localtime(&curcall.connect);
|
|
||||||
|
normalizeNumber(c.num[CALLING], &number[CALLING], TN_ALL);
|
||||||
|
normalizeNumber(c.num[CALLED], &number[CALLED], TN_ALL);
|
||||||
|
|
||||||
|
findme();
|
||||||
|
|
||||||
|
if (c.dialout) {
|
||||||
|
|
||||||
|
findrate();
|
||||||
|
|
||||||
|
msnsum[SUBTOTAL][c.si1][c.ihome].ncalls++;
|
||||||
|
|
||||||
|
justify(number[CALLING].msn, c.num[CALLED], number[CALLED]);
|
||||||
|
|
||||||
|
provsum[SUBTOTAL][c.provider].ncalls++;
|
||||||
|
|
||||||
|
strcpy(s, getProvider(pnum2prefix(c.provider, c.connect)));
|
||||||
|
s[PROVLEN] = 0;
|
||||||
|
|
||||||
|
if (c.provider < 100)
|
||||||
|
sprintf(c.sprovider, " %s%02d:%-*s", vbn, c.provider, PROVLEN, s);
|
||||||
|
else
|
||||||
|
sprintf(c.sprovider, "%s%03d:%-*s", vbn, c.provider - 100, PROVLEN, s);
|
||||||
|
|
||||||
|
|
||||||
|
if (!c.duration) {
|
||||||
|
printf(" %s%s", c.country, c.sprovider);
|
||||||
|
|
||||||
|
if ((c.cause != 0x1f) && /* Normal, unspecified */
|
||||||
|
(c.cause != 0x10)) /* Normal call clearing */
|
||||||
|
printf(" %s", qmsg(TYPE_CAUSE, VERSION_EDSS1, c.cause));
|
||||||
|
|
||||||
|
if ((c.cause == 0x22) || /* No circuit/channel available */
|
||||||
|
(c.cause == 0x2a) || /* Switching equipment congestion */
|
||||||
|
(c.cause == 0x2f)) /* Resource unavailable, unspecified */
|
||||||
|
provsum[SUBTOTAL][c.provider].failed++;
|
||||||
|
|
||||||
|
printf("\n");
|
||||||
|
continue;
|
||||||
|
} /* if */
|
||||||
|
|
||||||
|
if ((c.zone == 1) || (c.zone == 2)) {
|
||||||
|
auto struct tm *tm = localtime(&c.connect);
|
||||||
auto int takte;
|
auto int takte;
|
||||||
auto double price;
|
auto double price;
|
||||||
|
|
||||||
|
|
||||||
takte = (curcall.duration + 59) / 60;
|
takte = (c.duration + 59) / 60;
|
||||||
|
|
||||||
if ((tm->tm_wday > 0) && (tm->tm_wday < 5)) { /* Wochentag */
|
if ((tm->tm_wday > 0) && (tm->tm_wday < 5)) { /* Wochentag */
|
||||||
if ((tm->tm_hour > 8) && (tm->tm_hour < 18)) /* Hauptzeit */
|
if ((tm->tm_hour > 8) && (tm->tm_hour < 18)) /* Hauptzeit */
|
||||||
|
@ -628,54 +799,63 @@ int main(int argc, char *argv[], char *envp[])
|
||||||
else /* Wochenende */
|
else /* Wochenende */
|
||||||
price = 0.03;
|
price = 0.03;
|
||||||
|
|
||||||
curcall.aktiv = takte * price;
|
c.aktiv = takte * price;
|
||||||
|
|
||||||
// printf("AKTIVPLUS:%8.3f, gespart: %8.3f", curcall.aktiv, curcall.pay - curcall.aktiv);
|
msnsum[SUBTOTAL][c.si1][c.ihome].aktiv += c.aktiv;
|
||||||
|
provsum[SUBTOTAL][c.provider].aktiv += c.aktiv;
|
||||||
msnsum[SUBTOTAL][homei].aktiv += curcall.aktiv;
|
zonesum[SUBTOTAL][c.zone].aktiv += c.aktiv;
|
||||||
provsum[SUBTOTAL][curcall.provider].aktiv += curcall.aktiv;
|
|
||||||
zonesum[SUBTOTAL][z].aktiv += curcall.aktiv;
|
|
||||||
} /* if */
|
} /* if */
|
||||||
|
|
||||||
if (curcall.pay < 0.0) { /* impossible! */
|
if (c.pay < 0.0) { /* impossible! */
|
||||||
curcall.pay = curcall.compute;
|
c.pay = c.compute;
|
||||||
curcall.computed++;
|
c.computed++;
|
||||||
} /* if */
|
} /* if */
|
||||||
|
|
||||||
if (curcall.compute && fabs(curcall.pay - Rate.Charge) > 1.00) {
|
if (c.compute && fabs(c.pay - c.compute) > 1.00) {
|
||||||
curcall.pay = curcall.compute;
|
c.pay = c.compute;
|
||||||
curcall.computed++;
|
c.computed++;
|
||||||
} /* if */
|
} /* if */
|
||||||
|
|
||||||
|
|
||||||
if (curcall.pay)
|
if (c.pay)
|
||||||
printf("%s%7.3f%s ", curcall.currency, curcall.pay, curcall.computed ? "*" : " ");
|
printf("%s%7.3f%s ", c.currency, c.pay, c.computed ? "*" : " ");
|
||||||
else
|
else
|
||||||
printf(" ", curcall.currency, curcall.pay, curcall.computed ? "*" : " ");
|
printf(" ");
|
||||||
|
|
||||||
printf("%s%s%s", curcall.country, curcall.sprovider, curcall.error);
|
printf("%s%s%s", c.country, c.sprovider, c.error);
|
||||||
|
|
||||||
if (curcall.aktiv) {
|
if (c.aktiv)
|
||||||
printf(" AktivPlus - %s%6.3f", curcall.currency, curcall.pay - curcall.aktiv);
|
printf(" AktivPlus - %s%6.3f", c.currency, c.pay - c.aktiv);
|
||||||
}
|
|
||||||
|
|
||||||
msnsum[SUBTOTAL][homei].pay += curcall.pay;
|
msnsum[SUBTOTAL][c.si1][c.ihome].pay += c.pay;
|
||||||
msnsum[SUBTOTAL][homei].duration += curcall.duration;
|
msnsum[SUBTOTAL][c.si1][c.ihome].duration += c.duration;
|
||||||
msnsum[SUBTOTAL][homei].compute += curcall.compute;
|
msnsum[SUBTOTAL][c.si1][c.ihome].compute += c.compute;
|
||||||
|
|
||||||
provsum[SUBTOTAL][curcall.provider].pay += curcall.pay;
|
provsum[SUBTOTAL][c.provider].pay += c.pay;
|
||||||
provsum[SUBTOTAL][curcall.provider].duration += curcall.duration;
|
provsum[SUBTOTAL][c.provider].duration += c.duration;
|
||||||
provsum[SUBTOTAL][curcall.provider].compute += curcall.compute;
|
provsum[SUBTOTAL][c.provider].compute += c.compute;
|
||||||
|
|
||||||
|
zonesum[SUBTOTAL][c.zone].pay += c.pay;
|
||||||
|
zonesum[SUBTOTAL][c.zone].duration += c.duration;
|
||||||
|
zonesum[SUBTOTAL][c.zone].compute += c.compute;
|
||||||
|
|
||||||
|
strcpy(partner[0][c.known[CALLING]].msn, c.num[OTHER]);
|
||||||
|
partner[0][c.known[CALLING]].ncalls++;
|
||||||
|
partner[0][c.known[CALLING]].pay += c.pay;
|
||||||
|
partner[0][c.known[CALLING]].duration += c.duration;
|
||||||
|
partner[0][c.known[CALLING]].compute += c.compute;
|
||||||
|
|
||||||
zonesum[SUBTOTAL][z].pay += curcall.pay;
|
|
||||||
zonesum[SUBTOTAL][z].duration += curcall.duration;
|
|
||||||
zonesum[SUBTOTAL][z].compute += curcall.compute;
|
|
||||||
}
|
}
|
||||||
else { /* Dialin: */
|
else { /* Dialin: */
|
||||||
justify(number[CALLED].msn, curcall.num[CALLING], curcall.dialout, number[CALLING]);
|
justify(number[CALLED].msn, c.num[CALLING], number[CALLING]);
|
||||||
printf(" %s%s", curcall.country, curcall.sprovider);
|
printf(" %s%s", c.country, c.sprovider);
|
||||||
|
|
||||||
|
strcpy(partner[1][c.known[CALLING]].msn, c.num[OTHER]);
|
||||||
|
partner[1][c.known[CALLING]].ncalls++;
|
||||||
|
partner[1][c.known[CALLING]].duration += c.duration;
|
||||||
} /* else */
|
} /* else */
|
||||||
|
|
||||||
|
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
} /* if */
|
} /* if */
|
||||||
|
@ -685,7 +865,14 @@ int main(int argc, char *argv[], char *envp[])
|
||||||
total(SUBTOTAL);
|
total(SUBTOTAL);
|
||||||
total(TOTAL);
|
total(TOTAL);
|
||||||
|
|
||||||
} /* if */
|
showpartner();
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
fprintf(stderr, "%s: Can't read configuration file(s)\n", myname);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
fprintf(stderr, "%s: Can't open \"isdn.log\" file\n", myname);
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
} /* isdnbill */
|
} /* isdnbill */
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
V:1.10-Germany [27-Nov-1999 13:09:30]
|
V:1.10-Germany [01-Dec-1999 18:41:57]
|
||||||
|
|
||||||
# Währungsformat
|
# Währungsformat
|
||||||
U:%.3f DM
|
U:%.3f DM
|
||||||
|
@ -8,7 +8,7 @@ U:%.3f DM
|
||||||
#
|
#
|
||||||
# (C) Copyright 1999 by Andreas Kool (akool@isdn4linux.de)
|
# (C) Copyright 1999 by Andreas Kool (akool@isdn4linux.de)
|
||||||
#
|
#
|
||||||
# $Id: rate-de.dat,v 1.64 1999/11/27 19:24:17 akool Exp $
|
# $Id: rate-de.dat,v 1.65 1999/12/01 21:47:23 akool Exp $
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Das "A:" Tag muß folgendermaßen gefüllt werden:
|
# Das "A:" Tag muß folgendermaßen gefüllt werden:
|
||||||
|
@ -12472,7 +12472,7 @@ T:*/*=2.3084(60)/1
|
||||||
P:51 01051
|
P:51 01051
|
||||||
B:01051
|
B:01051
|
||||||
C:ID-Switch GmbH, Graf-Adolf-Straße, 40210 Düsseldorf 01051
|
C:ID-Switch GmbH, Graf-Adolf-Straße, 40210 Düsseldorf 01051
|
||||||
# G:18-Nov-1999
|
# G:01-Dec-1999
|
||||||
C:Homepage: http://www.01051.com
|
C:Homepage: http://www.01051.com
|
||||||
C:Adresse: Koenigsallee 60f
|
C:Adresse: Koenigsallee 60f
|
||||||
C: 40210 Duesseldorf
|
C: 40210 Duesseldorf
|
||||||
|
@ -12633,7 +12633,40 @@ T:*/*=0.35/60
|
||||||
Z:246 Polen
|
Z:246 Polen
|
||||||
A:PL
|
A:PL
|
||||||
T:*/*=0.38/60
|
T:*/*=0.38/60
|
||||||
Z:247 impossible
|
Z:247 Russische Förderation
|
||||||
|
A:RU,SU
|
||||||
|
T:*/*=0.55/60
|
||||||
|
Z:248 Bahamas
|
||||||
|
A:BS
|
||||||
|
T:*/*=0.37/60
|
||||||
|
Z:249 Bulgarien
|
||||||
|
A:BG
|
||||||
|
T:*/*=0.62/60
|
||||||
|
Z:250 Lettland
|
||||||
|
A:LV
|
||||||
|
T:*/*=0.64/60
|
||||||
|
Z:251 Litauen
|
||||||
|
A:LT
|
||||||
|
T:*/*=0.57/60
|
||||||
|
Z:252 Malaysia
|
||||||
|
A:MY
|
||||||
|
T:*/*=0.42/60
|
||||||
|
Z:253 Malta
|
||||||
|
A:MT
|
||||||
|
T:*/*=0.44/60
|
||||||
|
Z:254 Moldawien
|
||||||
|
A:MD
|
||||||
|
T:*/*=0.79/60
|
||||||
|
Z:255 Philippinen
|
||||||
|
A:PH
|
||||||
|
T:*/*=0.61/60
|
||||||
|
Z:256 Thailand
|
||||||
|
A:TH
|
||||||
|
T:*/*=0.75/60
|
||||||
|
Z:257 Ukraine
|
||||||
|
A:UA
|
||||||
|
T:*/*=0.75/60
|
||||||
|
Z:258 impossible
|
||||||
A:_ARMF
|
A:_ARMF
|
||||||
A:_AUMF
|
A:_AUMF
|
||||||
A:_BEMF
|
A:_BEMF
|
||||||
|
@ -12660,6 +12693,17 @@ A:_CHMF
|
||||||
A:_ESMF
|
A:_ESMF
|
||||||
A:_TWMF
|
A:_TWMF
|
||||||
A:_VEMF
|
A:_VEMF
|
||||||
|
# A:Russische F”rderation West Mobilfunk, Russische F”rderation Ost Mobilfunk
|
||||||
|
# A:Bahamas Mobilfunk
|
||||||
|
# A:Bulgarien Mobilfunk
|
||||||
|
# A:Lettland Mobilfunk
|
||||||
|
# A:Litauen Mobilfunk
|
||||||
|
# A:Malayisa Mobilfunk
|
||||||
|
# A:Malta Mobilfunk
|
||||||
|
# A:Moldawien Mobilfunk
|
||||||
|
A:_PHMF
|
||||||
|
# A:Thailand Mobilfunk
|
||||||
|
# A:Ukraine Mobilfunk
|
||||||
T:*/*=99.99/60
|
T:*/*=99.99/60
|
||||||
#####################################################################
|
#####################################################################
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
V:1.10-Germany [27-Nov-1999 13:09:30]
|
V:1.10-Germany [01-Dec-1999 18:41:57]
|
||||||
|
|
||||||
# Währungsformat
|
# Währungsformat
|
||||||
U:%.3f DM
|
U:%.3f DM
|
||||||
|
@ -8,7 +8,7 @@ U:%.3f DM
|
||||||
#
|
#
|
||||||
# (C) Copyright 1999 by Andreas Kool (akool@isdn4linux.de)
|
# (C) Copyright 1999 by Andreas Kool (akool@isdn4linux.de)
|
||||||
#
|
#
|
||||||
# $Id: rate-de.dat.src,v 1.14 1999/11/27 19:24:18 akool Exp $
|
# $Id: rate-de.dat.src,v 1.15 1999/12/01 21:47:23 akool Exp $
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Das "A:" Tag muß folgendermaßen gefüllt werden:
|
# Das "A:" Tag muß folgendermaßen gefüllt werden:
|
||||||
|
@ -12472,7 +12472,7 @@ T:*/*=2.3084(60)/1
|
||||||
P:51 01051
|
P:51 01051
|
||||||
B:01051
|
B:01051
|
||||||
C:ID-Switch GmbH, Graf-Adolf-Straße, 40210 Düsseldorf 01051
|
C:ID-Switch GmbH, Graf-Adolf-Straße, 40210 Düsseldorf 01051
|
||||||
# G:18-Nov-1999
|
# G:01-Dec-1999
|
||||||
C:Homepage: http://www.01051.com
|
C:Homepage: http://www.01051.com
|
||||||
C:Adresse: Koenigsallee 60f
|
C:Adresse: Koenigsallee 60f
|
||||||
C: 40210 Duesseldorf
|
C: 40210 Duesseldorf
|
||||||
|
@ -12633,7 +12633,40 @@ T:*/*=0.35/60
|
||||||
Z:246 Polen
|
Z:246 Polen
|
||||||
A:Polen
|
A:Polen
|
||||||
T:*/*=0.38/60
|
T:*/*=0.38/60
|
||||||
Z:247 impossible
|
Z:247 Russische Förderation
|
||||||
|
A:Russische Förderation West, Russische Förderation Ost
|
||||||
|
T:*/*=0.55/60
|
||||||
|
Z:248 Bahamas
|
||||||
|
A:Bahamas
|
||||||
|
T:*/*=0.37/60
|
||||||
|
Z:249 Bulgarien
|
||||||
|
A:Bulgarien
|
||||||
|
T:*/*=0.62/60
|
||||||
|
Z:250 Lettland
|
||||||
|
A:Lettland
|
||||||
|
T:*/*=0.64/60
|
||||||
|
Z:251 Litauen
|
||||||
|
A:Litauen
|
||||||
|
T:*/*=0.57/60
|
||||||
|
Z:252 Malaysia
|
||||||
|
A:Malayisa
|
||||||
|
T:*/*=0.42/60
|
||||||
|
Z:253 Malta
|
||||||
|
A:Malta
|
||||||
|
T:*/*=0.44/60
|
||||||
|
Z:254 Moldawien
|
||||||
|
A:Moldawien
|
||||||
|
T:*/*=0.79/60
|
||||||
|
Z:255 Philippinen
|
||||||
|
A:Philippinen
|
||||||
|
T:*/*=0.61/60
|
||||||
|
Z:256 Thailand
|
||||||
|
A:Thailand
|
||||||
|
T:*/*=0.75/60
|
||||||
|
Z:257 Ukraine
|
||||||
|
A:Ukraine
|
||||||
|
T:*/*=0.75/60
|
||||||
|
Z:258 impossible
|
||||||
A:Argentinien Mobilfunk
|
A:Argentinien Mobilfunk
|
||||||
A:Australien Mobilfunk
|
A:Australien Mobilfunk
|
||||||
A:Belgien Mobilfunk
|
A:Belgien Mobilfunk
|
||||||
|
@ -12660,6 +12693,17 @@ A:Schweiz Mobilfunk
|
||||||
A:Spanien Mobilfunk
|
A:Spanien Mobilfunk
|
||||||
A:Taiwan Mobilfunk
|
A:Taiwan Mobilfunk
|
||||||
A:Venezuela Mobilfunk
|
A:Venezuela Mobilfunk
|
||||||
|
# A:Russische F”rderation West Mobilfunk, Russische F”rderation Ost Mobilfunk
|
||||||
|
# A:Bahamas Mobilfunk
|
||||||
|
# A:Bulgarien Mobilfunk
|
||||||
|
# A:Lettland Mobilfunk
|
||||||
|
# A:Litauen Mobilfunk
|
||||||
|
# A:Malayisa Mobilfunk
|
||||||
|
# A:Malta Mobilfunk
|
||||||
|
# A:Moldawien Mobilfunk
|
||||||
|
A:Philippinen Mobilfunk
|
||||||
|
# A:Thailand Mobilfunk
|
||||||
|
# A:Ukraine Mobilfunk
|
||||||
T:*/*=99.99/60
|
T:*/*=99.99/60
|
||||||
#####################################################################
|
#####################################################################
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,5 +1,16 @@
|
||||||
NEWS for tools: (rate, isdnrate, isdnrep)
|
NEWS for tools: (rate, isdnrate, isdnrep)
|
||||||
|
|
||||||
|
|
||||||
|
1999.11.30
|
||||||
|
isdnrate:
|
||||||
|
new option -s shows services
|
||||||
|
e.g.
|
||||||
|
isdnrate -s Internet
|
||||||
|
|
||||||
|
1999.11.28
|
||||||
|
isdnrate:
|
||||||
|
new option -o shows only booked providers
|
||||||
|
|
||||||
1999.11.08
|
1999.11.08
|
||||||
all utils:
|
all utils:
|
||||||
initRate reads now all provider-variants.
|
initRate reads now all provider-variants.
|
||||||
|
|
|
@ -1,3 +1,39 @@
|
||||||
|
makedest makes a destination database
|
||||||
|
|
||||||
|
usage:
|
||||||
|
makedest [-en] [-a] [-v[2]] [cc ...] [ -cCC file|-]
|
||||||
|
eg.
|
||||||
|
$ makedest at de nl
|
||||||
|
which is the same as
|
||||||
|
$ makedest
|
||||||
|
$ makedest -a at de nl
|
||||||
|
or
|
||||||
|
$ makedest -a -c43 somecodes
|
||||||
|
|
||||||
|
-a ... append country cc to database
|
||||||
|
-en .. write english names for countries
|
||||||
|
-v ... verbose, -v2 warns also for duplicate city names, which can be many
|
||||||
|
-c ... appends file or stdin to country CC (CC may be number or isocode)
|
||||||
|
|
||||||
|
input files:
|
||||||
|
global (de/en) /usr/lib/isdn/country-de.dat
|
||||||
|
|
||||||
|
code-files /usr/lib/isdn/code-CC.dat or ../zone/CC/code
|
||||||
|
where CC is the given countrycode
|
||||||
|
code-files (and input for stdin) consists of lines
|
||||||
|
number\tcity[\tlen of prefix]
|
||||||
|
|
||||||
|
outputfile dest.gdbm is written to current directory and shoud be
|
||||||
|
installed to desired destination.
|
||||||
|
|
||||||
|
Troubleshooting:
|
||||||
|
|
||||||
|
Jochen Erwied reported that he had troubles building the destination database
|
||||||
|
(a empty dest.gdbm was built).
|
||||||
|
After updateing from perl 5.004_04 to 5.005_02 everything worked fine.
|
||||||
|
|
||||||
|
Author: Leopold Toetsch <lt@toetsch.at>
|
||||||
|
Licence: GPL
|
||||||
makedest makes a destination database
|
makedest makes a destination database
|
||||||
|
|
||||||
usage:
|
usage:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: isdnrate.c,v 1.25 1999/11/08 21:09:41 akool Exp $
|
/* $Id: isdnrate.c,v 1.26 1999/12/01 21:47:25 akool Exp $
|
||||||
|
|
||||||
* ISDN accounting for isdn4linux. (rate evaluation)
|
* ISDN accounting for isdn4linux. (rate evaluation)
|
||||||
*
|
*
|
||||||
|
@ -19,6 +19,31 @@
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*
|
*
|
||||||
* $Log: isdnrate.c,v $
|
* $Log: isdnrate.c,v $
|
||||||
|
* Revision 1.26 1999/12/01 21:47:25 akool
|
||||||
|
* isdnlog-3.72
|
||||||
|
* - new rates for 01051
|
||||||
|
* - next version of isdnbill
|
||||||
|
*
|
||||||
|
* - isdnlog/tools/telnum.c ... cleanup
|
||||||
|
* - isdnlog/tools/isdnrate.c ... -s Service
|
||||||
|
* - isdnlog/tools/rate.{c,h} ... -s
|
||||||
|
* - isdnlog/tools/NEWS ... -s
|
||||||
|
* - doc/isdnrate.man .. updated -o, -s
|
||||||
|
* - doc/rate-files.man ... updated
|
||||||
|
* - isdnlog/tools/dest/README.makedest ... updt.
|
||||||
|
* - isdnlog/isdnlog/isdnlog.8.in .. updt.
|
||||||
|
*
|
||||||
|
* Telrate
|
||||||
|
* - isdnlog/tools/telrate/README-telrate
|
||||||
|
* - isdnlog/tools/telrate/config.in NEW
|
||||||
|
* - isdnlog/tools/telrate/configure NEW
|
||||||
|
* - isdnlog/tools/telrate/Makefile.in NEW
|
||||||
|
* - isdnlog/tools/telrate/index.html.in was index.html
|
||||||
|
* - isdnlog/tools/telrate/info.html.in was info.html
|
||||||
|
* - isdnlog/tools/telrate/telrate.cgi.in was telrate.cgi
|
||||||
|
* - isdnlog/tools/telrate/leo.sample NEW sample config
|
||||||
|
* - isdnlog/tools/telrate/alex.sample NEW sample config
|
||||||
|
*
|
||||||
* Revision 1.25 1999/11/08 21:09:41 akool
|
* Revision 1.25 1999/11/08 21:09:41 akool
|
||||||
* isdnlog-3.65
|
* isdnlog-3.65
|
||||||
* - added "B:" Tag to "rate-xx.dat"
|
* - added "B:" Tag to "rate-xx.dat"
|
||||||
|
@ -128,11 +153,10 @@
|
||||||
static void print_header(void);
|
static void print_header(void);
|
||||||
|
|
||||||
static char *myname, *myshortname;
|
static char *myname, *myshortname;
|
||||||
static char options[] = "ab:d:f:h:l:p:t:v::x:CD::G:HLNS:TUVX::Z";
|
static char options[] = "ab:d:f:h:l:op:st:v::x:CD::G:HLNS:TUVX::Z";
|
||||||
static char usage[] = "%s: usage: %s [ -%s ] Destination ...\n";
|
static char usage[] = "%s: usage: %s [ -%s ] Destination ...\n";
|
||||||
|
|
||||||
static int header = 0, best = MAXPROVIDER, table = 0,
|
static int header = 0, best = MAXPROVIDER, table = 0, explain = 0;
|
||||||
explain = 0;
|
|
||||||
int verbose = 0;
|
int verbose = 0;
|
||||||
static int usestat = 0;
|
static int usestat = 0;
|
||||||
static int duration = LCR_DURATION;
|
static int duration = LCR_DURATION;
|
||||||
|
@ -150,6 +174,8 @@ static char **xproviders = 0; /* excl these */
|
||||||
static int nx_providers = 0;
|
static int nx_providers = 0;
|
||||||
static int xbusiness = 0;
|
static int xbusiness = 0;
|
||||||
static int all = 0;
|
static int all = 0;
|
||||||
|
static int booked = 0;
|
||||||
|
static int service = 0;
|
||||||
|
|
||||||
#define SOCKNAME "/tmp/isdnrate"
|
#define SOCKNAME "/tmp/isdnrate"
|
||||||
static int is_daemon = 0;
|
static int is_daemon = 0;
|
||||||
|
@ -160,7 +186,6 @@ static char sortby;
|
||||||
static int need_dest;
|
static int need_dest;
|
||||||
static int h_param = 0;
|
static int h_param = 0;
|
||||||
static int lcr = 0;
|
static int lcr = 0;
|
||||||
|
|
||||||
static TELNUM srcnum, destnum;
|
static TELNUM srcnum, destnum;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -234,6 +259,7 @@ static void deinit(void)
|
||||||
exitDest();
|
exitDest();
|
||||||
exitHoliday();
|
exitHoliday();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* calc a day/time W | E | H */
|
/* calc a day/time W | E | H */
|
||||||
static void get_day(char d)
|
static void get_day(char d)
|
||||||
{
|
{
|
||||||
|
@ -244,7 +270,6 @@ static void get_day(char d)
|
||||||
tm = localtime(&start); /* now */
|
tm = localtime(&start); /* now */
|
||||||
switch (d) {
|
switch (d) {
|
||||||
case 'W': /* we need a normal weekday, so we take
|
case 'W': /* we need a normal weekday, so we take
|
||||||
|
|
||||||
today and inc. day if today is
|
today and inc. day if today is
|
||||||
holiday */
|
holiday */
|
||||||
what = WORKDAY;
|
what = WORKDAY;
|
||||||
|
@ -292,6 +317,7 @@ static int opts(int argc, char *argv[])
|
||||||
register int c;
|
register int c;
|
||||||
register char *p;
|
register char *p;
|
||||||
int x;
|
int x;
|
||||||
|
|
||||||
h_param = 0;
|
h_param = 0;
|
||||||
|
|
||||||
optind = 0; /* make it repeatable */
|
optind = 0; /* make it repeatable */
|
||||||
|
@ -353,6 +379,14 @@ static int opts(int argc, char *argv[])
|
||||||
duration = strtol(optarg, NIL, 0); /* l wie lt */
|
duration = strtol(optarg, NIL, 0); /* l wie lt */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'o': /* booked only */
|
||||||
|
booked++;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 's': /* service */
|
||||||
|
service++;
|
||||||
|
break;
|
||||||
|
|
||||||
case 't':
|
case 't':
|
||||||
x = strtol(optarg, NIL, 0);
|
x = strtol(optarg, NIL, 0);
|
||||||
if (x > 0)
|
if (x > 0)
|
||||||
|
@ -362,6 +396,7 @@ static int opts(int argc, char *argv[])
|
||||||
case 'x': /* eXclude Poviders */
|
case 'x': /* eXclude Poviders */
|
||||||
{
|
{
|
||||||
char *arg = strdup(optarg);
|
char *arg = strdup(optarg);
|
||||||
|
|
||||||
p = strtok(arg, ",");
|
p = strtok(arg, ",");
|
||||||
while (p) {
|
while (p) {
|
||||||
if (*p == 'B') { /* Business Provider */
|
if (*p == 'B') { /* Business Provider */
|
||||||
|
@ -370,6 +405,7 @@ static int opts(int argc, char *argv[])
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
xproviders = realloc(xproviders, (nx_providers + 1) * sizeof(char *));
|
xproviders = realloc(xproviders, (nx_providers + 1) * sizeof(char *));
|
||||||
|
|
||||||
xproviders[nx_providers] = strdup(p);
|
xproviders[nx_providers] = strdup(p);
|
||||||
p = strtok(0, ",");
|
p = strtok(0, ",");
|
||||||
nx_providers++;
|
nx_providers++;
|
||||||
|
@ -381,6 +417,7 @@ static int opts(int argc, char *argv[])
|
||||||
case 'p': /* Providers ... */
|
case 'p': /* Providers ... */
|
||||||
{
|
{
|
||||||
char *arg = strdup(optarg);
|
char *arg = strdup(optarg);
|
||||||
|
|
||||||
p = strtok(arg, ",");
|
p = strtok(arg, ",");
|
||||||
while (p) {
|
while (p) {
|
||||||
if (*p == 'B') { /* Business Provider */
|
if (*p == 'B') { /* Business Provider */
|
||||||
|
@ -389,6 +426,7 @@ static int opts(int argc, char *argv[])
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
providers = realloc(providers, (n_providers + 1) * sizeof(char *));
|
providers = realloc(providers, (n_providers + 1) * sizeof(char *));
|
||||||
|
|
||||||
providers[n_providers] = strdup(p);
|
providers[n_providers] = strdup(p);
|
||||||
p = strtok(0, ",");
|
p = strtok(0, ",");
|
||||||
n_providers++;
|
n_providers++;
|
||||||
|
@ -495,6 +533,10 @@ static int opts(int argc, char *argv[])
|
||||||
if ((explain == 50 || explain == 51) && header) {
|
if ((explain == 50 || explain == 51) && header) {
|
||||||
print_msg(PRT_V, "Conflicting options, -H ignored\n");
|
print_msg(PRT_V, "Conflicting options, -H ignored\n");
|
||||||
}
|
}
|
||||||
|
if (explain >= 10 && service) {
|
||||||
|
print_msg(PRT_V, "Conflicting options, -s ignored\n");
|
||||||
|
service=0;
|
||||||
|
}
|
||||||
if (argc > optind)
|
if (argc > optind)
|
||||||
return (optind);
|
return (optind);
|
||||||
else
|
else
|
||||||
|
@ -516,8 +558,6 @@ static int compare_name(const void *s1, const void *s2)
|
||||||
return strcasecmp(((SORT *) s1)->name, ((SORT *) s2)->name);
|
return strcasecmp(((SORT *) s1)->name, ((SORT *) s2)->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int compare2(const void *s1, const void *s2)
|
static int compare2(const void *s1, const void *s2)
|
||||||
{
|
{
|
||||||
return (((SORT2 *) s1)->weight < ((SORT2 *) s2)->weight);
|
return (((SORT2 *) s1)->weight < ((SORT2 *) s2)->weight);
|
||||||
|
@ -529,6 +569,9 @@ char *short_explainRate(RATE * Rate)
|
||||||
static char buffer[BUFSIZ];
|
static char buffer[BUFSIZ];
|
||||||
char *p = buffer;
|
char *p = buffer;
|
||||||
|
|
||||||
|
if (service && Rate->dst[1] && *Rate->dst[1])
|
||||||
|
p += sprintf(p, "%s, ", Rate->dst[1]);
|
||||||
|
|
||||||
if (Rate->Zone && *Rate->Zone)
|
if (Rate->Zone && *Rate->Zone)
|
||||||
p += sprintf(p, "%s", Rate->Zone);
|
p += sprintf(p, "%s", Rate->Zone);
|
||||||
else
|
else
|
||||||
|
@ -550,7 +593,6 @@ static char *printrate(RATE * Rate)
|
||||||
{
|
{
|
||||||
static char message[BUFSIZ];
|
static char message[BUFSIZ];
|
||||||
|
|
||||||
|
|
||||||
if (Rate->Basic > 0)
|
if (Rate->Basic > 0)
|
||||||
sprintf(message, "%s + %s/%.4fs = %s + %s/Min (%s)",
|
sprintf(message, "%s + %s/%.4fs = %s + %s/Min (%s)",
|
||||||
printRate(Rate->Basic),
|
printRate(Rate->Basic),
|
||||||
|
@ -640,6 +682,7 @@ static char *takt_str(RATE * Rate)
|
||||||
static inline char *P_EMPTY(char *s)
|
static inline char *P_EMPTY(char *s)
|
||||||
{
|
{
|
||||||
char *p = s;
|
char *p = s;
|
||||||
|
|
||||||
return p ? p : "";
|
return p ? p : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -660,8 +703,12 @@ static int compute(char *num)
|
||||||
} /* if */
|
} /* if */
|
||||||
compare_func = compare;
|
compare_func = compare;
|
||||||
switch (sortby) {
|
switch (sortby) {
|
||||||
case 'v' : compare_func = compare_vbn; break;
|
case 'v':
|
||||||
case 'n' : compare_func = compare_name; break;
|
compare_func = compare_vbn;
|
||||||
|
break;
|
||||||
|
case 'n':
|
||||||
|
compare_func = compare_name;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
buildtime();
|
buildtime();
|
||||||
|
@ -683,8 +730,11 @@ static int compute(char *num)
|
||||||
for (i = low; i <= high; i++) {
|
for (i = low; i <= high; i++) {
|
||||||
int found, p;
|
int found, p;
|
||||||
char *t;
|
char *t;
|
||||||
|
|
||||||
if (ignore[i]) /* Fixme: */
|
if (ignore[i]) /* Fixme: */
|
||||||
continue;
|
continue;
|
||||||
|
if (booked && !isProviderBooked(i))
|
||||||
|
continue;
|
||||||
if (!all && !isProviderValid(i, start))
|
if (!all && !isProviderValid(i, start))
|
||||||
continue;
|
continue;
|
||||||
t = getProvider(i);
|
t = getProvider(i);
|
||||||
|
@ -787,8 +837,10 @@ static int compute(char *num)
|
||||||
}
|
}
|
||||||
else if (explain == 50 || explain == 51) {
|
else if (explain == 50 || explain == 51) {
|
||||||
int fi = 1;
|
int fi = 1;
|
||||||
|
|
||||||
while (getZoneRate(&Rate, explain - 50, fi) == 0) {
|
while (getZoneRate(&Rate, explain - 50, fi) == 0) {
|
||||||
double cpm = Rate.Duration > 0 ? 60 * Rate.Price / Rate.Duration : 99.99;
|
double cpm = Rate.Duration > 0 ? 60 * Rate.Price / Rate.Duration : 99.99;
|
||||||
|
|
||||||
fi = 0;
|
fi = 0;
|
||||||
if (Rate.Price != 99.99)
|
if (Rate.Price != 99.99)
|
||||||
printf("%s%c%s%c%s%c%.2f%c%.2f%c%s\n", prefix2provider(Rate.prefix, prov), DEL,
|
printf("%s%c%s%c%s%c%.2f%c%.2f%c%s\n", prefix2provider(Rate.prefix, prov), DEL,
|
||||||
|
@ -807,6 +859,9 @@ static int compute(char *num)
|
||||||
sort[n].name = Rate.Provider;
|
sort[n].name = Rate.Provider;
|
||||||
switch (explain) {
|
switch (explain) {
|
||||||
case 1:
|
case 1:
|
||||||
|
if (service)
|
||||||
|
sprintf(s, " (%s, %s)", P_EMPTY(Rate.dst[1]), Rate.Zone);
|
||||||
|
else
|
||||||
sprintf(s, " (%s)", Rate.Zone);
|
sprintf(s, " (%s)", Rate.Zone);
|
||||||
sort[n].explain = strdup(s);
|
sort[n].explain = strdup(s);
|
||||||
break;
|
break;
|
||||||
|
@ -849,6 +904,7 @@ static int compute(char *num)
|
||||||
if (lcr) {
|
if (lcr) {
|
||||||
RATE Cheap;
|
RATE Cheap;
|
||||||
int res = getLeastCost(&Rate, &Cheap, 0, -1);
|
int res = getLeastCost(&Rate, &Cheap, 0, -1);
|
||||||
|
|
||||||
if (res != UNKNOWN) {
|
if (res != UNKNOWN) {
|
||||||
sort[n].prefix = Cheap.prefix;
|
sort[n].prefix = Cheap.prefix;
|
||||||
sort[n].rate = Cheap.Charge;
|
sort[n].rate = Cheap.Charge;
|
||||||
|
@ -902,13 +958,11 @@ static void purge(int n)
|
||||||
{
|
{
|
||||||
register int i;
|
register int i;
|
||||||
|
|
||||||
|
|
||||||
for (i = 0; i < n; i++)
|
for (i = 0; i < n; i++)
|
||||||
if (sort[i].explain)
|
if (sort[i].explain)
|
||||||
free(sort[i].explain);
|
free(sort[i].explain);
|
||||||
} /* purge */
|
} /* purge */
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Werktag
|
Werktag
|
||||||
Wochenende
|
Wochenende
|
||||||
|
@ -938,7 +992,6 @@ static void printTable(char *num)
|
||||||
memset(hours, 0, sizeof(hours));
|
memset(hours, 0, sizeof(hours));
|
||||||
memset(weight, 0, sizeof(weight));
|
memset(weight, 0, sizeof(weight));
|
||||||
|
|
||||||
|
|
||||||
for (d = 0; d < 2; d++) {
|
for (d = 0; d < 2; d++) {
|
||||||
last[0].prefix = UNKNOWN;
|
last[0].prefix = UNKNOWN;
|
||||||
lasthour = UNKNOWN;
|
lasthour = UNKNOWN;
|
||||||
|
@ -964,7 +1017,8 @@ static void printTable(char *num)
|
||||||
first = 1;
|
first = 1;
|
||||||
while (1) {
|
while (1) {
|
||||||
destnum.nprovider = UNKNOWN;
|
destnum.nprovider = UNKNOWN;
|
||||||
if(provider2prefix(num, &prefix)) /* set provider if it is in number */
|
if (provider2prefix(num, &prefix)) /* set provider if it
|
||||||
|
is in number */
|
||||||
normalizeNumber(num, &destnum, TN_PROVIDER);
|
normalizeNumber(num, &destnum, TN_PROVIDER);
|
||||||
n = compute(num);
|
n = compute(num);
|
||||||
|
|
||||||
|
@ -1140,87 +1194,60 @@ static void clean_up()
|
||||||
need_dest = 1;
|
need_dest = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
static void viacode(char *target, TELNUM *destnum)
|
|
||||||
{
|
|
||||||
register char *p, *p1;
|
|
||||||
auto FILE *fi = fopen("/usr/lib/isdn/code-de.dat", "r");
|
|
||||||
auto char s[BUFSIZ];
|
|
||||||
|
|
||||||
|
|
||||||
if (fi != (FILE *)NULL) {
|
|
||||||
while (fgets(s, BUFSIZ, fi)) {
|
|
||||||
if ((p = strchr(s, '\n'))) {
|
|
||||||
|
|
||||||
*p-- = 0;
|
|
||||||
|
|
||||||
while ((p > s) && !isblank(*p))
|
|
||||||
p--;
|
|
||||||
|
|
||||||
if (p > s) {
|
|
||||||
if (!strcasecmp(p + 1, target)) {
|
|
||||||
p1 = s;
|
|
||||||
|
|
||||||
while (!isblank(*p1))
|
|
||||||
p1++;
|
|
||||||
|
|
||||||
*p1 = 0;
|
|
||||||
|
|
||||||
sprintf(destnum->msn, "0%s", s);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} /* if */
|
|
||||||
} /* if */
|
|
||||||
} /* while */
|
|
||||||
|
|
||||||
fclose(fi);
|
|
||||||
} /* if */
|
|
||||||
} /* viacode */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
static void doit(int i, int argc, char *argv[])
|
static void doit(int i, int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
int prefix;
|
int prefix;
|
||||||
|
char *num;
|
||||||
|
|
||||||
post_init();
|
post_init();
|
||||||
memset(ignore, 0, sizeof(ignore));
|
memset(ignore, 0, sizeof(ignore));
|
||||||
if (!need_dest && i == 0) {
|
if (!need_dest && i == 0) {
|
||||||
i=0; argc=1;
|
i = 0;
|
||||||
|
argc = 1;
|
||||||
argv[0] = "2345";
|
argv[0] = "2345";
|
||||||
}
|
}
|
||||||
while (i < argc) {
|
while (i < argc) {
|
||||||
|
num = argv[i];
|
||||||
if (explain == 55) {
|
if (explain == 55) {
|
||||||
if (n_providers) {
|
if (n_providers) {
|
||||||
destnum.nprovider = pnum2prefix_variant(providers[0], 0);
|
destnum.nprovider = pnum2prefix_variant(providers[0], 0);
|
||||||
Strncpy(destnum.provider, getProvider(destnum.nprovider), TN_MAX_PROVIDER_LEN);
|
Strncpy(destnum.provider, getProvider(destnum.nprovider), TN_MAX_PROVIDER_LEN);
|
||||||
normalizeNumber(argv[i], &destnum, TN_NO_PROVIDER);
|
normalizeNumber(num, &destnum, TN_NO_PROVIDER);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
normalizeNumber(argv[i], &destnum, TN_ALL);
|
normalizeNumber(num, &destnum, TN_ALL);
|
||||||
printf("%s => %s \n",argv[i],formatNumber("%l - %p",&destnum));
|
printf("%s => %s \n", num, formatNumber("%l - %p", &destnum));
|
||||||
i++;
|
i++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (service) {
|
||||||
|
num = getServiceNum(num);
|
||||||
|
if (!num || !*num) {
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
do {
|
||||||
destnum.nprovider = UNKNOWN;
|
destnum.nprovider = UNKNOWN;
|
||||||
if(provider2prefix(argv[i], &prefix)) /* set provider if it is in number */
|
if (provider2prefix(num, &prefix)) /* set provider if it
|
||||||
normalizeNumber(argv[i], &destnum, TN_PROVIDER);
|
is in number */
|
||||||
#if 0
|
normalizeNumber(num, &destnum, TN_PROVIDER);
|
||||||
if (isalpha(*destnum.msn))
|
|
||||||
viacode(argv[i], &destnum);
|
|
||||||
#endif
|
|
||||||
if (table)
|
if (table)
|
||||||
printTable(argv[i]);
|
printTable(num);
|
||||||
else {
|
else {
|
||||||
n = compute(argv[i]);
|
n = compute(num);
|
||||||
if (list)
|
if (list)
|
||||||
printList(n);
|
printList(n);
|
||||||
else if (explain < 10)
|
else if (explain < 10)
|
||||||
result(n);
|
result(n);
|
||||||
purge(n);
|
purge(n);
|
||||||
}
|
}
|
||||||
|
if (service)
|
||||||
|
num = getServiceNum(0);
|
||||||
|
else
|
||||||
|
num = 0;
|
||||||
|
} while (num && *num);
|
||||||
i++;
|
i++;
|
||||||
} /* while */
|
} /* while */
|
||||||
clean_up();
|
clean_up();
|
||||||
|
@ -1436,7 +1463,6 @@ static int connect_2_daemon(int argc, char *argv[])
|
||||||
break;
|
break;
|
||||||
case 'D':
|
case 'D':
|
||||||
if (optarg && atoi(optarg) == 3) ; /* goon, kill a running
|
if (optarg && atoi(optarg) == 3) ; /* goon, kill a running
|
||||||
|
|
||||||
daemon */
|
daemon */
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
|
@ -1499,7 +1525,9 @@ int main(int argc, char *argv[], char *envp[])
|
||||||
print_msg(PRT_A, "\t-f areacode\tyou are calling from <areacode>\n");
|
print_msg(PRT_A, "\t-f areacode\tyou are calling from <areacode>\n");
|
||||||
print_msg(PRT_A, "\t-h h[:m[:s]]\tstart time of call (default now)\n");
|
print_msg(PRT_A, "\t-h h[:m[:s]]\tstart time of call (default now)\n");
|
||||||
print_msg(PRT_A, "\t-l duration\tduration of call in seconds (default %d seconds)\n", LCR_DURATION);
|
print_msg(PRT_A, "\t-l duration\tduration of call in seconds (default %d seconds)\n", LCR_DURATION);
|
||||||
|
print_msg(PRT_A, "\t-o \t show only booked providers\n");
|
||||||
print_msg(PRT_A, "\t-p prov|B[,prov...]\t show only these providers\n");
|
print_msg(PRT_A, "\t-p prov|B[,prov...]\t show only these providers\n");
|
||||||
|
print_msg(PRT_A, "\t-s \t consider 'Destination' as a service name\n");
|
||||||
print_msg(PRT_A, "\t-t takt\t\tshow providers if chargeduration<=takt\n");
|
print_msg(PRT_A, "\t-t takt\t\tshow providers if chargeduration<=takt\n");
|
||||||
print_msg(PRT_A, "\t-v [level]\tverbose\n");
|
print_msg(PRT_A, "\t-v [level]\tverbose\n");
|
||||||
print_msg(PRT_A, "\t-x prov|B[,prov...]\t exclude these providers\n");
|
print_msg(PRT_A, "\t-x prov|B[,prov...]\t exclude these providers\n");
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: rate.c,v 1.64 1999/11/28 19:32:42 akool Exp $
|
/* $Id: rate.c,v 1.65 1999/12/01 21:47:25 akool Exp $
|
||||||
*
|
*
|
||||||
* Tarifdatenbank
|
* Tarifdatenbank
|
||||||
*
|
*
|
||||||
|
@ -19,6 +19,31 @@
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*
|
*
|
||||||
* $Log: rate.c,v $
|
* $Log: rate.c,v $
|
||||||
|
* Revision 1.65 1999/12/01 21:47:25 akool
|
||||||
|
* isdnlog-3.72
|
||||||
|
* - new rates for 01051
|
||||||
|
* - next version of isdnbill
|
||||||
|
*
|
||||||
|
* - isdnlog/tools/telnum.c ... cleanup
|
||||||
|
* - isdnlog/tools/isdnrate.c ... -s Service
|
||||||
|
* - isdnlog/tools/rate.{c,h} ... -s
|
||||||
|
* - isdnlog/tools/NEWS ... -s
|
||||||
|
* - doc/isdnrate.man .. updated -o, -s
|
||||||
|
* - doc/rate-files.man ... updated
|
||||||
|
* - isdnlog/tools/dest/README.makedest ... updt.
|
||||||
|
* - isdnlog/isdnlog/isdnlog.8.in .. updt.
|
||||||
|
*
|
||||||
|
* Telrate
|
||||||
|
* - isdnlog/tools/telrate/README-telrate
|
||||||
|
* - isdnlog/tools/telrate/config.in NEW
|
||||||
|
* - isdnlog/tools/telrate/configure NEW
|
||||||
|
* - isdnlog/tools/telrate/Makefile.in NEW
|
||||||
|
* - isdnlog/tools/telrate/index.html.in was index.html
|
||||||
|
* - isdnlog/tools/telrate/info.html.in was info.html
|
||||||
|
* - isdnlog/tools/telrate/telrate.cgi.in was telrate.cgi
|
||||||
|
* - isdnlog/tools/telrate/leo.sample NEW sample config
|
||||||
|
* - isdnlog/tools/telrate/alex.sample NEW sample config
|
||||||
|
*
|
||||||
* Revision 1.64 1999/11/28 19:32:42 akool
|
* Revision 1.64 1999/11/28 19:32:42 akool
|
||||||
* isdnlog-3.71
|
* isdnlog-3.71
|
||||||
*
|
*
|
||||||
|
@ -398,6 +423,11 @@
|
||||||
* char *getSpecialName(char *number)
|
* char *getSpecialName(char *number)
|
||||||
* get the Service Name of a special number
|
* get the Service Name of a special number
|
||||||
*
|
*
|
||||||
|
* char *getServiceNum(char *name)
|
||||||
|
* returns the first Tel-Number for Service 'name',
|
||||||
|
* call it with name=NULL to get the next number
|
||||||
|
* returns NULL if no mor numbers
|
||||||
|
*
|
||||||
* void clearRate (RATE *Rate)
|
* void clearRate (RATE *Rate)
|
||||||
* setzt alle Felder von *Rate zurück
|
* setzt alle Felder von *Rate zurück
|
||||||
*
|
*
|
||||||
|
@ -440,6 +470,9 @@
|
||||||
* int isProviderValid(int prefix, time_t when)
|
* int isProviderValid(int prefix, time_t when)
|
||||||
* returns true, if the G:tag entries match when
|
* returns true, if the G:tag entries match when
|
||||||
*
|
*
|
||||||
|
* inline int isProviderBooked( int prefix)
|
||||||
|
* returns true if Provider is booked (i.e. listed int rate.conf)
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _RATE_C_
|
#define _RATE_C_
|
||||||
|
@ -788,6 +821,10 @@ inline int getNProvider( void ) {
|
||||||
return nProvider;
|
return nProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline int isProviderBooked( int i) {
|
||||||
|
return Provider[i].booked;
|
||||||
|
}
|
||||||
|
|
||||||
int isProviderValid(int i, time_t when)
|
int isProviderValid(int i, time_t when)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
|
@ -1592,6 +1629,24 @@ char *getSpecialName(char *number) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *getServiceNum(char *name) {
|
||||||
|
static int serv, cod;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if(name && *name) {
|
||||||
|
for (i=0; i<nService; i++)
|
||||||
|
if(strcmp(name, Service[i].Name) == 0) {
|
||||||
|
serv=i;
|
||||||
|
cod=0;
|
||||||
|
return Service[i].Codes[0];
|
||||||
|
}
|
||||||
|
return NULL; /* Unknown Service */
|
||||||
|
}
|
||||||
|
if(++cod < Service[serv].nCode)
|
||||||
|
return Service[serv].Codes[cod];
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
void clearRate (RATE *Rate)
|
void clearRate (RATE *Rate)
|
||||||
{
|
{
|
||||||
memset (Rate, 0, sizeof(RATE));
|
memset (Rate, 0, sizeof(RATE));
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: rate.h,v 1.16 1999/11/25 22:58:40 akool Exp $
|
/* $Id: rate.h,v 1.17 1999/12/01 21:47:25 akool Exp $
|
||||||
*
|
*
|
||||||
* Tarifdatenbank
|
* Tarifdatenbank
|
||||||
*
|
*
|
||||||
|
@ -19,6 +19,31 @@
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*
|
*
|
||||||
* $Log: rate.h,v $
|
* $Log: rate.h,v $
|
||||||
|
* Revision 1.17 1999/12/01 21:47:25 akool
|
||||||
|
* isdnlog-3.72
|
||||||
|
* - new rates for 01051
|
||||||
|
* - next version of isdnbill
|
||||||
|
*
|
||||||
|
* - isdnlog/tools/telnum.c ... cleanup
|
||||||
|
* - isdnlog/tools/isdnrate.c ... -s Service
|
||||||
|
* - isdnlog/tools/rate.{c,h} ... -s
|
||||||
|
* - isdnlog/tools/NEWS ... -s
|
||||||
|
* - doc/isdnrate.man .. updated -o, -s
|
||||||
|
* - doc/rate-files.man ... updated
|
||||||
|
* - isdnlog/tools/dest/README.makedest ... updt.
|
||||||
|
* - isdnlog/isdnlog/isdnlog.8.in .. updt.
|
||||||
|
*
|
||||||
|
* Telrate
|
||||||
|
* - isdnlog/tools/telrate/README-telrate
|
||||||
|
* - isdnlog/tools/telrate/config.in NEW
|
||||||
|
* - isdnlog/tools/telrate/configure NEW
|
||||||
|
* - isdnlog/tools/telrate/Makefile.in NEW
|
||||||
|
* - isdnlog/tools/telrate/index.html.in was index.html
|
||||||
|
* - isdnlog/tools/telrate/info.html.in was info.html
|
||||||
|
* - isdnlog/tools/telrate/telrate.cgi.in was telrate.cgi
|
||||||
|
* - isdnlog/tools/telrate/leo.sample NEW sample config
|
||||||
|
* - isdnlog/tools/telrate/alex.sample NEW sample config
|
||||||
|
*
|
||||||
* Revision 1.16 1999/11/25 22:58:40 akool
|
* Revision 1.16 1999/11/25 22:58:40 akool
|
||||||
* isdnlog-3.68
|
* isdnlog-3.68
|
||||||
* - new utility "isdnbill" added
|
* - new utility "isdnbill" added
|
||||||
|
@ -187,6 +212,7 @@ int initRate(char *conf, char *dat, char *dom, char **msg);
|
||||||
char *getProvider(int prefix);
|
char *getProvider(int prefix);
|
||||||
int getSpecial(char *number);
|
int getSpecial(char *number);
|
||||||
char* getSpecialName(char *number);
|
char* getSpecialName(char *number);
|
||||||
|
char *getServiceNum(char *name);
|
||||||
char *getComment(int prefix, char *key);
|
char *getComment(int prefix, char *key);
|
||||||
void clearRate (RATE *Rate);
|
void clearRate (RATE *Rate);
|
||||||
int getRate(RATE *Rate, char **msg);
|
int getRate(RATE *Rate, char **msg);
|
||||||
|
@ -202,4 +228,5 @@ inline int getNProvider( void );
|
||||||
/* char *prefix2provider(int prefix, char *s) is defined in telnum.h */
|
/* char *prefix2provider(int prefix, char *s) is defined in telnum.h */
|
||||||
char *prefix2provider_variant(int prefix, char *s);
|
char *prefix2provider_variant(int prefix, char *s);
|
||||||
int isProviderValid(int prefix, time_t when);
|
int isProviderValid(int prefix, time_t when);
|
||||||
|
inline int isProviderBooked( int i);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -131,13 +131,6 @@ void initTelNum(void)
|
||||||
_init();
|
_init();
|
||||||
} /* pre_init */
|
} /* pre_init */
|
||||||
|
|
||||||
#ifndef STANDALONE
|
|
||||||
static inline int Isspace(c)
|
|
||||||
{
|
|
||||||
return isspace(c) || c == '_';
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int split_vbn(char **p, TELNUM * num)
|
static int split_vbn(char **p, TELNUM * num)
|
||||||
{
|
{
|
||||||
int l;
|
int l;
|
||||||
|
@ -177,8 +170,8 @@ int normalizeNumber(char *target, TELNUM * num, int flag)
|
||||||
#endif
|
#endif
|
||||||
if (flag & TN_PROVIDER)
|
if (flag & TN_PROVIDER)
|
||||||
if (!split_vbn(&p, num)) {
|
if (!split_vbn(&p, num)) {
|
||||||
num->nprovider = preselect;
|
num->nprovider = pnum2prefix(preselect,0);
|
||||||
Strncpy(num->provider, getProvider(preselect), TN_MAX_PROVIDER_LEN);
|
Strncpy(num->provider, getProvider(num->nprovider), TN_MAX_PROVIDER_LEN);
|
||||||
}
|
}
|
||||||
if (flag & TN_COUNTRY) {
|
if (flag & TN_COUNTRY) {
|
||||||
/* subst '00' => '+' */
|
/* subst '00' => '+' */
|
||||||
|
@ -288,23 +281,20 @@ static void _init(void)
|
||||||
{
|
{
|
||||||
char *s;
|
char *s;
|
||||||
|
|
||||||
clearNum(&defnum);
|
//clearNum(&defnum);
|
||||||
Strncpy(defnum.area, myarea, TN_MAX_AREA_LEN);
|
Strncpy(defnum.area, myarea, TN_MAX_AREA_LEN);
|
||||||
s = malloc(strlen(mycountry) + strlen(myarea) + 1);
|
s = malloc(strlen(mycountry) + strlen(myarea) + 1);
|
||||||
strcpy(s, mycountry);
|
strcpy(s, mycountry);
|
||||||
strcat(s, myarea);
|
strcat(s, myarea);
|
||||||
getDest(s, &defnum);
|
getDest(s, &defnum);
|
||||||
Strncpy(defnum.vbn, vbn, TN_MAX_VBN_LEN);
|
Strncpy(defnum.vbn, vbn, TN_MAX_VBN_LEN);
|
||||||
|
defnum.nprovider=pnum2prefix(preselect,0);
|
||||||
|
Strncpy(defnum.provider, getProvider(defnum.nprovider), TN_MAX_PROVIDER_LEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearNum(TELNUM * num)
|
void clearNum(TELNUM * num)
|
||||||
{
|
{
|
||||||
/* num->nprovider=UNKNOWN;
|
memcpy(num, &defnum, sizeof(TELNUM));
|
||||||
strcpy(num->provider,""); */
|
|
||||||
strcpy(num->area, "");
|
|
||||||
initNum(num);
|
|
||||||
strcpy(num->msn, "");
|
|
||||||
Strncpy(num->vbn, vbn, TN_MAX_VBN_LEN);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* %Np .. Provider
|
/* %Np .. Provider
|
||||||
|
|
|
@ -11,7 +11,10 @@ Installation
|
||||||
|
|
||||||
$ ./configure
|
$ ./configure
|
||||||
# make install
|
# make install
|
||||||
(Sorry n/y)
|
|
||||||
|
run ./configure to get a list of default options, you may override them, as
|
||||||
|
./configure --cc ch --gifpng png ...
|
||||||
|
or look at the sample config's alex & leo.
|
||||||
|
|
||||||
|
|
||||||
- Manually
|
- Manually
|
||||||
|
@ -35,7 +38,7 @@ edit telrate.cgi:
|
||||||
|
|
||||||
location of index.html, info.html, pic, (default /telrate/ under htdocs)
|
location of index.html, info.html, pic, (default /telrate/ under htdocs)
|
||||||
|
|
||||||
if your /tmp ist not writable by all users, turn of $use_sockets
|
if your /tmp ist not writable by all users, turn off $use_sockets
|
||||||
or change the location of the unix socket in both isdnrate.c and telrate.cgi.
|
or change the location of the unix socket in both isdnrate.c and telrate.cgi.
|
||||||
|
|
||||||
make a tmp dir below htdocs
|
make a tmp dir below htdocs
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<HTML>
|
<HTML>
|
||||||
|
|
||||||
<HEAD>
|
<HEAD>
|
||||||
<TITLE>Tel-R.at - Telefonkosten</TITLE>
|
<TITLE>@TITLE@ - Telefonkosten</TITLE>
|
||||||
<SCRIPT LANGUAGE="JavaScript">
|
<SCRIPT LANGUAGE="JavaScript">
|
||||||
<!--
|
<!--
|
||||||
NS4 = document.layers ? 1 : 0;
|
NS4 = document.layers ? 1 : 0;
|
||||||
|
@ -42,7 +42,7 @@ p,td,th,body { font-family:Sans Serif,Arial }
|
||||||
</HEAD>
|
</HEAD>
|
||||||
|
|
||||||
<BODY BGCOLOR="#ffffe0">
|
<BODY BGCOLOR="#ffffe0">
|
||||||
<H1 ALIGN="center">Tel-R.at - Telefonkosten</H1>
|
<H1 ALIGN="center">@TITLE@ - Telefonkosten</H1>
|
||||||
<P><I>Wieviel</I> kostet ein <I>wie</I> langes Telefongespräch von <I>wo</I> <I>wohin</I> um <I>welche</I> Zeit mit
|
<P><I>Wieviel</I> kostet ein <I>wie</I> langes Telefongespräch von <I>wo</I> <I>wohin</I> um <I>welche</I> Zeit mit
|
||||||
<I>welchem</I> Telefonprovider und <I>warum</I> eigentlich? <I>Wie</I> teuer kommt mir ein bestimmter Gesprächsmix
|
<I>welchem</I> Telefonprovider und <I>warum</I> eigentlich? <I>Wie</I> teuer kommt mir ein bestimmter Gesprächsmix
|
||||||
zu verschiedenen Zielen? Und <I>wenn</I> man die Gebühren dazurechnet, <I>was</I> kostet es dann?</P>
|
zu verschiedenen Zielen? Und <I>wenn</I> man die Gebühren dazurechnet, <I>was</I> kostet es dann?</P>
|
||||||
|
@ -50,11 +50,11 @@ zu verschiedenen Zielen? Und <I>wenn</I> man die Gebühren dazurechnet, <I>w
|
||||||
Das und vieles mehr erfahren Sie hier, übersichtlich aufbereitet in Tabellen und Grafiken.</P>
|
Das und vieles mehr erfahren Sie hier, übersichtlich aufbereitet in Tabellen und Grafiken.</P>
|
||||||
<BLOCKQUOTE><TABLE>
|
<BLOCKQUOTE><TABLE>
|
||||||
<TR>
|
<TR>
|
||||||
<TD ALIGN="right"> <A HREF="/perl/telrate.cgi" ONMOUSEOVER="swap('eg',1)"
|
<TD ALIGN="right"> <A HREF="/@CGIBIN@/telrate.cgi" ONMOUSEOVER="swap('eg',1)"
|
||||||
ONMOUSEOUT="swap('eg',0)"><B>Einzelgespräche</B></A><A HREF="/perl/telrate.cgi"
|
ONMOUSEOUT="swap('eg',0)"><B>Einzelgespräche</B></A><A HREF="/@CGIBIN@/telrate.cgi"
|
||||||
ONMOUSEOVER="swap('eg',1)" ONMOUSEOUT="swap('eg',0)"><IMG SRC="eg0.jpg" ALT="Einzelgespräch" BORDER="0" WIDTH="80"
|
ONMOUSEOVER="swap('eg',1)" ONMOUSEOUT="swap('eg',0)"><IMG SRC="eg0.jpg" ALT="Einzelgespräch" BORDER="0" WIDTH="80"
|
||||||
HEIGHT="40" NAME="eg" HSPACE="10"></A></TD>
|
HEIGHT="40" NAME="eg" HSPACE="10"></A></TD>
|
||||||
<TD ROWSPAN="2"><A HREF="/perl/telrate.cgi" ONMOUSEOVER="swap('eg',1)" ONMOUSEOUT="swap('eg',0)"><IMG SRC="graf.gif"
|
<TD ROWSPAN="2"><A HREF="/@CGIBIN@/telrate.cgi" ONMOUSEOVER="swap('eg',1)" ONMOUSEOUT="swap('eg',0)"><IMG SRC="graf.gif"
|
||||||
BORDER="0" HSPACE="40" ALT="Grafik Einzelgesprächskosten" WIDTH="226" HEIGHT="110"></A> </TD>
|
BORDER="0" HSPACE="40" ALT="Grafik Einzelgesprächskosten" WIDTH="226" HEIGHT="110"></A> </TD>
|
||||||
<TD ALIGN="left"> <A HREF="info.html" ONMOUSEOVER="swap('info',1)" ONMOUSEOUT="swap('info',0)"><IMG
|
<TD ALIGN="left"> <A HREF="info.html" ONMOUSEOVER="swap('info',1)" ONMOUSEOUT="swap('info',0)"><IMG
|
||||||
SRC="info0.jpg" ALT="Info" BORDER="0" WIDTH="80" HEIGHT="40" NAME="info" HSPACE="10"></A><A HREF="info.html"
|
SRC="info0.jpg" ALT="Info" BORDER="0" WIDTH="80" HEIGHT="40" NAME="info" HSPACE="10"></A><A HREF="info.html"
|
||||||
|
@ -62,12 +62,12 @@ ONMOUSEOVER="swap('info',1)" ONMOUSEOUT="swap('info',0)"><B>Info / Hilfe</B></A>
|
||||||
</TR>
|
</TR>
|
||||||
<TR>
|
<TR>
|
||||||
<TD ALIGN="right" VALIGN="MIDDLE">
|
<TD ALIGN="right" VALIGN="MIDDLE">
|
||||||
<A HREF="/perl/telrate.cgi?mix=10" ONMOUSEOUT="swap('gm',false)"
|
<A HREF="/@CGIBIN@/telrate.cgi?mix=10" ONMOUSEOUT="swap('gm',false)"
|
||||||
ONMOUSEOVER="swap('gm',true)"><B>Gesprächsmix</B></A><A HREF="/perl/telrate.cgi?mix=10" ONMOUSEOUT="swap('gm',false)"
|
ONMOUSEOVER="swap('gm',true)"><B>Gesprächsmix</B></A><A HREF="/@CGIBIN@/telrate.cgi?mix=10" ONMOUSEOUT="swap('gm',false)"
|
||||||
ONMOUSEOVER="swap('gm',true)"><IMG SRC="gm0.jpg" ALT="Gesprächsmix" BORDER="0" WIDTH="80" HEIGHT="40" NAME="gm"
|
ONMOUSEOVER="swap('gm',true)"><IMG SRC="gm0.jpg" ALT="Gesprächsmix" BORDER="0" WIDTH="80" HEIGHT="40" NAME="gm"
|
||||||
HSPACE="10"></A> </TD>
|
HSPACE="10"></A> </TD>
|
||||||
<TD ALIGN="left"> <A HREF="/perl/telrate.cgi?list=1" ONMOUSEOVER="swap('list',1)" ONMOUSEOUT="swap('list',0)"><IMG
|
<TD ALIGN="left"> <A HREF="/@CGIBIN@/telrate.cgi?list=1" ONMOUSEOVER="swap('list',1)" ONMOUSEOUT="swap('list',0)"><IMG
|
||||||
SRC="list0.jpg" ALT="Providerliste" BORDER="0" WIDTH="80" HEIGHT="40" NAME="list" HSPACE="10"></A><A HREF="/perl/telrate.cgi?list=1"
|
SRC="list0.jpg" ALT="Providerliste" BORDER="0" WIDTH="80" HEIGHT="40" NAME="list" HSPACE="10"></A><A HREF="/@CGIBIN@/telrate.cgi?list=1"
|
||||||
ONMOUSEOVER="swap('list',1)" ONMOUSEOUT="swap('list',0)"><B>Providerliste</B></A> </TD></TR>
|
ONMOUSEOVER="swap('list',1)" ONMOUSEOUT="swap('list',0)"><B>Providerliste</B></A> </TD></TR>
|
||||||
</TABLE>
|
</TABLE>
|
||||||
</BLOCKQUOTE>
|
</BLOCKQUOTE>
|
|
@ -4,7 +4,7 @@
|
||||||
<!-- -*-html_mode-*- -->
|
<!-- -*-html_mode-*- -->
|
||||||
|
|
||||||
<HEAD>
|
<HEAD>
|
||||||
<TITLE>Tel-R.at - Info</TITLE>
|
<TITLE>@TITLE@ - Info</TITLE>
|
||||||
<script language="JavaScript">
|
<script language="JavaScript">
|
||||||
<!--
|
<!--
|
||||||
NS4 = document.layers ? 1 : 0;
|
NS4 = document.layers ? 1 : 0;
|
||||||
|
@ -43,7 +43,7 @@ h2,h3,h4,p,td,th,body { font-family:Sans Serif,Arial }
|
||||||
</HEAD>
|
</HEAD>
|
||||||
|
|
||||||
<BODY BGCOLOR="#ffffe0">
|
<BODY BGCOLOR="#ffffe0">
|
||||||
<H1 ALIGN="center">Tel-R.at - Info</H1>
|
<H1 ALIGN="center">@TITLE@ - Info</H1>
|
||||||
<UL>
|
<UL>
|
||||||
<LI><A HREF="#allg">Allgemein</A> </LI>
|
<LI><A HREF="#allg">Allgemein</A> </LI>
|
||||||
<LI><A HREF="#help">Hilfe</A> </LI>
|
<LI><A HREF="#help">Hilfe</A> </LI>
|
||||||
|
@ -76,7 +76,7 @@ gewünschten Zieles, alle anderen Felder haben eine Standardeinstellung.<BR>
|
||||||
Sollten Sie weitere Information benötigen, klicken Sie einfach auf das<IMG SRC="help.gif" HSPACE="4"
|
Sollten Sie weitere Information benötigen, klicken Sie einfach auf das<IMG SRC="help.gif" HSPACE="4"
|
||||||
ALIGN="middle" ALT="Fragezeichen" WIDTH="24" HEIGHT="24"> neben dem fraglichen Feld.</P>
|
ALIGN="middle" ALT="Fragezeichen" WIDTH="24" HEIGHT="24"> neben dem fraglichen Feld.</P>
|
||||||
<P><span class="in">E</span>ine Übersicht über alle Eingabemöglichkeiten erhalten Sie <A
|
<P><span class="in">E</span>ine Übersicht über alle Eingabemöglichkeiten erhalten Sie <A
|
||||||
HREF="/perl/telrate.cgi?help=3">hier</A>. <IMG SRC="hr.gif" WIDTH="600" HEIGHT="4" ALT="-----"> </P>
|
HREF="/@CGIBIN@/telrate.cgi?help=3">hier</A>. <center><IMG SRC="hr.gif" WIDTH="600" HEIGHT="4" ALT="-----"></center> </P>
|
||||||
|
|
||||||
<H2><A NAME="calc">Berechnungsmethode</A></H2>
|
<H2><A NAME="calc">Berechnungsmethode</A></H2>
|
||||||
<P><span class="in">D</span>ie Berechnung der gewünschten Verbindung erfolgt nach dem selben Takt- und Zonenmodell, wie es der jeweilige
|
<P><span class="in">D</span>ie Berechnung der gewünschten Verbindung erfolgt nach dem selben Takt- und Zonenmodell, wie es der jeweilige
|
||||||
|
@ -89,7 +89,7 @@ besonders die Zonentabellen sind häufig ein Geheimnis der Firmen.
|
||||||
<BR>Wenn Sie also eine Ungenauigkeit feststellen sollten, teilen Sie <A HREF="#autor">uns</A> das bitte mit. Wir sind
|
<BR>Wenn Sie also eine Ungenauigkeit feststellen sollten, teilen Sie <A HREF="#autor">uns</A> das bitte mit. Wir sind
|
||||||
bemüht, die Daten immer auf dem letzten Stand zu halten, was nebenbei bemerkt durch die Dynamik des Marktes nicht
|
bemüht, die Daten immer auf dem letzten Stand zu halten, was nebenbei bemerkt durch die Dynamik des Marktes nicht
|
||||||
ganz einfach ist.</P>
|
ganz einfach ist.</P>
|
||||||
<P> <IMG SRC="hr.gif" WIDTH="600" HEIGHT="4" ALT="-----"> </P>
|
<P> <center><IMG SRC="hr.gif" WIDTH="600" HEIGHT="4" ALT="-----"></center> </P>
|
||||||
<H2><A NAME="gloss">Glossar</A></H2>
|
<H2><A NAME="gloss">Glossar</A></H2>
|
||||||
<DL>
|
<DL>
|
||||||
<DT><span class="in">D</span>urchschnittlicher Minutenpreis</DT>
|
<DT><span class="in">D</span>urchschnittlicher Minutenpreis</DT>
|
||||||
|
@ -104,7 +104,7 @@ Gesprächslänge. </DD>
|
||||||
wirklichen Kosten überein, wenn 60 durch den Takt ohne Rest teilbar ist. </DD>
|
wirklichen Kosten überein, wenn 60 durch den Takt ohne Rest teilbar ist. </DD>
|
||||||
<DT><span class="in">S</span>chwund</DT>
|
<DT><span class="in">S</span>chwund</DT>
|
||||||
<DD>Die durch die Taktung oder Mindestentgelte verursachte Gesprächsgebühr.
|
<DD>Die durch die Taktung oder Mindestentgelte verursachte Gesprächsgebühr.
|
||||||
<br>Tip: versuchen Sie mal eine <a href ="/perl/telrate.cgi?tel=usa&len=5&now=on&tab=GO&_3D=on">5 Sekunden lange Verbindung in die USA</a> (z.B. es
|
<br>Tip: versuchen Sie mal eine <a href ="/@CGIBIN@/telrate.cgi?tel=usa&len=5&now=on&tab=GO&_3D=on">5 Sekunden lange Verbindung in die USA</a> (z.B. es
|
||||||
meldet sich der Anrufbeantworter und Sie legen auf), ob Sie 30g oder 4 Schilling zahlen,
|
meldet sich der Anrufbeantworter und Sie legen auf), ob Sie 30g oder 4 Schilling zahlen,
|
||||||
ist ein schöner Unterschied, besonders wenn das häufiger passiert.
|
ist ein schöner Unterschied, besonders wenn das häufiger passiert.
|
||||||
<DT><span class="in">T</span>ag / Zeit</DT>
|
<DT><span class="in">T</span>ag / Zeit</DT>
|
||||||
|
@ -114,7 +114,7 @@ ist ein schöner Unterschied, besonders wenn das häufiger passiert.
|
||||||
umso genauer die Abrechnung. <BR>
|
umso genauer die Abrechnung. <BR>
|
||||||
Bei einem Takt von 60 Sekunden und einer durchschnittlichen Gesprächszeit von einer Minute sind die
|
Bei einem Takt von 60 Sekunden und einer durchschnittlichen Gesprächszeit von einer Minute sind die
|
||||||
Gesprächskosten im Schnitt um 50 % höher, als bei sekundengenauer Abrechnung. </DD>
|
Gesprächskosten im Schnitt um 50 % höher, als bei sekundengenauer Abrechnung. </DD>
|
||||||
<br>Tip: versuchen Sie folgenden <a href ="/perl/telrate.cgi?from=01&tel0=01&len0=72&oft0=50&dday0=W&tel1=01&len1=%7E72&oft1=50&dday1=W&tab=Tabelle&mix=10&best=30&takt=9999&_3D=on">Gesprächsmix</a>.
|
<br>Tip: versuchen Sie folgenden <a href ="/@CGIBIN@/telrate.cgi?from=01&tel0=01&len0=72&oft0=50&dday0=W&tel1=01&len1=%7E72&oft1=50&dday1=W&tab=Tabelle&mix=10&best=30&takt=9999&_3D=on">Gesprächsmix</a>.
|
||||||
<DT>Takt 60/1</DT>
|
<DT>Takt 60/1</DT>
|
||||||
<DD>Sie zahlen auf jeden Fall die erste Minute, auch wenn sie kürzer telefonieren, nach der ersten Minute wird
|
<DD>Sie zahlen auf jeden Fall die erste Minute, auch wenn sie kürzer telefonieren, nach der ersten Minute wird
|
||||||
sekundengenau abgerechnet. </DD>
|
sekundengenau abgerechnet. </DD>
|
||||||
|
@ -127,7 +127,7 @@ sekundengenau abgerechnet. </DD>
|
||||||
<DD>Gebiet mit gleichen Gebühren, von Provider zu Provider unterschiedlich. Im Inland verzichten immer mehr
|
<DD>Gebiet mit gleichen Gebühren, von Provider zu Provider unterschiedlich. Im Inland verzichten immer mehr
|
||||||
Provider auf eine Unterteilung in Zonen. </DD>
|
Provider auf eine Unterteilung in Zonen. </DD>
|
||||||
</DL>
|
</DL>
|
||||||
<IMG SRC="hr.gif" WIDTH="600" HEIGHT="4" ALT="-----"> <H2><A NAME="autor">Pfleger der Tarifdaten</A></H2>
|
<center><IMG SRC="hr.gif" WIDTH="600" HEIGHT="4" ALT="-----"></center> <H2><A NAME="autor">Pfleger der Tarifdaten</A></H2>
|
||||||
<H3>Österreich</H3>
|
<H3>Österreich</H3>
|
||||||
<UL>
|
<UL>
|
||||||
<LI><A HREF="mailto:reinelt@eurnet.at">Michael Reinelt</A> </LI>
|
<LI><A HREF="mailto:reinelt@eurnet.at">Michael Reinelt</A> </LI>
|
||||||
|
@ -138,7 +138,7 @@ Provider auf eine Unterteilung in Zonen. </DD>
|
||||||
<UL>
|
<UL>
|
||||||
<LI><A HREF="mailto:joe@mbs.gtn.com">Jochen Erwied</A> </LI>
|
<LI><A HREF="mailto:joe@mbs.gtn.com">Jochen Erwied</A> </LI>
|
||||||
<LI><A HREF="mailto:akool@isdn4linux.de">Andreas Kool</A> </LI>
|
<LI><A HREF="mailto:akool@isdn4linux.de">Andreas Kool</A> </LI>
|
||||||
<LI><A HREF="mailto:awkwar@digitalprojects.com">Alexander Skwar</A> </LI>
|
<LI><A HREF="mailto:ASkwar@DigitalProjects.com">Alexander Skwar</A> </LI>
|
||||||
</UL>
|
</UL>
|
||||||
<H3>Niederlande</H3>
|
<H3>Niederlande</H3>
|
||||||
<UL>
|
<UL>
|
||||||
|
@ -150,16 +150,37 @@ Provider auf eine Unterteilung in Zonen. </DD>
|
||||||
<LI><A HREF="mailto:reinelt@eurnet.at">Michael Reinelt</A> </LI>
|
<LI><A HREF="mailto:reinelt@eurnet.at">Michael Reinelt</A> </LI>
|
||||||
<LI><A HREF="mailto:lt@toetsch.at">Leopold Tötsch</A> </LI>
|
<LI><A HREF="mailto:lt@toetsch.at">Leopold Tötsch</A> </LI>
|
||||||
</UL>
|
</UL>
|
||||||
<IMG SRC="hr.gif" WIDTH="600" HEIGHT="4" ALT="-----">
|
<center><IMG SRC="hr.gif" WIDTH="600" HEIGHT="4" ALT="-----"> </center>
|
||||||
<P>
|
<P>
|
||||||
<A HREF="/telrate/index.html" onmouseover="swap('start',1)" onmouseout="swap('start',0)">Startseite
|
<table width="100%" border=0>
|
||||||
<IMG WIDTH="80" HSPACE="4" HEIGHT="40" BORDER="0" NAME="start" SRC="/telrate/start0.jpg" ALT="Startseite"></A>
|
<tr align="center">
|
||||||
<A HREF="/perl/telrate.cgi" onmouseover="swap('eg',1)" onmouseout="swap('eg',0)">Einzelgespräch
|
<td>
|
||||||
<IMG WIDTH="80" HSPACE="4" HEIGHT="40" BORDER="0" NAME="eg" SRC="/telrate/eg0.jpg" ALT="Einzelgespräch"></A>
|
<A HREF="/telrate/index.html" onmouseover="swap('start',1)" onmouseout="swap('start',0)">
|
||||||
<A HREF="/perl/telrate.cgi?mix=10" onmouseover="swap('gm',1)" onmouseout="swap('gm',0)">Gesprächsmix
|
<IMG WIDTH="80" HSPACE="4" HEIGHT="40" BORDER="0" NAME="start" SRC="/telrate/start0.jpg" ALT="Startseite"><br>
|
||||||
<IMG WIDTH="80" HSPACE="4" HEIGHT="40" BORDER="0" NAME="gm" SRC="/telrate/gm0.jpg" ALT="Gesprächsmix"></A>
|
<font size="-2">Startseite</font>
|
||||||
<A HREF="/perl/telrate.cgi?list=1" onmouseover="swap('list',1)" onmouseout="swap('list',0)">Providerliste
|
</A>
|
||||||
<IMG WIDTH="80" HSPACE="4" HEIGHT="40" BORDER="0" NAME="list" SRC="/telrate/list0.jpg" ALT="Providerliste"></A> </P>
|
</td>
|
||||||
|
<td>
|
||||||
|
<A HREF="/@CGIBIN@/telrate.cgi" onmouseover="swap('eg',1)" onmouseout="swap('eg',0)">
|
||||||
|
<IMG WIDTH="80" HSPACE="4" HEIGHT="40" BORDER="0" NAME="eg" SRC="/telrate/eg0.jpg" ALT="Einzelgespräch"><br>
|
||||||
|
<font size="-2">Einzelgespräch</font>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<A HREF="/@CGIBIN@/telrate.cgi?mix=10" onmouseover="swap('gm',1)" onmouseout="swap('gm',0)">
|
||||||
|
<IMG WIDTH="80" HSPACE="4" HEIGHT="40" BORDER="0" NAME="gm" SRC="/telrate/gm0.jpg" ALT="Gesprächsmix"><br>
|
||||||
|
<font size="-2">Gesprächsmix</font>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<A HREF="/@CGIBIN@/telrate.cgi?list=1" onmouseover="swap('list',1)" onmouseout="swap('list',0)">
|
||||||
|
<IMG WIDTH="80" HSPACE="4" HEIGHT="40" BORDER="0" NAME="list" SRC="/telrate/list0.jpg" ALT="Providerliste"><br>
|
||||||
|
<font size="-2">Providerliste</font>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</P>
|
||||||
</BODY>
|
</BODY>
|
||||||
</HTML>
|
</HTML>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/perl
|
#! @PERL@
|
||||||
#
|
#
|
||||||
# Copyright 1999 by Leopold Toetsch <lt@toetsch.at>
|
# Copyright 1999 by Leopold Toetsch <lt@toetsch.at>
|
||||||
#
|
#
|
||||||
|
@ -12,44 +12,38 @@
|
||||||
# 1.00 1999.08.30
|
# 1.00 1999.08.30
|
||||||
# 1.10 1999.09.04 use GD 1.21 with PNG graphics
|
# 1.10 1999.09.04 use GD 1.21 with PNG graphics
|
||||||
# 1.11 1999.09.06 run's now with mod_perl
|
# 1.11 1999.09.06 run's now with mod_perl
|
||||||
|
# 1.12 1999.11.30 patch from a.s
|
||||||
|
# 1.20 1999.11.30 added configure/install
|
||||||
|
|
||||||
use CGI qw(:standard);
|
use CGI qw(:standard);
|
||||||
use CGI::Carp 'fatalsToBrowser';
|
use CGI::Carp 'fatalsToBrowser';
|
||||||
#use Carp;
|
#use Carp;
|
||||||
#local $SIG{__WARN__} = \&Carp::cluck;
|
#local $SIG{__WARN__} = \&Carp::cluck;
|
||||||
use strict;
|
use strict;
|
||||||
use GD 1.21;
|
use GD @GDVERS@;
|
||||||
use IO::Handle;
|
use IO::Handle;
|
||||||
use vars qw ( $use_sockets $server $MKTEMP $ISDNRATE $CODEF $LOGO $docroot $CC);
|
use vars qw ( $use_sockets $server $MKTEMP $ISDNRATE $CODEF $LOGO $docroot $CC);
|
||||||
use vars qw ($_VBNS $sortv);
|
use vars qw ($_VBNS $sortv);
|
||||||
|
|
||||||
# socket stuff
|
# socket stuff
|
||||||
$use_sockets=1;
|
$use_sockets=@SOCKETS@;
|
||||||
use Socket;
|
use Socket;
|
||||||
|
|
||||||
# path for unix socket
|
# path for unix socket
|
||||||
$server='/tmp/isdnrate';
|
$server='/tmp/isdnrate';
|
||||||
|
|
||||||
# configure adjusts these n/y :-(
|
|
||||||
|
|
||||||
# Country
|
# Country
|
||||||
$CC='de';
|
$CC='@CC@';
|
||||||
$CC='at';
|
|
||||||
|
|
||||||
$CODEF= "/usr/lib/isdn/code-$CC.dat";
|
$CODEF="/usr/lib/isdn/code-" . $CC . ".dat";
|
||||||
$MKTEMP= '/bin/mktemp';
|
$MKTEMP='@MKTEMP@';
|
||||||
$ISDNRATE='/usr/bin/isdnrate';
|
$ISDNRATE='@ISDNRATE@';
|
||||||
|
|
||||||
$LOGO="(c) 1999 www.Tel-R.at";
|
$LOGO="(c) 1999 Leopold Tötsch";
|
||||||
$_VBNS=0;
|
$_VBNS=0;
|
||||||
|
|
||||||
$docroot=$ENV{'DOCUMENT_ROOT'};
|
$docroot=$ENV{'DOCUMENT_ROOT'};
|
||||||
|
|
||||||
#@probe_zones = qw ( 01 01 02245 0732 07667 05574 ); #AT
|
|
||||||
#@probe_zones = qw ( 030 030 03302 033200 089 ); #DE
|
|
||||||
# number of mobil funk with diff charge
|
|
||||||
#@mobil_nums = qw ( 0663 0664 0676 0699 ); #AT
|
|
||||||
|
|
||||||
# rest should be ok
|
# rest should be ok
|
||||||
use vars qw ( $tempdir $tempdir_url $DEFLEN $debug $LEER $DEFBEST );
|
use vars qw ( $tempdir $tempdir_url $DEFLEN $debug $LEER $DEFBEST );
|
||||||
|
|
||||||
|
@ -78,7 +72,7 @@ use subs qw { footer html_header hrg };
|
||||||
# main
|
# main
|
||||||
|
|
||||||
$|=1;
|
$|=1;
|
||||||
$TITLE="Tel-R.at";
|
$TITLE="@TITLE@";
|
||||||
$help=$sortv=0;
|
$help=$sortv=0;
|
||||||
$weekly=$daily=$help=$mix= $info=0;
|
$weekly=$daily=$help=$mix= $info=0;
|
||||||
@names=param();
|
@names=param();
|
||||||
|
@ -178,19 +172,37 @@ else {
|
||||||
# subs
|
# subs
|
||||||
sub make_a { #('/telrate/index.html','Startseite','start')
|
sub make_a { #('/telrate/index.html','Startseite','start')
|
||||||
my($url, $t, $g) = @_;
|
my($url, $t, $g) = @_;
|
||||||
|
div({-align=>'center'}, font({-size=>'-2'},
|
||||||
a({-href=>$url , -onmouseover=>"swap('$g',1)", -onmouseout=>"swap('$g',0)"},
|
a({-href=>$url , -onmouseover=>"swap('$g',1)", -onmouseout=>"swap('$g',0)"},
|
||||||
$t,img({-src=>"${g}0.jpg", -border=>0, width=>80,
|
img({-src=>"${g}0.jpg", -border=>0, width=>80, -name => $g, height=>40, -hspace=>10, -alt=>$t}
|
||||||
-name => $g,height=>40,-hspace=>10, -alt=>$t}));
|
)),
|
||||||
|
br,
|
||||||
|
a({-href=>$url , -onmouseover=>"swap('$g',1)", -onmouseout=>"swap('$g',0)"},
|
||||||
|
$t
|
||||||
|
)));
|
||||||
}
|
}
|
||||||
sub hrg {
|
sub hrg {
|
||||||
img({-src=>"hr.gif", -width=>600,
|
my($tabda);
|
||||||
-height=>4, -alt=>'-----'});
|
|
||||||
|
$tabda= q!td({-align=>'center'},
|
||||||
|
img({-src=>"hr.gif", -width=>600, -height=>4, -alt=>'---------'}
|
||||||
|
)), !;
|
||||||
|
|
||||||
|
p(
|
||||||
|
div({-align=>'center'},
|
||||||
|
table({-width=>'100%', -border=>0},
|
||||||
|
Tr(eval($tabda
|
||||||
|
)))));
|
||||||
}
|
}
|
||||||
|
|
||||||
# footer
|
# footer
|
||||||
sub footer {
|
sub footer {
|
||||||
my($pnum) = $_[0];
|
my($pnum) = $_[0];
|
||||||
my($t);
|
my($t);
|
||||||
|
my($tds) = "";
|
||||||
|
|
||||||
|
print "\n";
|
||||||
|
|
||||||
if ($pnum && ($t=&get_info($pnum, 'TarifChanged'))) {
|
if ($pnum && ($t=&get_info($pnum, 'TarifChanged'))) {
|
||||||
$t = "Tarife zuletzt gewartet am $t.";
|
$t = "Tarife zuletzt gewartet am $t.";
|
||||||
}
|
}
|
||||||
|
@ -212,6 +224,8 @@ sub footer {
|
||||||
print(span({-class=>'sm'},' an den Maintainer der Tarife ',
|
print(span({-class=>'sm'},' an den Maintainer der Tarife ',
|
||||||
a({-href=>"mailto:$e?subject=Tarife $pnum"},$n),' oder'));
|
a({-href=>"mailto:$e?subject=Tarife $pnum"},$n),' oder'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$tds .= td(make_a('index.html', 'Startseite', 'start'));
|
||||||
print(
|
print(
|
||||||
span({-class=>'sm'},
|
span({-class=>'sm'},
|
||||||
ul(li('in Österreich an ',
|
ul(li('in Österreich an ',
|
||||||
|
@ -222,26 +236,37 @@ sub footer {
|
||||||
'die deutsche ISDN-Rate Crew'))),
|
'die deutsche ISDN-Rate Crew'))),
|
||||||
'oder an den Autor dieses Pogrammes ',
|
'oder an den Autor dieses Pogrammes ',
|
||||||
a({-href=>'mailto:lt@toetsch.at?subject=Tarife'},'Leopold Tötsch'),'.'),
|
a({-href=>'mailto:lt@toetsch.at?subject=Tarife'},'Leopold Tötsch'),'.'),
|
||||||
p,hrg,p,
|
p,hrg,p
|
||||||
make_a('index.html','Startseite','start')
|
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
my $url= url();
|
my $url= url();
|
||||||
$url =~ s/&help.*?=\w+//g;
|
$url =~ s/&help.*?=\w+//g;
|
||||||
|
|
||||||
if ($mix || $help == 3) {
|
if ($mix || $help == 3) {
|
||||||
print(make_a($url, 'Einzelgespräch', 'eg'));
|
$tds .= td(make_a($url, 'Einzelgespräch', 'eg'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$mix || $help == 3) {
|
if (!$mix || $help == 3) {
|
||||||
$url .= '?mix=10';
|
$url .= '?mix=10';
|
||||||
print(make_a($url, 'Gesprächsmix','gm'));
|
$tds .= td(make_a($url, 'Gesprächsmix', 'gm'));
|
||||||
}
|
}
|
||||||
|
|
||||||
print (br) if ($help==3 && !param('list'));
|
print (br) if ($help==3 && !param('list'));
|
||||||
print(make_a('info.html', 'Info, Hilfe','info'));
|
|
||||||
|
$tds .= td(make_a('info.html', 'Info, Hilfe', 'info'));
|
||||||
|
|
||||||
if (!param('list')) {
|
if (!param('list')) {
|
||||||
$url =~ s/\?.*//g;
|
$url =~ s/\?.*//g;
|
||||||
$url .= '?list=1';
|
$url .= '?list=1';
|
||||||
print(make_a($url, 'Providerliste','list'));
|
$tds .= td(make_a($url, 'Providerliste', 'list'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print (p(
|
||||||
|
div({-align=>'center'},
|
||||||
|
table({-width=>'100%', -border=>0},
|
||||||
|
Tr({-align=>'center'}, $tds
|
||||||
|
)))));
|
||||||
|
|
||||||
print(end_html);
|
print(end_html);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -565,6 +590,7 @@ sub print_form {
|
||||||
my($t, $i);
|
my($t, $i);
|
||||||
my @codes = sort byname (keys(%towns));
|
my @codes = sort byname (keys(%towns));
|
||||||
$t= q!print(
|
$t= q!print(
|
||||||
|
div({-align=>'center'},
|
||||||
start_form(-name=>'form',-action=>url),
|
start_form(-name=>'form',-action=>url),
|
||||||
table({-border=>8},
|
table({-border=>8},
|
||||||
Tr(td(table({-bgcolor=>'#ffffd0', -cellspacing=>0, -cellpadding=>0, -border=>0},
|
Tr(td(table({-bgcolor=>'#ffffd0', -cellspacing=>0, -cellpadding=>0, -border=>0},
|
||||||
|
@ -738,7 +764,7 @@ sub print_form {
|
||||||
' '])
|
' '])
|
||||||
)
|
)
|
||||||
)))),
|
)))),
|
||||||
end_form);
|
end_form));
|
||||||
!;
|
!;
|
||||||
eval($t);
|
eval($t);
|
||||||
print q!
|
print q!
|
||||||
|
@ -1625,10 +1651,10 @@ nolegend:
|
||||||
# write file
|
# write file
|
||||||
$tempf = `$MKTEMP -q "$tempdir/irXXXXXX"`;
|
$tempf = `$MKTEMP -q "$tempdir/irXXXXXX"`;
|
||||||
chomp($tempf);
|
chomp($tempf);
|
||||||
rename($tempf, "$tempf.png") || print(p,"Can't rename $tempf");;
|
rename($tempf, "$tempf.@GIFPNG@") || print(p,"Can't rename $tempf");;
|
||||||
$tempf = "$tempf.png";
|
$tempf = "$tempf.@GIFPNG@";
|
||||||
open(TEMP,">$tempf") || print(p,"Can't write $tempf");
|
open(TEMP,">$tempf") || print(p,"Can't write $tempf");
|
||||||
print(TEMP $im->png);
|
print(TEMP $im->@GIFPNG@);
|
||||||
close(TEMP);
|
close(TEMP);
|
||||||
# ret img tag
|
# ret img tag
|
||||||
$tempf =~ s!^$tempdir/!!;
|
$tempf =~ s!^$tempdir/!!;
|
||||||
|
@ -1661,16 +1687,15 @@ sub _x {
|
||||||
$xo+$_[0]*$xs;
|
$xo+$_[0]*$xs;
|
||||||
}
|
}
|
||||||
|
|
||||||
# del gifs older then 1 hour
|
# del @GIFPNG@s older then 1 hour
|
||||||
sub
|
sub clean_up {
|
||||||
clean_up {
|
|
||||||
my(@All, $file, $now);
|
my(@All, $file, $now);
|
||||||
opendir(DIR, $tempdir);
|
opendir(DIR, $tempdir);
|
||||||
@All = readdir(DIR);
|
@All = readdir(DIR);
|
||||||
closedir(DIR);
|
closedir(DIR);
|
||||||
$now=time();
|
$now=time();
|
||||||
foreach $file (@All) {
|
foreach $file (@All) {
|
||||||
if($now - (stat("$tempdir/$file"))[9] > 3600 && $file =~ /^ir.{6}\.(gif|png)/) {
|
if($now - (stat("$tempdir/$file"))[9] > 3600 && $file =~ /^ir.{6}\.@GIFPNG@/) {
|
||||||
unlink("$tempdir/$file");
|
unlink("$tempdir/$file");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1679,10 +1704,12 @@ clean_up {
|
||||||
sub get_info {
|
sub get_info {
|
||||||
my ($pnum, $sect, $bsp) = @_;
|
my ($pnum, $sect, $bsp) = @_;
|
||||||
my (@lines, $t);
|
my (@lines, $t);
|
||||||
|
|
||||||
if($sect eq 'NR') {
|
if($sect eq 'NR') {
|
||||||
$pnum=~s/_.*$//;
|
$pnum=~s/_.*$//;
|
||||||
return $pnum;
|
return $pnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
$pnum = provider2prefix($pnum);
|
$pnum = provider2prefix($pnum);
|
||||||
my @args=($ISDNRATE,"-p$pnum -X$sect");
|
my @args=($ISDNRATE,"-p$pnum -X$sect");
|
||||||
_call_isdnrate(\@lines, @args);
|
_call_isdnrate(\@lines, @args);
|
|
@ -1,8 +1,10 @@
|
||||||
130 FreeCall
|
130 FreeCall
|
||||||
170 Mobilfunknetz D1
|
170 Mobilfunknetz D1
|
||||||
171 Mobilfunknetz D1
|
171 Mobilfunknetz D1
|
||||||
|
175 Mobilfunknetz D1
|
||||||
172 Mobilfunknetz D2
|
172 Mobilfunknetz D2
|
||||||
173 Mobilfunknetz D2
|
173 Mobilfunknetz D2
|
||||||
|
174 Mobilfunknetz D2
|
||||||
177 Mobilfunknetz Eplus
|
177 Mobilfunknetz Eplus
|
||||||
178 Mobilfunknetz Eplus
|
178 Mobilfunknetz Eplus
|
||||||
176 Mobilfunknetz E2
|
176 Mobilfunknetz E2
|
||||||
|
@ -3420,7 +3422,7 @@
|
||||||
6405 Laubach
|
6405 Laubach
|
||||||
6406 Lollar
|
6406 Lollar
|
||||||
6407 Rabenbach
|
6407 Rabenbach
|
||||||
6408 Busek
|
6408 Buseck
|
||||||
6409 Biebertal
|
6409 Biebertal
|
||||||
641 Gießen
|
641 Gießen
|
||||||
6420 Lahntal
|
6420 Lahntal
|
||||||
|
|
Loading…
Reference in New Issue