The server is verbose, all actions are recorded and, knowing the
tariff, the bill for every user is made.
Calling the accounting tool
It's a java program. The classes are stored in ds3/ds3accounting
.
You have to run ds3accounting.Ds3Main
with at least three parameters, in this order:
- The log file. The log file made by the ds3 server. It is
either a syslog file or the ds3 debug file.
- The tariff table. The table describing the phone tariffs. See below.
- The output file. After running the accounting tool, this file contains the bill for every user.
Optionally you can give some options. Usually, you do
not need
any of these options, because they are mainly introduced to cover bugs/features in former
releases of the ds3 server. Well, here they are, order does not matter:
- Option
-I
. This option determines whether the
accounting tool shall treat the input file either as a syslog
file or as a ds3 debug file. If this option is not given, the
accounting tool looks at the input file and decides itself. When
you use this option, you have to give one of the following
parameters:
-Isys
means syslog file
-Idebug
means ds3 server debug file
- Option
-S
. This options describes the version of
the debug file. The current version is the default, when you omit
this option. When you use this option, you have to give one of
the following parameters:
-Sno
means former version: dserv, no pid.
-Spo
means former version: dserv, with pid.
-Sn3
is the current version: ds3, no pid.
- Option
-B
. This option forces the accounting
tool to treat dialing markers as online markers.
- Option -V. This options controls how verbose the
accounting tool is. You have to give either
-V0
Do not chat at all.
-V1
Give some lines, this is the default.
-V2
Be verbose.
-V3
Tell really everything.
Some lines will inform you about the progress of work while running.
The Tariff Table
You have to describe the tariff in a seperate file. Every line
describes one kind of tariff. You can also insert blank lines and
lines starting with "#", which will be treated as comments.
Every crucial line consists of follwing items, devided by a slash ("/"). Do not insert any blanks.
- Start of the period when this tariff is valid, use iso date style, e.g. 1998-12-24.
- End of the period when this tariff is valid, use iso date style, e.g. 1998-12-24.
- Coding the date, when this tariff is valid:
code | means |
Tjjjj-mm-tt | this day, given by iso date string |
HS | every holiday, sunday is a holiday automatically |
HN | every holiday, but not sunday |
7 | every sunday |
6 | every saturday |
WX | every workday, saturday is a workday |
WY | every workday, saturday is not a workday |
List devided by commas (","), no blanks.
- Time of the date, when this tariff is valid. Use 24 hour model; hour and minute
divided by colon (":"), if minute given; use minus ("-") for period; devide several periods
by comma (","), no blanks.
- Cash per minute in the described period.
And here is an example:
1997-01-01/1999-12-31/WX,T1998-01-01/0-8,20:30-24/24.5
ATTENTION: You have to give the lines in the right order.
E.g. to count a holiyday on monday as a holiyday (HS) and
not as a workday (WX).
One more example, the current tariff table I use:
1996-07-01/2002-12-31/HS/5-21/0.048
1996-07-01/2002-12-31/HS/0-5,21-24/0.03
1996-07-01/2002-12-31/6,7/5-21/0.048
1996-07-01/2002-12-31/6,7/0-5,21-24/0.03
1996-07-01/2002-12-31/WY/5-9,18-21/0.048
1996-07-01/2002-12-31/WY/9-18/0.08
1996-07-01/2002-12-31/WY/0-5,21-24/0.03
1996-07-01/2002-12-31/WY/0-5,21-24/0.03
Note: By now, the holidays are badly hardcoded, whichs means: some holidays missing, no eastern, no internationalization, no config file.