- "message = 0" bug fixed (many thanks to

Sebastian Kanthak <sebastian.kanthak@muehlheim.de>)
 - CITYWEEKEND via config-file possible
 - fixes from Michael Reinelt <reinelt@eunet.at>
 - fix a typo in the README from Sascha Ziemann <szi@aibon.ping.de>
 - Charge for .at optimized by Michael Reinelt <reinelt@eunet.at>
 - first alpha-Version of the new chargeinfo-Database
   ATTENTION: This version requires the following manual steps:
     cp /usr/src/isdn4k-utils/isdnlog/tarif.dat /usr/lib/isdn
     cp /usr/src/isdn4k-utils/isdnlog/samples/tarif.conf /etc/isdn
This commit is contained in:
Andreas Kool 1999-01-10 15:24:38 +00:00
parent 5c09236b8d
commit 8617a64a6b
17 changed files with 1513 additions and 1755 deletions

View File

@ -19,6 +19,9 @@
## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
##
## $Log$
## Revision 1.51 1998/12/29 14:51:37 paul
## added isdnconf manpage
##
## Revision 1.50 1998/12/01 16:57:09 paul
## support for .in manpages
##
@ -389,7 +392,7 @@ SERVICEFILE = /etc/services
# DON'T EDIT BELOW THIS LINE
######################################################################
VERSION = 3.00
VERSION = 3.01
MANPAGES = isdnlog/callerid.conf.5 isdnlog/isdnlog.5 isdnlog/isdnlog.8 isdnlog/isdnlog.users.5 isdnrep/isdnrep.1 isdnconf/isdnconf.1
@ -423,8 +426,8 @@ ISDNLOG_OBJS = isdnlog/isdnlog.o isdnlog/processor.o isdnlog/functions.o \
isdnlog/server.o isdnlog/start_prog.o isdnlog/messages.o \
connect/connect.o connect/socket.o tools/tools.o \
connect/conv_address.o isdnlog/user_access.o \
isdnrep/cheap.o isdnrep/gebuehr.o tools/isdnconf.o \
tools/tools_$(NATION).o isdnlog/takt_$(NATION).o \
tools/isdnconf.o tools/tools_$(NATION).o \
isdnlog/takt_$(NATION).o \
$(LIBISDNDIR)/libisdn.a
@ -440,14 +443,13 @@ ifdef TESTCENTER
ISDNLOG_OBJS += isdnlog/test_center.o
endif
ISDNREP_OBJS = isdnrep/rep_main.o isdnrep/cheap.o tools/tools.o \
tools/isdnconf.o isdnlog/messages.o isdnrep/isdnrep.o \
isdnrep/gebuehr.o \
tools/tools_$(NATION).o \
ISDNREP_OBJS = isdnrep/rep_main.o tools/tools.o tools/isdnconf.o \
isdnlog/messages.o isdnrep/isdnrep.o \
tools/tools_$(NATION).o isdnlog/takt_$(NATION).o \
$(LIBISDNDIR)/libisdn.a
ISDNCONF_OBJS= isdnconf/isdnconf.o tools/tools.o tools/isdnconf.o \
tools/tools_$(NATION).o \
tools/tools_$(NATION).o isdnlog/takt_$(NATION).o \
$(LIBISDNDIR)/libisdn.a
ISDNLOG = bin/isdnlog

View File

@ -1,10 +1,10 @@
ISDNLOG - Version 3.0 - 09-Dec-98 21:36
ISDNLOG - Version 3.01 - 10-Jan-99 16:06
isdnlog ist ein Utility zur Auswertung des D-Kanals eines
ISDN-BRI Anschlusses.
isdnlog-3.0 wurde ausgiebig mit Linux-2.0.36 getestet.
isdnlog-3.01 wurde ausgiebig mit Linux-2.0.36 getestet.
Fuer alle, die es nun ueberhaupt nicht mehr abwarten koennen, hier das
@ -62,7 +62,7 @@ Quick-Installation-Guide
5. isdnlog starten:
/sbin/isdnlog -nsS -v1 w1 -m0x5f7 /dev/isdnctrl
/sbin/isdnlog -nsS -v1 -w1 -m0x5f7 /dev/isdnctrl
6. Jede Menge rumtelefonieren
@ -110,11 +110,12 @@ Inhalt:
16. SQL-Anbindung
16.1. Postgres95
16.2. MySQL
17. Probleme?
18. Verwendete Dateien
19. Verwendete Environment-Variablen
20. Verwendete Abkuerzungen
21. Danksagung
17. Tarifdatenbank
18. Probleme?
19. Verwendete Dateien
20. Verwendete Environment-Variablen
21. Verwendete Abkuerzungen
22. Danksagung
Vorwort
@ -3724,7 +3725,202 @@ CREATE TABLE isdnlog (
--
17. Probleme?
17. Tarifdatenbank
------------------
Die Tarifdatenbank fuer isdnlog wird bei jedem Neustart von isdnlog aus
der ASCII-Datei "/usr/lib/isdn/tarif.dat" neu generiert.
Benutzerbezogene Einstellungen an der Tarifdatenbank (wie Auswahl
eines bestimmten Tarifes eines Providers (z.b. Sekundentakt oder Minutentakt),
oder auch der konkrete Provider bei Kennzahlen, die von mehreren Providern
vergeben werden (z.b. 01098 wird von Star, Nikoma, Mox sowie C@llas verwendet)
werden in der Datei "/etc/isdn/tarif.conf" vorgenommen.
Die Datei "tarif.dat" wird in einem Durchgang von oben nach unten eingelesen,
und muss folgenden Aufbau (als Beispiel hier nun Mobilcom) haben:
P:19,0=MobilCom
G:01.01.1999
C:MobilCom AG
C:Homepage: http://www.mobilcom.de
C:Hotline: 01805/191919
C:Adresse: Postfach 1249, 24822 Schleswig
A:60/60
I:0101901929 # (Benutzername: mobilcom; Passwort: mobilcom)
Z:1-2
T:*=0.19
Z:3-8
T:*=0.99
Z:G
T:*=0.19
Leerzeilen, sowie Kommentare mittels "#" sind zulaessig.
Die Reihenfolge der Eintraege muss zwingend so wie angegeben sein.
Es ist auch nicht erlaubt, irgend welche Leerzeichen, Tabs o.ae.
einzufuegen, als Dezimalkomma muss der "." (Punkt) verwendet werden,
Uhrzeiten sind stets 5-stellig (05:15) anzugeben.
Nun die Eintraege im einzelnen:
-> P:
Hiermit beginnt die Definition des naechsten Providers.
Es wird die Kennzahl, evtl. eine laufende Nummer sowie die
Bezeichnung des Providers definiert.
Beispiel:
P:19,0=MobilCom AG
Gibt es fuer eine Kennzahl mehrere Alternativen (wie verschiedene Provider
oder verschiedene Tarife), werden diese hierueber auseinander gehalten.
Der erste Tarif bekommt "P:xx,0", der naechste "P:xx,1" usw.
Gibt es keine Alternativen, darf das ",0" entfallen.
-> G:
Hier wird (im Format tt.mm.jjjj) angegeben, ab wann dieser Tarif gueltig ist.
Beispiel:
G:01.01.1999
-> C:
Hiermit koennen beliebig viele Kommentare eingefuegt werden, Beispiel:
C:Homepage: http://www.mobilcom.de
C:Hotline: 01805/191919
C:Adresse: Postfach 1249, 24822 Schleswig
Im Gegensatz zu den "#" Kommentaren koennten diese in spaeteren Versionen
von isdnlog noch gesondert verwendet werden, und sollten daher zumindest
genug Informationen enthalten, um eine Kontaktaufnahme mit der jeweiligen
Telefongesellschaft zu ermoeglichen.
-> A:
Hiermit wird angegeben, nach welchem Takt abgerechnet wird. Z.Zt. werden
zwei grundsaetzlich verschiedene Modelle unterstuetzt:
1. Abrechnung nach Takten (soweit mir bekannt, nur noch bei der
Deutschen Telekom ueblich)
In diesem Fall wird unter A: angegeben, was ein Takt kostet, also
A:0.12
und weiter unten (im Kapitel T:) die Laenge eines Taktes in Sekunden
2. Abrechnung in Minutenpreisen. Dies ist heutzutage die uebliche Notation
in den einschlägigen Preislisten der Provider.
In diesem Fall kommt die Notation "A:30/1" zum Zuge. Dies
bedeutet: Mindestdauer einer Verbindung 30 Sekunden, Abrechnung
Sekundengenau. Anderes Beispiel: A:60/60 bedeutet: Mindestdauer
60 Sekunden, Abrechnung Minutengenau.
In diesem Fall wird im folgenden Kapitel T: der Preis pro
Minute angegeben.
-> I:
Bietet dieser Provider einen eigenen Internet-Zugang an (wie z.b. o.tel.o,
Mobilcom, Arcor, VIAG), wird hier die komplette Zugangsnummer hinterlegt.
Beispiel:
I:0101901929 # (Benutzername: mobilcom; Passwort: mobilcom)
Nun folgen die eigentlichen Tarifinformationen. Es wird zuerst die
Zone, und danach die Kosten innerhalb dieser Zone angegeben. Es koennen
beliebig viele Zonen, jeweils gefolgt von beliebig vielen Kosten
angegeben werden.
-> Z:
Gibt die Zone an. isdnlog kennt per heute folgende Zonen:
0=City 8=E2-Netz G=Internet
1=Region 50 9=Euro City
2=Fern A=Euro 1
3=C-Netz B=Euro 2
4=C-Mobilbox C=Welt 1
5=D1-Netz D=Welt 2
6=D2-Netz E=Welt 3
7=E-plus-Netz F=Welt 4
Falls ein Provider in mehreren Zonen denselben Tarif anbietet, kann das
durch die Notation Z:1-2 (bedeutet: Gilt sowohl für die Regional- als die
Fernzone) oder auch Z:3-8 (bedeutet: Gilt fuer alle Funknetze) angegeben
werden. Beispiel:
Z:1-2
-> T:
Hiermit wird letztendlich der eigentliche Tarif angegeben.
Es sind folgende Notationen zulaessig:
T:W09-18=0.29
Meint: Werktags, 09:00 Uhr bis 18:00 Uhr (genaugenommen bis 17:59 Uhr, isdnlog
beruecksichtigt dies automatisch) kostet 1 Minute DM 0,29
T:E08-21=0.13
Meint: Wochenende sowie Feiertags, 08:00 Uhr bis 21:00 Uhr kostet eine
Minute DM 0,13
Also: "W" = Werktag, "E" = Wochenende/Feiertag, oder auch "*" = alle Tage
Danach die Uhrzeit von/bis dieser Tarif gilt, gefolgt von einem "="
Zeichen, danach der Minutenpreis in DM
Wird keine Uhrzeit angegeben, also z.b. "E=0.10" bedeutet dies: Den ganzen
Tag ueber, 24 Stunden (sog. "flat rate")
Es folgen in beliebig vielen weiteren "T:" Zeilen alle weiteren Tarife
für die darueber definierte Zone.
Danach wird mittels "Z:" die naechste Zone begonnen, wiederum gefolgt von
beliebig vielen "T:" Tarifen.
Sind alle Tarife eines Anbieters definiert, folgt mittels "P:"
der naechste Provider usw.
In der Datei "/etc/isdn/tarif.conf" werden die Benutzerabhaengigen
Einstellungen an der Tarifdatenbank vorgenommen.
Beispiel:
# Kennzahl 98, moegliche Varianten:
# 0=Nikoma Minutentakt
# 1=Nikoma Sekundentakt
# 2=Nikocity Minutentakt
# 3=Nikocity Sekundentakt
# 4=Mox Telecom AG
# 5=C@llas Clever Communications
P:98=4
Hier wird definiert, das der konkrete Anwender bei einer Verbindung ueber
die Kennzahl "98" den Tarif der Fa. Mox Telecom AG meint.
: Folgende Dinge sind mir bereits als hiermit noch nicht machbar bekannt:
:
: - die erste Minute kostenlos, wenn Gespraechsdauer < 1 Minute
: - die ersten 5 Sekunden kostenlos
: - 10plus, CityPlus, usw. der DTAG
: - Preise fuer die Sondernnummern (112 ..., 0191011 ...)
: - Talkline's Internet-Zugang wird im 3 Minuten-Takt abgerechnet
: - Viatel berechnet an Feiertagen nicht wie Wochenende, sondern wie normale Tage
: - Rabatte
: - feinere Unterscheidung nach Laendern (Euro 1, Welt 1 ...)
: - einige Provider "vergessen", bei laufenden Gespaechen einen evtl.
: Tarifwechsel abzurechnen
: - Unterscheidung zwischen Wochenend- sowie Feiertagstarifen
: - Sonderbehandlung von 24. Dezember bis 31. Dezember (Telekom)
18. Probleme?
-------------
Sollte isdnlog nicht wie beschrieben arbeiten, muessen folgende Punkte
@ -3850,7 +4046,7 @@ gdb bin/isdnlog
Den _gesamten_ Output an die oben angegebene Adresse senden.
18. Verwendete Dateien
19. Verwendete Dateien
----------------------
Folgende Files werden von diesem System verwendet:
@ -3880,7 +4076,7 @@ Folgende Files werden von diesem System verwendet:
/usr/X11R6/lib/X11/app-defaults/Isdn - Resourcefile fuer xisdn
19. Verwendete Environment-Variablen
20. Verwendete Environment-Variablen
------------------------------------
Folgende Environment-Variablen werden von diesem System verwendet:
@ -3892,7 +4088,7 @@ Folgende Environment-Variablen werden von diesem System verwendet:
X-Client "xisdn"
20. Verwendete Abkuerzungen
21. Verwendete Abkuerzungen
---------------------------
VSt = Vermittlungsstelle (das Amt)
@ -3934,7 +4130,7 @@ Folgende Environment-Variablen werden von diesem System verwendet:
PRI = Primary rate interface (30 B-Kanaele)
21. Danksagung
22. Danksagung
--------------
Bedanken moechte ich mich vor allem bei

View File

@ -2,7 +2,7 @@
*
* ISDN accounting for isdn4linux. (log-module)
*
* Copyright 1995, 1998 by Andreas Kool (akool@isdn4linux.de)
* Copyright 1995, 1999 by Andreas Kool (akool@isdn4linux.de)
* and Stefan Luethje (luethje@sl-gw.lake.de)
*
* This program is free software; you can redistribute it and/or modify
@ -19,6 +19,15 @@
* along with this program; if not, write to the Free Software
*
* $Log$
* Revision 1.16 1998/12/09 20:39:24 akool
* - new option "-0x:y" for leading zero stripping on internal S0-Bus
* - new option "-o" to suppress causes of other ISDN-Equipment
* - more support for the internal S0-bus
* - Patches from Jochen Erwied <mack@Joker.E.Ruhr.DE>, fixes TelDaFax Tarif
* - workaround from Sebastian Kanthak <sebastian.kanthak@muehlheim.de>
* - new CHARGEINT chapter in the README from
* "Georg v.Zezschwitz" <gvz@popocate.hamburg.pop.de>
*
* Revision 1.15 1998/11/24 20:51:26 akool
* - changed my email-adress
* - new Option "-R" to supply the preselected provider (-R24 -> Telepassport)
@ -370,7 +379,7 @@ int print_msg(int Level, const char *fmt, ...)
if (Level & message)
{
if (fcons == NULL) {
if (!fout && (fcons == NULL)) {
fputs(width ? s : String, stderr);
fflush(stderr);
}

View File

@ -2,7 +2,7 @@
*
* ISDN accounting for isdn4linux. (log-module)
*
* Copyright 1995, 1998 by Andreas Kool (akool@isdn4linux.de)
* Copyright 1995, 1999 by Andreas Kool (akool@isdn4linux.de)
* and Stefan Luethje (luethje@sl-gw.lake.de)
*
* This program is free software; you can redistribute it and/or modify
@ -19,6 +19,9 @@
* along with this program; if not, write to the Free Software
*
* $Log$
* Revision 1.32 1998/12/31 09:58:50 paul
* converted termio calls to termios
*
* Revision 1.31 1998/12/09 20:39:28 akool
* - new option "-0x:y" for leading zero stripping on internal S0-Bus
* - new option "-o" to suppress causes of other ISDN-Equipment
@ -693,9 +696,7 @@ int set_options(int argc, char* argv[])
/* Wenn message nicht explixit gesetzt wurde, dann gibt es beim daemon auch
kein Output auf der Console/ttyx */
/* if (!newmessage && ptty == NULL) -> FIXME: so geht das nicht, Stefan, wenn
-> "message" ueber das config-File
-> (CONF_ENT_STDOUT) gefuellt wird! */
if (!outfile && !newmessage && (ptty == NULL))
message = 0;
} /* if */
@ -843,6 +844,9 @@ static int read_param_file(char *FileName)
else
if (!strcmp(Ptr->name,CONF_ENT_OTHER))
other = toupper(*(Ptr->value)) == 'Y'?1:0;
else
if (!strcmp(Ptr->name,CONF_ENT_CW))
CityWeekend++;
else
print_msg(PRT_ERR,"Error: Invalid entry `%s'!\n",Ptr->name);
@ -960,6 +964,7 @@ int main(int argc, char *argv[], char *envp[])
register int i, res = 0;
auto int lastarg;
auto char rlogfile[PATH_MAX];
auto char msg[BUFSIZ];
auto char **devices = NULL;
sigset_t unblock_set;
#ifdef TESTCENTER
@ -1180,6 +1185,10 @@ int main(int argc, char *argv[], char *envp[])
#endif
initSondernummern();
initTarife(msg);
if (*msg)
print_msg(PRT_NORMAL, "%s\n", msg);
loop();

View File

@ -2,7 +2,7 @@
*
* ISDN accounting for isdn4linux.
*
* Copyright 1995, 1998 by Andreas Kool (akool@isdn4linux.de)
* Copyright 1995, 1999 by Andreas Kool (akool@isdn4linux.de)
* and Stefan Luethje (luethje@sl-gw.lake.de)
*
* This program is free software; you can redistribute it and/or modify
@ -20,6 +20,15 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log$
* Revision 1.14 1998/12/09 20:39:30 akool
* - new option "-0x:y" for leading zero stripping on internal S0-Bus
* - new option "-o" to suppress causes of other ISDN-Equipment
* - more support for the internal S0-bus
* - Patches from Jochen Erwied <mack@Joker.E.Ruhr.DE>, fixes TelDaFax Tarif
* - workaround from Sebastian Kanthak <sebastian.kanthak@muehlheim.de>
* - new CHARGEINT chapter in the README from
* "Georg v.Zezschwitz" <gvz@popocate.hamburg.pop.de>
*
* Revision 1.13 1998/11/24 20:51:35 akool
* - changed my email-adress
* - new Option "-R" to supply the preselected provider (-R24 -> Telepassport)
@ -192,6 +201,7 @@
/****************************************************************************/
#define BROADCAST 0x7f
#define OUTGOING !call[chan].dialin
/****************************************************************************/
@ -336,7 +346,6 @@ _EXTERN char *outfile;
_EXTERN char tmpout[PATH_MAX];
_EXTERN int readkeyboard;
_EXTERN int interns0;
_EXTERN int preselect;
_EXTERN int other;
_EXTERN IFO ifo[ISDN_MAX_CHANNELS];
_EXTERN IO io[ISDN_MAX_CHANNELS];
@ -380,7 +389,12 @@ _EXTERN void logger(int chan);
_EXTERN int ringer(int chan, int event);
_EXTERN void initSondernummern(void);
_EXTERN int is_sondernummer(char *num);
_EXTERN void initTarife(char *msg);
_EXTERN void exitTarife(void);
_EXTERN void price(int chan, char *hint);
_EXTERN char *realProvidername(int prefix);
_EXTERN void preparecint(int chan, char *msg, char *hint);
_EXTERN int taktlaenge(int chan, char *why);
#undef _EXTERN
/****************************************************************************/

View File

@ -2,7 +2,7 @@
*
* ISDN accounting for isdn4linux. (log-module)
*
* Copyright 1995, 1998 by Andreas Kool (akool@isdn4linux.de)
* Copyright 1995, 1999 by Andreas Kool (akool@isdn4linux.de)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -19,6 +19,15 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log$
* Revision 1.35 1998/12/09 20:39:36 akool
* - new option "-0x:y" for leading zero stripping on internal S0-Bus
* - new option "-o" to suppress causes of other ISDN-Equipment
* - more support for the internal S0-bus
* - Patches from Jochen Erwied <mack@Joker.E.Ruhr.DE>, fixes TelDaFax Tarif
* - workaround from Sebastian Kanthak <sebastian.kanthak@muehlheim.de>
* - new CHARGEINT chapter in the README from
* "Georg v.Zezschwitz" <gvz@popocate.hamburg.pop.de>
*
* Revision 1.34 1998/11/24 20:51:45 akool
* - changed my email-adress
* - new Option "-R" to supply the preselected provider (-R24 -> Telepassport)
@ -437,12 +446,6 @@
#define _PROCESSOR_C_
#include "isdnlog.h"
#define OUTGOING !call[chan].dialin
extern double cheap96(time_t when, int zone, int *zeit);
extern double taktlaenge(int chan, char *description);
static int HiSax = 0, hexSeen = 0, uid = -1;
static char *asnp, *asnm;
#ifdef Q931
@ -1782,8 +1785,8 @@ static void decode(int chan, register char *p, int type, int version, int tei)
{
register char *pd, *px, *py;
register int i, element, l, l1, c, oc3, oc3a, n, sxp = 0, warn;
auto int zeit, loc, cause;
auto char s[BUFSIZ], s1[BUFSIZ];
auto int loc, cause;
auto char s[BUFSIZ], s1[BUFSIZ], why[BUFSIZ];
auto char sx[10][BUFSIZ];
auto int sn[10];
auto struct tm tm;
@ -2133,14 +2136,15 @@ static void decode(int chan, register char *p, int type, int version, int tei)
sprintf(s, "aOC-E=%d", n);
aoc_debug(-1, s);
if (!n)
if (!n) {
if (call[chan].provider == 33) /* Only DTAG send's AOCD */
info(chan, PRT_SHOWAOCD, STATE_AOCD, "Free of charge");
}
else if (n < 0) {
tx = cur_time - call[chan].connect;
if ((c = call[chan].confentry[OTHER]) > -1) {
/* tack = cheap96(cur_time, known[c]->zone, &zeit); */
tack = taktlaenge (chan, NULL);
tack = (double)taktlaenge(chan, why);
err = call[chan].tick - tx;
call[chan].tick += tack;
@ -2215,7 +2219,7 @@ static void decode(int chan, register char *p, int type, int version, int tei)
err=60*60*24*365; /* sehr gross */
for (c = 1; c < 31; c++) {
call[chan].zone=c;
tack = (-n-1) * taktlaenge (chan, NULL);
tack = (-n -1) * (double)taktlaenge(chan, why);
if ((tack > 0) && (abs(tack - tx)<err)) {
call[chan].tick = tack;
err = abs(tack) - tx;
@ -2232,7 +2236,7 @@ static void decode(int chan, register char *p, int type, int version, int tei)
call[chan].tick = 0;
for (i = 0; i < -n - 1; i++) {
tack = cheap96(cur_time, c, &zeit);
tack = (double)taktlaenge(chan, why);
call[chan].tick += tack;
} /* for */
@ -2605,6 +2609,7 @@ static void decode(int chan, register char *p, int type, int version, int tei)
if (dual && ((type == INFORMATION) || ((type == SETUP) && OUTGOING))) { /* Digit's beim waehlen mit ISDN-Telefon */
strcat(call[chan].digits, s);
strcpy(call[chan].onum[CALLED], s);
call[chan].oc3 = oc3;
#ifdef Q931
if (q931dmp)
@ -3174,6 +3179,7 @@ escape: for (c = 0; c <= sxp; c++)
case 0xf1 : px += sprintf(px, "Eigendef"); break;
} /* switch */
#if 0 /* alles in eine Zeile */
px = sx[++sxp];
*px = 0;
@ -3181,31 +3187,33 @@ escape: for (c = 0; c <= sxp; c++)
if (!q931dmp)
#endif
px += sprintf(px, "HLC: ");
#endif
c = strtol(p + 6, NIL, 16);
sn[sxp] = c;
switch (c) {
case 0x81 : px += sprintf(px, "Telefonie"); break;
case 0x84 : px += sprintf(px, "Fax Gr.2/3 (F.182)"); break;
case 0xa1 : px += sprintf(px, "Fax Gr.4 (F.184)"); break;
case 0xa4 : px += sprintf(px, "Teletex service,basic and mixed-mode"); break;
case 0xa8 : px += sprintf(px, "Teletex service,basic and processab.-mode of Op."); break;
case 0xb1 : px += sprintf(px, "Teletex service,basic mode of operation"); break;
case 0xb2 : px += sprintf(px, "Syntax based Videotex"); break;
case 0xb3 : px += sprintf(px, "International Videotex interworking via gateway"); break;
case 0xb5 : px += sprintf(px, "Telex service"); break;
case 0xb8 : px += sprintf(px, "Message Handling Systems (MHS)(X.400)"); break;
case 0xc1 : px += sprintf(px, "OSI application (X.200)"); break;
case 0x81 : px += sprintf(px, ", Telefonie"); break;
case 0x84 : px += sprintf(px, ", Fax Gr.2/3 (F.182)"); break;
case 0xa1 : px += sprintf(px, ", Fax Gr.4 (F.184)"); break;
case 0xa4 : px += sprintf(px, ", Teletex service,basic and mixed-mode"); break;
case 0xa8 : px += sprintf(px, ", Teletex service,basic and processab.-mode of Op."); break;
case 0xb1 : px += sprintf(px, ", Teletex service,basic mode of operation"); break;
case 0xb2 : px += sprintf(px, ", Syntax based Videotex"); break;
case 0xb3 : px += sprintf(px, ", International Videotex interworking via gateway"); break;
case 0xb5 : px += sprintf(px, ", Telex service"); break;
case 0xb8 : px += sprintf(px, ", Message Handling Systems (MHS)(X.400)"); break;
case 0xc1 : px += sprintf(px, ", OSI application (X.200)"); break;
case 0xde :
case 0x5e : px += sprintf(px, "Reserviert fuer Wartung"); break;
case 0x5e : px += sprintf(px, ", Reserviert fuer Wartung"); break;
case 0xdf :
case 0x5f : px += sprintf(px, "Reserviert fuer Management"); break;
case 0xe0 : px += sprintf(px, "Audio visual"); break;
default : px += sprintf(px, "unknown: %d", c); break;
case 0x5f : px += sprintf(px, ", Reserviert fuer Management"); break;
case 0xe0 : px += sprintf(px, ", Audio visual"); break;
default : px += sprintf(px, ", unknown: %d", c); break;
} /* switch */
if ((c == 0x5e) || (c == 0x5f)) {
#if 0 /* alles in eine Zeile */
px = sx[++sxp];
*px = 0;
@ -3213,21 +3221,22 @@ escape: for (c = 0; c <= sxp; c++)
if (!q931dmp)
#endif
px += sprintf(px, "HLC: ");
#endif
c = strtol(p + 9, NIL, 16);
sn[sxp] = c;
switch (c) {
case 0x81 : px += sprintf(px, "Telefonie G.711"); break;
case 0x84 : px += sprintf(px, "Fax Gr.4 (T.62)"); break;
case 0xa1 : px += sprintf(px, "Document Appl. Profile for Fax Gr4 (T.503)"); break;
case 0xa4 : px += sprintf(px, "Doc.Appl.Prof.for formatted Mixed-Mode(T501)"); break;
case 0xa8 : px += sprintf(px, "Doc.Appl.Prof.for Processable-form (T.502)"); break;
case 0xb1 : px += sprintf(px, "Teletex (T.62)"); break;
case 0xb2 : px += sprintf(px, "Doc.App.Prof. for Videotex interworking between Gateways (T.504)"); break;
case 0xb5 : px += sprintf(px, "Telex"); break;
case 0xb8 : px += sprintf(px, "Message Handling Systems (MHS)(X.400)"); break;
case 0xc1 : px += sprintf(px, "OSI application (X.200)"); break;
case 0x81 : px += sprintf(px, ", Telefonie G.711"); break;
case 0x84 : px += sprintf(px, ", Fax Gr.4 (T.62)"); break;
case 0xa1 : px += sprintf(px, ", Document Appl. Profile for Fax Gr4 (T.503)"); break;
case 0xa4 : px += sprintf(px, ", Doc.Appl.Prof.for formatted Mixed-Mode(T501)"); break;
case 0xa8 : px += sprintf(px, ", Doc.Appl.Prof.for Processable-form (T.502)"); break;
case 0xb1 : px += sprintf(px, ", Teletex (T.62)"); break;
case 0xb2 : px += sprintf(px, ", Doc.App.Prof. for Videotex interworking between Gateways (T.504)"); break;
case 0xb5 : px += sprintf(px, ", Telex"); break;
case 0xb8 : px += sprintf(px, ", Message Handling Systems (MHS)(X.400)"); break;
case 0xc1 : px += sprintf(px, ", OSI application (X.200)"); break;
} /* case */
} /* if */
@ -3973,151 +3982,6 @@ void clearchan(int chan, int total)
} /* clearchan */
static void how_expensive(int chan)
{
register int c, zone = -1, zone2 = -1, pro = -1, pro2 = -1;
auto int dur = (int)(call[chan].disconnect - call[chan].connect);
auto double pay2 = -1.0, pay3, onesec, cheap;
auto char sx[BUFSIZ];
extern double pay(time_t ts, int dauer, int tarifz, int pro);
auto struct tm *tm;
if (OUTGOING && (dur > 0) && *call[chan].num[CALLED]) {
tm = localtime(&call[chan].connect);
if (call[chan].sondernummer[CALLED] != -1) {
switch (SN[call[chan].sondernummer[CALLED]].tarif) {
case -1 :
#ifdef ISDN_DE
if (!strcmp(call[chan].num[CALLED] + 3, "11833")) /* Sonderbedingung Auskunft Inland */
dur -= 30;
#endif
pay2 = SN[call[chan].sondernummer[CALLED]].grund1 * currency_factor;
pay2 += (dur / SN[call[chan].sondernummer[CALLED]].takt1) * currency_factor;
break;
case 0 : pay2 = 0.0;
break;
case 1 : zone = 1;
break;
} /* switch */
} /* if */
if (zone == -1) {
zone2 = area_diff(NULL, call[chan].num[CALLED]);
if ((c = call[chan].confentry[OTHER]) > -1)
zone = known[c]->zone;
if ((zone == -1) && (zone2 > 0)) {
sprintf(sx, "WARNING: Assuming ZONE %d", zone2);
zone = zone2;
info(chan, PRT_SHOWHANGUP, STATE_HANGUP, sx);
} /* if */
if ((zone != -1) && (zone2 != -1) && (zone != zone2)) {
sprintf(sx, "WARNING: Wrong ZONE (%d), assuming %d", zone, zone2);
zone = zone2;
if (call[chan].sondernummer[CALLED] == -1)
info(chan, PRT_SHOWHANGUP, STATE_HANGUP, sx);
} /* if */
} /* if */
if (pay2 == -1.0) {
if (call[chan].aoce > 0) /* Gebuehrentakt AOC-E kam (Komfortanschluss, via Telekom */
call[chan].pay = call[chan].aoce * currency_factor;
else {
if (zone > 0) {
#ifdef ISDN_DE
if (zone == 1)
pro2 = 33; /* CityCall :: Telekom */
else if (zone == 2)
pro2 = 70; /* RegioCall :: Arcor */
else if (zone == 3) {
#if 0
if ((tm->tm_wday > 0) && (tm->tm_wday < 6))
wochentag;
else
wochenende;
#endif
if ((tm->tm_hour > 20) || (tm->tm_hour < 5))
pro2 = 30; /* zw. 21:00 Uhr und 5:00 Uhr TelDaFax */
else
pro2 = 19; /* Mobilcom */
} /* else */
switch (zone) { /* map "isdnlog" to "gebuehr.c" Zones */
case 2 : zone = 3;
break;
case 3 : zone = 4;
break;
} /* switch */
pro = call[chan].provider;
if (pro == -1)
pro = preselect;
if (pro) {
call[chan].pay = pay(call[chan].connect, dur, zone, pro);
if (call[chan].pay == -1.0) { /* Unknown Tarif */
if (pro == 23) { /* tesion )) -- quick hack for SL "Baden-Württemberg Tarif" */
if ((tm->tm_hour > 20) || (tm->tm_hour < 9))
pay3 = 0.14;
else
pay3 = 0.21;
call[chan].pay = (pay3 / 60.0) * dur;
}
else
call[chan].pay = 0;
} /* if */
} /* if */
if (pro != pro2) {
pay3 = pay(call[chan].connect, dur, zone, pro2);
cheap = call[chan].pay - pay3;
if (cheap > 0) {
sprintf(sx, "WARNING: Provider %s DM %s cheaper!",
Providername(pro2),
double2str(cheap, 5, 2, DEB));
info(chan, PRT_SHOWHANGUP, STATE_HANGUP, sx);
} /* if */
} /* if */
#endif
} /* if */
} /* else */
#ifdef ISDN_DE
if ((dur > 600) && (zone > 1) && ((call[chan].aoce > 0) || (pro == 33))) {
onesec = call[chan].pay / dur;
pay2 = (dur - 600) * onesec * 0.30;
sprintf(sx, "10plus DM %s - DM %s = DM %s",
double2str(call[chan].pay, 6, 2, DEB),
double2str(pay2, 6, 2, DEB),
double2str(call[chan].pay - pay2, 6, 2, DEB));
call[chan].pay -= pay2;
info(chan, PRT_SHOWHANGUP, STATE_HANGUP, sx);
} /* if */
#endif
}
else
call[chan].pay = pay2;
} /* if */
} /* how_expensive */
static void dumpme()
{
register int chan;
@ -4228,7 +4092,7 @@ static void processctrl(int card, char *s)
register int wegchan; /* fuer gemakelte */
auto int dialin, type = 0, cref = -1, creflen, version;
static int tei = BROADCAST, sapi = 0, net = 1, firsttime = 1;
auto char sx[BUFSIZ], s2[BUFSIZ];
auto char sx[BUFSIZ], s2[BUFSIZ], why[BUFSIZ], hint[BUFSIZ];
static char last[BUFSIZ];
auto int isAVMB1 = 0;
@ -4711,22 +4575,27 @@ static void processctrl(int card, char *s)
call[chan].duration = tt;
call[chan].card = card;
if (message & PRT_SHOWNUMBERS)
info(chan, PRT_SHOWCONNECT, STATE_CONNECT, "CONNECT");
else {
if (*call[chan].service) {
sprintf(sx, "CONNECT (%s)", call[chan].service);
info(chan, PRT_SHOWCONNECT, STATE_CONNECT, sx);
} /* else */
}
else
info(chan, PRT_SHOWCONNECT, STATE_CONNECT, "CONNECT");
if (OUTGOING) {
auto char s[BUFSIZ], sx[BUFSIZ];
if (OUTGOING && *call[chan].num[CALLED]) {
if ((call[chan].cint = taktlaenge(chan, s)) > 1) {
preparecint(chan, why, hint);
info(chan, PRT_SHOWCONNECT, STATE_CONNECT, why);
if (*hint)
info(chan, PRT_SHOWCONNECT, STATE_CONNECT, hint);
if ((call[chan].cint = taktlaenge(chan, why)) > 0) {
call[chan].cinth = hour;
call[chan].nextcint = call[chan].connect + (int)call[chan].cint;
call[chan].ctakt = 1;
sprintf(sx, "NEXT CHARGEINT IN %s (%s)", double2clock(call[chan].cint), s);
sprintf(sx, "NEXT CHARGEINT IN %s (%s)", double2clock(call[chan].cint), why);
info(chan, PRT_SHOWCONNECT, STATE_CONNECT, sx);
} /* if */
} /* if */
@ -4852,7 +4721,10 @@ doppelt:break;
qmsg(TYPE_CAUSE, version, call[chan].cause));
} /* if */
how_expensive(chan);
price(chan, hint);
if (*hint)
info(chan, PRT_SHOWHANGUP, STATE_HANGUP, hint);
#ifdef Q931
if (!q931dmp)
@ -5204,11 +5076,9 @@ void morekbd()
void processcint()
{
register int chan;
auto char s[BUFSIZ], sx[BUFSIZ];
auto char sx[BUFSIZ], why[BUFSIZ];
auto double newcint;
auto double exp;
auto int dur;
extern double pay(time_t ts, int dauer, int tarifz, int pro);
for (chan = 0; chan < 2; chan++) {
@ -5219,36 +5089,23 @@ void processcint()
if (call[chan].cinth != hour) { /* Moeglicherweise Taktwechsel */
newcint = taktlaenge(chan, s);
newcint = taktlaenge(chan, why);
if (newcint != call[chan].cint) {
call[chan].cint = newcint;
sprintf(sx, "NEXT CHARGEINT IN %s (%s)", double2clock((double)call[chan].cint), s);
sprintf(sx, "NEXT CHARGEINT IN %s (%s)", double2clock((double)call[chan].cint), why);
info(chan, PRT_SHOWCONNECT, STATE_CONNECT, sx);
}
} /* if */
} /* if */
call[chan].cinth = hour;
call[chan].ctakt++;
if (1 /* message & PRT_SHOWTICKS */) {
#ifdef ISDN_DE
if ((call[chan].provider == -1) || (call[chan].provider == 33))
exp = call[chan].ctakt * currency_factor;
else
/* call pay() with duration + 1 to get the charge for the _next_ chargeint! */
exp = pay(call[chan].connect, dur + 1, call[chan].zone, call[chan].provider);
#else
exp = call[chan].ctakt * currency_factor;
#endif
sprintf(sx, "START %d.CHARGEINT %s %s (%s)",
sprintf(sx, "START %d.CHARGEINT (%s)",
call[chan].ctakt,
currency,
double2str(exp, 6, 2, DEB),
double2clock((double)dur));
info(chan, PRT_SHOWCONNECT, STATE_CONNECT, sx);
} /* if */
call[chan].nextcint += (int)call[chan].cint;
} /* if */

View File

@ -2,7 +2,7 @@
*
* ISDN accounting for isdn4linux. (log-module)
*
* Copyright 1995, 1998 by Andreas Kool (akool@isdn4linux.de)
* Copyright 1995, 1999 by Andreas Kool (akool@isdn4linux.de)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -19,6 +19,17 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log$
* Revision 1.3 1998/11/24 20:51:52 akool
* - changed my email-adress
* - new Option "-R" to supply the preselected provider (-R24 -> Telepassport)
* - made Provider-Prefix 6 digits long
* - full support for internal S0-bus implemented (-A, -i Options)
* - isdnlog now ignores unknown frames
* - added 36 allocated, but up to now unused "Auskunft" Numbers
* - added _all_ 122 Providers
* - Patch from Jochen Erwied <mack@Joker.E.Ruhr.DE> for Quante-TK-Anlagen
* (first dialed digit comes with SETUP-Frame)
*
* Revision 1.2 1998/10/03 18:06:03 akool
* - processor.c, takt_at.c : Patch from Michael Reinelt <reinelt@eunet.at>
* try to guess the zone of the calling/called party
@ -84,7 +95,7 @@ static char tab_tage[2][12] = {{ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
static struct w_ftag t_ftag[A_FEI] = {
{ 1, 1, 1, "Neujahr" },
{ 6, 1, 0, "Hl. Drei Könige" },
{ 6, 1, 1, "Hl. Drei Könige" },
{ 1, 5, 1, "1. Mai" },
{ 0, 0, 1, "Muttertag" },
{ 0, 0, 1, "Karfreitag" },
@ -94,9 +105,10 @@ static struct w_ftag t_ftag[A_FEI] = {
{ 0, 0, 1, "Pfingstsonntag" },
{ 0, 0, 1, "Pfingstmontag" },
{ 0, 0, 0, "Fronleichnam" },
{ 26, 10, 1, "Nationalfeiertag" },
{ 15, 8, 0, "Maria Himmelfahrt" },
{ 1, 11, 0, "Allerheiligen" },
{ 26, 10, 1, "Nationalfeiertag" },
{ 1, 11, 1, "Allerheiligen" },
{ 8, 12, 1, "Maria Empfängnis" },
{ 25, 12, 1, "Christtag" },
{ 26, 12, 1, "2. Weihnachtstag" }};

File diff suppressed because it is too large Load Diff

View File

@ -1,527 +0,0 @@
/* $Id$
*
* ISDN accounting for isdn4linux. (Feiertagsberechnung)
*
* Copyright 1995, 1998 by Andreas Kool (akool@isdn4linux.de)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log$
* Revision 1.4 1998/04/09 19:15:21 akool
* - CityPlus Implementation from Oliver Lauer <Oliver.Lauer@coburg.baynet.de>
* - dont change huptimeout, if disabled (via isdnctrl huptimeout isdnX 0)
* - Support for more Providers (TelePassport, Tele 2, TelDaFax)
*
* Revision 1.3 1997/04/03 22:29:59 luethje
* improved performance
*
* Revision 1.2 1997/03/24 22:52:08 luethje
* isdnrep completed.
*
* Revision 1.1 1997/03/16 20:59:02 luethje
* Added the source code isdnlog. isdnlog is not working yet.
* A workaround for that problem:
* copy lib/policy.h into the root directory of isdn4k-utils.
*
*
* Revision 2.6.24 1997/01/12 20:51:21 akool
* City Weekend Tarif implemented (Thanks to Oliver Schoett <schoett@muc.de>)
*
* Revision 2.6.11 1996/12/30 10:05:21 Ad Aerts <ad@aasup.nl>
* Dutch accounting
*
* Revision 2.50 1996/08/24 10:47:21 akool
* Korrektur bei Taktberechnung Wochenende/Feiertage (Jochen Heuer)
*
* Revision 2.43 1996/07/04 09:52:21 akool
* Korrektur bei Taktberechnung City (Jochen Heuer)
*
* Revision 2.40 1996/06/19 01:55:21 akool
* Neue Tarife ab 1.7.96 implementiert
*
* Revision 2.3.27 1996/05/06 17:51:21 akool
* Korrektur bei Taktberechnung Regio 200
*
* Revision 2.01 1996/01/19 19:12:21 akool
* Korrektur bei Taktberechnung (Citytarif, 5:00 .. 9:00 war 240s, muss
* aber 150s heissen!)
*
* Revision 2.00 1996/01/10 20:10:21 akool
*
* Revision 1.22 1995/10/21 17:23:21 akool
* Tarife 1996 entsprechend Telekom-Unterlagen korrigiert
*
* Revision 1.14 1995/10/05 19:02:21 akool
* Ueberschreitung verschiedener Zeittakte bei einer Verbindung implementiert.
*
* Revision 1.2 1995/09/30 16:39:21 akool
* Um neue Tarifstruktur der Telekom ab 1.1.96 erweitert
* First public release
*
* Revision 1.1 1990/11/10 23:15:11 akool
* Initial revision (Code-Teile aus irgend einer alten c't)
*
*/
#define _CHEAP_C_
#include "isdnrep.h"
#define MUTT 3
#define KARF 4
#define OST1 5
#define OST2 6
#define CHRI 7
#define PFI1 8
#define PFI2 9
#define FRON 10
#define EINH 11
#define MARI 12
#define ALLE 13
#define BUSS 14
#define A_FEI 17
struct w_ftag {
char tag;
char monat;
char telekom; /* TRUE, wenn auch fuer die Deutsche Telekom ein Feiertag (siehe Telefonbuch!) */
};
static struct {
int tag;
int monat;
int jahr;
int tgind;
} _datum;
static char tab_tage[2][12] = {{ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
{ 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }};
static struct w_ftag t_ftag[A_FEI] = {
#ifdef ISDN_NL
{ 1, 1, 1 }, /* Neujahr */
{ 6, 1, 0 }, /* Erscheinungsfest - nur Baden-Wuerttemberg und Bayern */
{ 1, 5, 0 }, /* Maifeiertag */
{ 0, 0, 0 }, /* Muttertag */
{ 0, 0, 0 }, /* Karfreitag */
{ 0, 0, 1 }, /* Ostersonntag */
{ 0, 0, 1 }, /* Ostermontag */
{ 0, 0, 0 }, /* Christi Himmelfahrt */
{ 0, 0, 1 }, /* Pfingstsonntag */
{ 0, 0, 1 }, /* Pfingstmontag */
{ 0, 0, 0 }, /* Fronleichnam - nur in Baden-Wuerttemberg, Bayern, Hessen, Nordrhein-Westfalen, Rheinland-Pfalz und im Saarland */
{ 3, 10, 0 }, /* Tag der deutschen Einheit - vor 1990 am 17.6. */
{ 15, 8, 0 }, /* Maria Himmelfahrt - nur Saarland und ueberwiegend katholischen Gemeinden Bayerns */
{ 1, 11, 0 }, /* Allerheiligen - nur Baden-Wuerttemberg, Bayern, Nordrhein-Westfalen, Rheinland-Pfalz und im Saarland */
{ 0, 0, 0 }, /* Buss- und Bettag - nur bis incl. 1994 (wg. Pflegeversicherung abgeschafft) */
{ 25, 12, 1 }, /* 1. Weihnachtsfeiertag */
{ 26, 12, 1 }}; /* 2. Weihnachtsfeiertag */
#else
{ 1, 1, 1 }, /* Neujahr */
{ 6, 1, 0 }, /* Erscheinungsfest - nur Baden-Wuerttemberg und Bayern */
{ 1, 5, 1 }, /* Maifeiertag */
{ 0, 0, 1 }, /* Muttertag */
{ 0, 0, 1 }, /* Karfreitag */
{ 0, 0, 1 }, /* Ostersonntag */
{ 0, 0, 1 }, /* Ostermontag */
{ 0, 0, 1 }, /* Christi Himmelfahrt */
{ 0, 0, 1 }, /* Pfingstsonntag */
{ 0, 0, 1 }, /* Pfingstmontag */
{ 0, 0, 0 }, /* Fronleichnam - nur in Baden-Wuerttemberg, Bayern, Hessen, Nordrhein-Westfalen, Rheinland-Pfalz und im Saarland */
{ 3, 10, 1 }, /* Tag der deutschen Einheit - vor 1990 am 17.6. */
{ 15, 8, 0 }, /* Maria Himmelfahrt - nur Saarland und ueberwiegend katholischen Gemeinden Bayerns */
{ 1, 11, 0 }, /* Allerheiligen - nur Baden-Wuerttemberg, Bayern, Nordrhein-Westfalen, Rheinland-Pfalz und im Saarland */
{ 0, 0, 0 }, /* Buss- und Bettag - nur bis incl. 1994 (wg. Pflegeversicherung abgeschafft) */
{ 25, 12, 1 }, /* 1. Weihnachtsfeiertag */
{ 26, 12, 1 }}; /* 2. Weihnachtsfeiertag */
#endif
static int schalt(register int j)
{
return(((j % 4 == 0) && (j % 100 != 0)) || (j % 400 == 0));
} /* schalt */
static int tag_num(register int t, register int m, register int j)
{
register char *tm = tab_tage[schalt(j)];
while (--m)
t += *tm++;
return(t);
} /* tag_num */
static void num_tag(int jahr, int lfd)
{
register int i;
register char *t;
while (lfd < 1)
lfd += tag_num(31, 12, --jahr);
t = tab_tage[schalt(jahr)];
for (i = 1; lfd > *t && i < 13; i++)
lfd -= *t++;
if (i > 12)
num_tag(++jahr, lfd);
else {
_datum.monat = i;
_datum.tag = lfd;
_datum.jahr = jahr;
} /* else */
} /* num_tag */
static void comp_feier_tage(int jj)
{
static struct w_ftag t_stag[A_FEI];
static int firsttime = 1;
static int l_jj = -1;
register int mm, tt, i, j, a, b;
if (jj == l_jj)
return;
l_jj = jj;
if (firsttime) {
for (i = 0; i < A_FEI; i++)
t_stag[i] = t_ftag[i];
firsttime = 0;
}
else
for (i = 0; i < A_FEI; i++)
t_ftag[i] = t_stag[i];
/* Berechnung von Ostern nach C.F.Gauss */
i = jj / 100 - jj / 400 + 4;
j = i - jj / 300 + 11;
a = (((jj % 19) * 19) + j) % 30;
b = (((jj % 4) * 2 + (4 * jj) + (6 * a) + i) % 7) + a - 9;
if (b < 1) {
tt = 31 + b;
mm = 3;
}
else {
if ((b == 26) || ((a == 28) && (b == 25) && ((11 * (j + 1) % 30) < 19)))
b -= 7;
tt = b;
mm = 4;
} /* else */
num_tag(jj, tag_num(tt, mm, jj));
t_ftag[OST1].monat = _datum.monat; t_ftag[OST1].tag = _datum.tag;
num_tag(jj, 1 + tag_num(_datum.tag, _datum.monat, jj));
t_ftag[OST2].monat = _datum.monat; t_ftag[OST2].tag = _datum.tag;
num_tag(jj, - 3 + tag_num(_datum.tag, _datum.monat, jj));
t_ftag[KARF].monat = _datum.monat; t_ftag[KARF].tag = _datum.tag;
/* Pfingsten */
num_tag(jj, 51 + tag_num(_datum.tag, _datum.monat, jj));
t_ftag[PFI1].monat = _datum.monat; t_ftag[PFI1].tag = _datum.tag;
num_tag(jj, 1 + tag_num(_datum.tag, _datum.monat, jj));
t_ftag[PFI2].monat = _datum.monat; t_ftag[PFI2].tag = _datum.tag;
/* Himmelfahrt */
num_tag(jj, -10 + tag_num(t_ftag[PFI1].tag, t_ftag[PFI1].monat, jj));
t_ftag[CHRI].monat = _datum.monat; t_ftag[CHRI].tag = _datum.tag;
/* Fronleichnam */
num_tag(jj, 11 + tag_num(t_ftag[PFI1].tag, t_ftag[PFI1].monat, jj));
t_ftag[FRON].monat = _datum.monat; t_ftag[FRON].tag = _datum.tag;
} /* comp_feier_tage */
static int billig(time_t when)
{
register int i;
auto struct tm *tm;
tm = localtime(&when);
if (tm->tm_wday == 6) /* Samstag immer */
return(1);
if (tm->tm_wday == 0) /* Sonntag immer */
return(1);
if ((tm->tm_hour > 17) || (tm->tm_hour < 8)) /* zwischen 18:00 .. 7:59 immer */
return(1);
#ifndef ISDN_NL
if ((tm->tm_mday == 24) && (tm->tm_mon == 11)) /* Heilig-Abend immer */
return(1);
if ((tm->tm_mday == 31) && (tm->tm_mon == 11)) /* Sylvester immer */
return(1);
comp_feier_tage(tm->tm_year + 1900);
for (i = 0; i < A_FEI; i++)
if ((t_ftag[i].monat == tm->tm_mon + 1) &&
(t_ftag[i].tag == tm->tm_mday) &&
t_ftag[i].telekom)
return(1);
#endif
return(0); /* Sorry, it's expensive! */
} /* billig */
double cheap(time_t when, int zone)
{
auto double takt = 0.0;
#ifdef ISDN_NL
switch (zone) {
case 1 : takt = 1.000; break; /* local tariff Dfl 0.066/min */
case 2 : takt = 0.316; break; /* long distance Dfl 0.2106/min */
case 3 : takt = 0.074; break; /* International Dfl 0.90/min */
case 4 : takt = 0.070; break; /* International Dfl 0.95/min */
case 5 : takt = 0.060; break; /* International Dfl 1.10/min */
} /* switch */
if (billig(when)) {
takt *= 2.0;
} /* if */
#else
switch (zone) {
case 1 : takt = 360.00; break;
case 2 : takt = 60.00; break;
case 3 : takt = 21.00; break;
case 4 : takt = 21.00; break;
case 5 : takt = 12.00; break;
} /* switch */
if (billig(when)) {
if (takt == 12.00)
takt = 16.00;
else
takt *= 2.0;
} /* if */
#endif
return(takt);
} /* cheap */
double cheap96(time_t when, int zone, int *zeit)
{
#ifdef ISDN_NL
*zeit = 0;
return(cheap(when, zone));
#else
register int i, takt = 0, CityPlus = 0;
auto struct tm *tm;
/* neue Tarife aus: iX 10/95, Pg 32 */
static double gebuehr[3][5][5] =
{{{ 90.00, 90.00, 150.00, 240.00, 240.00 }, /* City */
{ 26.00, 30.00, 45.00, 60.00, 120.00 }, /* Region 50 */
{ 12.00, 13.50, 21.50, 30.00, 120.00 }, /* Region 200 */
{ 11.50, 12.50, 20.00, 25.00, 120.00 }, /* Fern */
{ 30.00, 30.00, 30.00, 30.00, 30.00 }}, /* Angrenzende Laender */
/* Tarife, Wochenendtarife ab 1.7.96 */
{{ 90.00, 90.00, 150.00, 240.00, 240.00 }, /* City */
{ 26.00, 30.00, 45.00, 60.00, 120.00 }, /* Region 50 */
{ 13.00, 14.00, 22.50, 36.00, 120.00 }, /* Region 200 */
{ 12.00, 13.50, 21.50, 30.00, 120.00 }, /* Fern */
{ 26.00, 30.00, 45.00, 60.00, 60.00 }}, /* Vis-'a-vis 1 */
/* Tarife vom 27.-30.12., Feiertagstarife ab 1.7.96 */
{{ 90.00, 90.00, 150.00, 240.00, 240.00 }, /* City */
{ 36.00, 36.00, 45.00, 60.00, 120.00 }, /* Region 50 */
{ 36.00, 36.00, 36.00, 36.00, 120.00 }, /* Region 200 */
{ 36.00, 36.00, 36.00, 36.00, 120.00 }, /* Fern */
{ 26.00, 30.00, 45.00, 60.00, 60.00 }}}; /* Vis-'a-vis 1 */
/* Takt: 1 2 3 4 5
Werktag :
1 = Vormittag 9:00 .. 12:00
2 = Nachmittag 12:00 .. 18:00
3 = Freizeit 18:00 .. 21:00, 5:00 .. 9:00
4 = Mondschein 21:00 .. 2:00
5 = Nacht 2:00 .. 5:00
Wochenende/Feiertag :
3 = Freizeit 5:00 .. 21:00
4 = Mondschein 21:00 .. 5:00
*/
if (zone == 21) {
CityPlus = 1;
zone = 1;
}
tm = localtime(&when);
if ((tm->tm_wday == 6) || (tm->tm_wday == 0)) { /* Samstag/Sonntag */
if ((tm->tm_hour > 4) && (tm->tm_hour < 21)) {
if (CityWeekend && (zone == 1))
takt = 4;
else
takt = 3;
}
else
takt = 4;
} /* if */
if ((tm->tm_mday == 24) && (tm->tm_mon == 11)) /* Heilig-Abend */
takt = 6;
if ((tm->tm_mday == 31) && (tm->tm_mon == 11)) /* Sylvester */
takt = 6;
comp_feier_tage(tm->tm_year + 1900);
for (i = 0; i < A_FEI; i++)
if ((t_ftag[i].monat == tm->tm_mon + 1) &&
(t_ftag[i].tag == tm->tm_mday) &&
t_ftag[i].telekom)
takt = 6;
if ((!takt) || (zone == 5)) {
if ((tm->tm_hour > 8) && (tm->tm_hour < 12))
takt = 1;
else if ((tm->tm_hour > 11) && (tm->tm_hour < 18))
takt = 2;
else if ((tm->tm_hour > 20) || (tm->tm_hour < 2))
takt = 4;
else if ((tm->tm_hour > 1) && (tm->tm_hour < 5))
takt = 5;
else
takt = 3;
} /* if */
if (((tm->tm_year > 95) && (tm->tm_mon > 5)) ||
(tm->tm_year > 96)) { /* Neuer Tarif ab 1.7.96 */
if ((takt == 6) && (zone < 5)) { /* Feiertage */
if ((tm->tm_hour > 4) && (tm->tm_hour < 21)) {
if (CityWeekend && (zone == 1)) {
*zeit = 7;
return(gebuehr[2][zone - 1][3]);
}
else
return(gebuehr[2][zone - 1][*zeit = 2]);
}
else
return(gebuehr[2][zone - 1][*zeit = 3]);
}
else if ((tm->tm_mon == 11) && /* Werktage vom 27.12. .. 30.12. */
(tm->tm_mday > 26) && (zone < 5)) {
return(gebuehr[2][zone - 1][*zeit = --takt]);
}
else { /* Werktage bzw. Wochenenden */
if (((tm->tm_hour > 4) && (tm->tm_hour < 21)) &&
((tm->tm_wday == 6) || (tm->tm_wday == 0))) { /* Wochenende Freizeit */
if (CityWeekend && (zone == 1)) {
*zeit=7;
return(gebuehr[1][zone - 1][3]);
}
else if (((zone == 3) || (zone == 4)) &&
(((tm->tm_year > 97) && (tm->tm_mon > 2)) ||
(tm->tm_year > 98))) { /* GermanCall Freizeit Wochenende ab 01.03.98 30 s */
*zeit=4;
return(30); /* zusätzliche Tarifart, Matrix müßte erweitert werden */
}
else if (CityPlus) {
*zeit=8;
return(gebuehr[1][0][1]);
}
else
return(gebuehr[1][zone - 1][*zeit = --takt]);
}
else if (((tm->tm_hour > 4) && (tm->tm_hour < 21)) && CityPlus) {
*zeit=8;
return(gebuehr[1][0][1]);
}
else
return(gebuehr[1][zone - 1][*zeit = --takt]);
}
}
else {
if (zone == 5) { /* Angrenzende Laender */
*zeit = 0;
return(30);
}
else {
if (takt == 6) { /* Feiertage */
if ((tm->tm_hour > 4) && (tm->tm_hour < 21)) {
*zeit = 9;
return(gebuehr[0][zone - 1][2]);
}
else
return(gebuehr[0][zone - 1][*zeit = 3]);
}
else
return(gebuehr[0][zone - 1][*zeit = --takt]);
} /* else */
} /* else */
#endif
} /* cheap96 */
#ifdef DEBUG_CHEAP
main()
{
auto time_t cur_time, ltime;
auto struct tm *tm;
auto double o = 0.0, n;
time(&cur_time);
tm = localtime(&cur_time);
tm->tm_sec = 0;
tm->tm_min = 0;
tm->tm_hour = 0;
cur_time = ltime = mktime(tm);
while (cur_time - (7L * 24L * 60L * 60L) < ltime) {
n = cheap96(cur_time, 3);
if (n != o) {
printf("%7.2f %s", n, ctime(&cur_time));
o = n;
} /* if */
cur_time += 1L; /* (60L * 60L); */
} /* while */
} /* main */
#endif

View File

@ -1,710 +0,0 @@
#define ISDNLOG 1
#ifdef ISDNLOG
/*
1. "http://www.insider.org/tarif/gebuehr.c" saugen
2. patch -s -p0 < gebuehr.patch
*/
#endif
/*
Gebührenberechnung - Berechnung der jeweils aktuellen Gebühren für Telefon-
anrufe über die verschiedenen auf dem deutschen Markt
vertretenen Provider
Version:
0.01 06.01.98 erste Version, morgen muß noch die automatische
Umschaltung Wochentag/Wochenende reingebaut werden
0.02 07.01.98 Automatische Umschaltung Wochentag/Wochende
0.03 08.01.98 Korrektur diverse Tarife (siehe Windows-Prg
TelcoExplorer)
0.04 09.01.98 Korrektur MobilCom-Tarif
0.05 14.01.98 zusätzliche Provider und Tarife, Neu: Nahbereich
0.06 29.01.98 neue Provider, Umstellung auf 10tel Sekunden
0.07 11.02.98 Welt2-Tarif Isis korrigiert
0.10 08.04.98 Neue Tarife, neue Unterteilung, Berechnung komplett
umgeworfen
(C) 1998 G.Glendown - alle Tarif/Preis-Angaben ohne Gewähr
Aufruf: gebuehr [Tarifzone [Dauer]]
Tarifzone:
1 City
2 Nah
3 Region 50
4 Region 200
5 Region fern
6 Mobilfunk C
7 Mobilfunk D1
8 Mobilfunk D2
9 Mobilfunk E+
10 EuroCity
11 Euro 1
12 Euro 2
13 Welt 1 (Nordamerika)
14 Welt 2
15 Welt 3
16 Welt 4
Default: 4
Dauer: Dauer des Gesprächs in Sekunden
Default: 300 (5 Minuten)
Bugs/Features: - Telekom-Tarife aufgrund blöder Taktung (13,5 sek.)
teilweise gerundet, da die Telekom jedoch grund-
sätzlich (d.h. fast immer) am teuersten ist, sollte
das in den Fällen nicht schlimm sein :-)
- Bedienung etwas spartanisch, es fehlt wenigstens
eine Usage-Ausgabe ...
eMail: garry@insider.regio.net
WWW: http://www.insider.org/tarif
*/
#include <sys/types.h>
#include <sys/time.h>
#ifndef ISDNLOG
static void settime();
#endif
void UpdateList();
struct provider {
char name[16];
unsigned char zuschl;
unsigned char flag;
unsigned long minpr; /* DM/m */
unsigned short prefix;
short longer;
};
#define F_EINH 1 /* Berechnung nach Einheiten */
#define F_NETTO 2 /* Preis ist Netto */
#define F_BER 0x80 /* Preis wurde schon berechnet */
static struct provider prov[] = {
{"Arcor",6,0,0,70}, /* 0 */
{"Interoute",0,0,0,66}, /* 1 */
{"EWE TEL",0,0,0,14}, /* 2 */
{"Mobilcom",0,0,0,19}, /* 3 */
{"KomTel",0,0,0,46}, /* 4 */
{"o.tel.o",6,0,0,11}, /* 5 */
{"Talkline",0,0,0,50}, /* 6 */
{"TelDaFax",0,F_NETTO,0,30}, /* 7 */
{"Telekom",0,F_NETTO|F_EINH,0,33}, /* 8 */
{"TelePassport",0,0,0,24}, /* 9 */
{"",0,0,0,0}, /* 10 */
{"WESTCom",0,0,0,85}, /* 11 */
{"",0,0,0,0}, /* 12 */
{"",0,0,0,0}, /* 13 */
{"Tele2",0,0,0,13}, /* 14 */
{"",0,0,0,0}, /* 15 */
{"tesion))",0,F_NETTO,0,39}, /* 16 */
{"",0,0,0,0}, /* 17 */
{"",0,0,0,0} /* 18 */
};
#define NUMPROV 19
int srt[NUMPROV];
#define BWT 0x10
#define BWE 0x20
#define BFT 0x40
#define BWA 0x70
#define BFCY 1
#define BFNH 2
#define BFR5 4
#define BFR2 8
#define BFFN 16
#define BFMC 32
#define BFD1 64
#define BFD2 128
#define BFME 256
#define BFEY 512
#define BFE1 1024
#define BFE2 2048
#define BFW1 4096
#define BFW2 8192
#define BFW3 16384
#define BFW4 32768
char tarnam[][20]={"City","Nahbereich","Region50","Region200","Fern","C-Netz","D1-Netz", "D2-Netz", "Eplus", "EuroCity","Euro1","Euro2","Nordamerika","Welt2","Welt3","Welt4"};
struct tarif {
signed char prov; /* lfd. Nummer Provider */
unsigned char dist; /* Entfernung (0x0f), Tag (0x70) */
unsigned short taktl; /* Dauer eines Taktes in sek*100 */
unsigned short minpr; /* Preis pro Minute in Pf (alt.z. taktp) */
unsigned char strth; /* */
unsigned char stoph;
};
struct ttable {
signed char prov; /* Provider */
unsigned char tar; /* lfd. Nummer Tarif */
unsigned long tarber; /* Bit-Feld Tarifbereiche */
};
#ifdef ISDNLOG
static struct ttable tt[] = {
#else
struct ttable tt[] = {
#endif
/* Arcor */
{ 0, 0, BFNH|BFR5 },
{ 0, 1, BFR2|BFFN },
{ 0, 2, BFMC|BFD1 },
{ 0, 3, BFD2 },
{ 0, 4, BFME },
{ 0, 5, BFEY|BFE1 },
{ 0, 6, BFE2 },
{ 0, 7, BFW1 },
{ 0, 8, BFW2 },
{ 0, 9, BFW3 },
{ 0, 10, BFW4 },
/* Interoute */
{ 1, 0, BFNH|BFR5 },
{ 1, 1, BFR2|BFFN },
{ 1, 2, BFMC|BFD1|BFD2|BFME },
{ 1, 3, BFEY|BFE1 },
{ 1, 4, BFE2 },
{ 1, 5, BFW1 },
{ 1, 6, BFW2 },
{ 1, 7, BFW3 },
{ 1, 8, BFW4 },
/* EWE TEL */
{ 2, 0, BFR5 },
{ 2, 1, BFR2|BFFN },
{ 2, 2, BFMC },
{ 2, 3, BFD1|BFD2|BFME },
{ 2, 5, BFEY },
{ 2, 6, BFE1 },
{ 2, 7, BFE2 },
{ 2, 8, BFW1 },
{ 2, 9, BFW2 },
{ 2, 10, BFW3 },
{ 2, 11, BFW4 },
/* Mobilcom */
{ 3, 0, BFNH|BFR5|BFR2|BFFN },
{ 3, 1, BFMC|BFD1|BFD2|BFME },
/* KomTel */
{ 4, 0, BFNH|BFR5|BFR2|BFFN },
{ 4, 1, BFMC|BFD1|BFD2|BFME },
{ 4, 2, BFEY|BFE1 },
{ 4, 3, BFE2 },
{ 4, 4, BFW1 },
{ 4, 5, BFW2 },
{ 4, 6, BFW3|BFW4 },
/* o.tel.o */
{ 5, 0, BFNH },
{ 5, 1, BFR5 },
{ 5, 2, BFR2|BFFN },
{ 5, 3, BFMC },
{ 5, 4, BFD1|BFD2 },
{ 5, 6, BFME },
{ 5, 7, BFEY|BFE1|BFW1 },
{ 5, 8, BFE2 },
{ 5, 10, BFW2 },
{ 5, 11, BFW3 },
{ 5, 12, BFW4 },
/* Talkline */
{ 6, 0, BFR2|BFFN },
{ 6, 1, BFMC|BFD1|BFD2|BFME },
{ 6, 2, BFEY|BFE1|BFW1 },
{ 6, 3, BFW4 },
/* TelDaFax */
{ 7, 0, BFNH|BFR5 },
#ifdef ISDNLOG
{ 7, 1, BFR2|BFFN },
#else
{ 7, 1, BFR5|BFFN },
#endif
{ 7, 2, BFMC|BFD1|BFD2|BFME },
{ 7, 3, BFEY },
{ 7, 4, BFE1 },
{ 7, 5, BFE2 },
{ 7, 6, BFW1 },
{ 7, 7, BFW2 },
{ 7, 8, BFW3 },
{ 7, 9, BFW4 },
/* Telekoma */
{ 8, 0, BFCY|BFNH },
{ 8, 2, BFR5 },
{ 8, 3, BFR2|BFFN },
{ 8, 4, BFMC|BFD1 },
{ 8, 5, BFD2 },
{ 8, 6, BFME },
{ 8, 7, BFEY },
{ 8, 8, BFE1 },
{ 8, 9, BFE2 },
{ 8, 10, BFW1 },
{ 8, 11, BFW2 },
{ 8, 12, BFW3 },
{ 8, 13, BFW4 },
/* TelePassPort */
{ 9, 0, BFNH|BFR5 },
{ 9, 1, BFR2|BFFN },
{ 9, 2, BFMC|BFD1|BFD2|BFME },
{ 9, 3, BFEY|BFE1 },
{ 9, 4, BFE2 },
{ 9, 5, BFW1 },
{ 9, 6, BFW2 },
{ 9, 7, BFW3 },
{ 9, 8, BFW4 },
/* WestCom */
{ 11, 0, BFNH|BFR5 },
{ 11, 1, BFR2 },
{ 11, 2, BFFN },
{ 11, 3, BFMC|BFD1|BFD2|BFME },
{ 11, 4, BFEY|BFE1 },
{ 11, 5, BFE2 },
{ 11, 6, BFW1 },
{ 11, 7, BFW2 },
{ 11, 8, BFW3 },
{ 11, 9, BFW4 },
/* tele2 */
{ 14, 0, BFNH|BFR5|BFR2|BFFN },
{ 14, 2, BFMC|BFD1|BFD2|BFME },
{ 14, 3, BFEY|BFW1 },
{ 14, 4, BFE1 },
{ 14, 5, BFE2 },
{ 14, 6, BFW2 },
{ 14, 7, BFW3 },
{ 14, 8, BFW4 },
/* tesion */
{ 16, 0, BFNH|BFR5|BFR2|BFFN },
{ 16, 1, BFMC|BFD1|BFD2|BFME },
{ 16, 2, BFEY|BFE1 },
{ 16, 3, BFE2 },
{ 16, 4, BFW1 },
{ 16, 5, BFW2|BFW3 },
{ 16, 6, BFW4 },
{ -1, 0, 0 }};
struct tarif tarife[] = {
/* arcor */
{ 0, 0|BWT, 100, 150, 9,17},
{ 0, 0|BWA, 100, 110, 5,20},
{ 0, 0|BWA, 100, 75, 0,23},
{ 0, 1|BWT, 100, 480, 9,17},
{ 0, 1|BWT, 100, 280, 5,20},
{ 0, 1|BWA, 100, 190, 0,23},
{ 0, 2|BWT, 100, 960, 9,17},
{ 0, 2|BWA, 100, 480, 0,23},
{ 0, 3|BWT, 100, 940, 9,17},
{ 0, 3|BWA, 100, 460, 0,23},
{ 0, 4|BWT, 100, 1250, 9,17},
{ 0, 4|BWA, 100, 560, 0,23},
{ 0, 5|BWA, 100, 680, 0,23},
{ 0, 6|BWA, 100, 960, 0,23},
{ 0, 7|BWA, 100, 720, 0,23},
{ 0, 8|BWA, 100, 1690, 0,23},
{ 0, 9|BWA, 100, 2590, 0,23},
{ 0, 10|BWA, 100, 2720, 0,23},
/* Interoute */
{ 1, 0|BWT, 100, 200, 9,17},
{ 1, 0|BWA, 100, 150, 6,20},
{ 1, 0|BWA, 100, 110, 0,23},
{ 1, 1|BWT, 100, 360, 9,17},
{ 1, 1|BWA, 100, 200, 6,20},
{ 1, 1|BWA, 100, 150, 0,23},
{ 1, 2|BWT, 100, 890, 9,17},
{ 1, 2|BWA, 100, 560, 0,23},
{ 1, 3|BWT, 100, 690, 9,17},
{ 1, 3|BWA, 100, 590, 0,23},
{ 1, 4|BWA, 100, 980, 0,23},
{ 1, 5|BWA, 100, 680, 6,20},
{ 1, 5|BWA, 100, 580, 0,23},
{ 1, 6|BWA, 100, 1290, 6,20},
{ 1, 6|BWA, 100, 1190, 0,23},
{ 1, 7|BWA, 100, 1990, 0,23},
{ 1, 8|BWA, 100, 2190, 0,23},
/* EWE TEL */
{ 2, 0|BWT, 100, 210, 9,17},
{ 2, 0|BWT, 100, 160, 18,20},
{ 2, 0|BWT, 100, 120, 0,23},
{ 2, 0|BWE, 100, 120, 9,17},
{ 2, 0|BWE, 100, 100, 0,23},
{ 2, 1|BWT, 100, 420, 9,17},
{ 2, 1|BWA, 100, 220, 18,20},
{ 2, 1|BWE, 100, 240, 9,17},
{ 2, 1|BWA, 100, 190, 0,23},
{ 2, 2|BWA, 100, 1290, 9,17},
{ 2, 2|BWA, 100, 620, 0,23},
{ 2, 3|BWA, 100, 1290, 9,17},
{ 2, 3|BWA, 100, 550, 0,23},
{ 2, 5|BWA, 100, 620, 0,23},
{ 2, 6|BWA, 100, 690, 0,23},
{ 2, 7|BWA, 100, 1040, 0,23},
{ 2, 8|BWA, 100, 690, 0,23},
{ 2, 9|BWA, 100, 1790, 0,23},
{ 2, 10|BWA, 100, 2290, 0,23},
{ 2, 11|BWA, 100, 3090, 0,23},
/* Mobilcom */
{ 3, 0|BWA, 6000, 190, 0,23},
{ 3, 1|BWA, 6000, 990, 0,23},
/* KomTel */
{ 4, 0|BWA, 100, 450, 8,19},
{ 4, 0|BWA, 100, 300, 0,23},
{ 4, 1|BWA, 100, 1000, 8,19},
{ 4, 1|BWA, 100, 700, 0,23},
{ 4, 2|BWA, 100, 700, 8,19},
{ 4, 2|BWA, 100, 600, 0,23},
{ 4, 3|BWA, 100, 1500, 0,23},
{ 4, 4|BWA, 100, 1000, 0,23},
{ 4, 5|BWA, 100, 2000, 0,23},
{ 4, 6|BWA, 100, 3000, 0,23},
/* o.tel.o */
{ 5, 0|BWT, 100, 120, 9,17},
{ 5, 0|BWA, 100, 60, 0,23},
{ 5, 1|BWT, 100, 240, 9,17},
{ 5, 1|BWA, 100, 120, 0,23},
{ 5, 2|BWT, 100, 480, 9,17},
{ 5, 2|BWA, 100, 240, 0,23},
{ 5, 3|BWT, 100, 1330, 9,17},
{ 5, 3|BWA, 100, 630, 0,23},
{ 5, 4|BWT, 100, 1330, 9,17},
{ 5, 4|BWA, 100, 550, 0,23},
{ 5, 6|BWT, 100, 990, 9,17},
{ 5, 6|BWA, 100, 490, 0,23},
{ 5, 7|BWA, 100, 690, 0,23},
{ 5, 8|BWA, 100, 990, 0,23},
{ 5, 10|BWA, 100, 1990, 0,23},
{ 5, 11|BWA, 100, 2390, 0,23},
{ 5, 12|BWA, 100, 2790, 0,23},
/* Talkline */
{ 6, 0|BWT, 1000, 440, 9,17},
{ 6, 0|BWA, 1000, 220, 0,23},
{ 6, 1|BWT, 1000, 990, 9,17},
{ 6, 1|BWA, 1000, 550, 0,23},
{ 6, 2|BWA, 1000, 790, 0,23},
{ 6, 3|BWA, 1000, 3000, 0,23},
/* TelDaFax */
{ 7, 0|BWT, 100, 190, 5,8},
{ 7, 0|BWA, 100, 160, 5,20},
{ 7, 0|BWA, 100, 120, 0,23},
{ 7, 1|BWT, 100, 340, 9,17},
{ 7, 1|BWA, 100, 190, 5,20},
{ 7, 1|BWA, 100, 120, 0,23},
{ 7, 2|BWT, 100, 790, 9,17},
{ 7, 2|BWA, 100, 410, 0,23},
{ 7, 3|BWT, 100, 510, 8,17},
{ 7, 3|BWA, 100, 480, 0,23},
{ 7, 4|BWT, 100, 590, 8,17},
{ 7, 4|BWA, 100, 480, 0,23},
{ 7, 5|BWA, 100, 580, 0,23},
{ 7, 6|BWA, 100, 590, 0,23},
{ 7, 7|BWA, 100, 1580, 0,23},
{ 7, 8|BWA, 100, 1850, 0,23},
{ 7, 9|BWA, 100, 2100, 0,23},
/* Telekomik */
{ 8, 0|BWT, 1043, 900, 9,17},
{ 8, 0|BWA, 1043, 1500, 5,20},
{ 8, 0|BWA, 1043, 2400, 0,23},
/* telekom Regio Call */
{ 8, 2|BWT, 1043, 1200, 2, 4},
{ 8, 2|BWT, 1043, 260, 9,11},
{ 8, 2|BWT, 1043, 300, 12,17},
{ 8, 2|BWA, 1043, 450, 5,20},
{ 8, 2|BWA, 1043, 600, 0,23},
/* Telekom German Call */
{ 8, 3|BWT, 1043, 1200, 2, 4},
{ 8, 3|BWT, 1043, 130, 9,11},
{ 8, 3|BWT, 1043, 140, 12,17},
{ 8, 3|BWT, 1043, 225, 5,20},
{ 8, 3|BWE, 1043, 300, 5,20},
{ 8, 3|BWA, 1043, 360, 0,23},
/* Telekom D-Netz */
{ 8, 4|BWT, 1043, 75, 9,17},
{ 8, 4|BWA, 1043, 150, 0,23},
{ 8, 5|BWT, 1043, 54, 9,17},
{ 8, 5|BWA, 1043, 130, 0,23},
{ 8, 6|BWT, 1043, 53, 9,17},
{ 8, 6|BWA, 1043, 128, 0,23},
/* Telekom EuroCity */
{ 8, 7|BWA, 1043, 100, 0,23},
/* Telekom Euro1 */
{ 8, 8|BWT, 1043, 86, 8,17},
{ 8, 8|BWA, 1043, 100, 0,23},
{ 8, 9|BWA, 1043, 60, 0,23},
/* Telekom Welt1 */
{ 8, 10|BWA, 1043, 100, 3,13},
{ 8, 10|BWA, 1043, 86, 0,23},
{ 8, 11|BWA, 1043, 33, 0,23},
{ 8, 12|BWA, 1043, 26, 0,23},
{ 8, 13|BWA, 1043, 23, 0,23},
/* Telepassport */
{ 9, 0|BWT, 100, 220, 9,17},
{ 9, 0|BWA, 100, 180, 0,23},
{ 9, 1|BWT, 100, 380, 9,17},
{ 9, 1|BWA, 100, 220, 5,20},
{ 9, 1|BWA, 100, 180, 0,23},
{ 9, 2|BWT, 100, 880, 9,17},
{ 9, 2|BWA, 100, 580, 0,23},
{ 9, 3|BWA, 100, 680, 0,23},
{ 9, 4|BWA, 100, 980, 0,23},
{ 9, 5|BWA, 100, 680, 0,23},
{ 9, 6|BWA, 100, 1280, 0,23},
{ 9, 7|BWA, 100, 2180, 0,23},
{ 9, 8|BWA, 100, 2280, 0,23},
/* Westcom */
{ 11, 0|BWA, 100, 80, 2,4},
{ 11, 0|BWA, 100, 200, 9,17},
{ 11, 0|BWA, 100, 160, 0,23},
{ 11, 1|BWA, 100, 80, 2,4},
{ 11, 1|BWA, 100, 200, 5,20},
{ 11, 1|BWA, 100, 330, 9,17},
{ 11, 1|BWA, 100, 160, 0,23},
{ 11, 2|BWA, 100, 80, 2,4},
{ 11, 2|BWA, 100, 200, 5,8},
{ 11, 2|BWA, 100, 330, 9,17},
{ 11, 2|BWA, 100, 210, 18,20},
{ 11, 2|BWA, 100, 160, 0,23},
{ 11, 3|BWA, 100, 740, 9,17},
{ 11, 3|BWA, 100, 600, 0,23},
{ 11, 4|BWA, 100, 630, 0,23},
{ 11, 5|BWA, 100, 970, 0,23},
{ 11, 6|BWA, 100, 630, 0,23},
{ 11, 7|BWA, 100, 1510, 0,23},
{ 11, 8|BWA, 100, 1940, 0,23},
{ 11, 9|BWA, 100, 2210, 0,23},
/* Citykom Münster */
/*
{ 13, BFCY|BWT, 1100, 0, 900, 9,19},
{ 13, BFCY|BWA, 1100, 0, 1500, 9,19},
{ 13, BFCY|BWA, 1100, 0, 1650, 0,23},
{ 13, BFNH|BWT, 1100, 0, 900, 9,19},
{ 13, BFNH|BWA, 1100, 0, 1500, 9,19},
{ 13, BFNH|BWA, 1100, 0, 1650, 0,23},
{ 13, BFR5|BWT, 1100, 0, 300, 9,19},
{ 13, BFR5|BWA, 1100, 0, 450, 9,19},
{ 13, BFR5|BWA, 1100, 0, 600, 0,23},
{ 13, BFR2|BWT, 1100, 0, 250, 9,19},
{ 13, BFR2|BWA, 1100, 0, 400, 9,19},
{ 13, BFR2|BWA, 1100, 0, 600, 0,23},
{ 13, BFFN|BWT, 1100, 0, 250, 9,19},
{ 13, BFFN|BWA, 1100, 0, 400, 9,19},
{ 13, BFFN|BWA, 1100, 0, 600, 0,23},
{ 13, BFML|BWT, 1100, 0, 51, 9,19},
{ 13, BFML|BWA, 1100, 0, 112, 9,19},
{ 13, BFML|BWA, 1100, 0, 112, 0,23},
{ 13, BFEY|BWA, 1100, 0, 92, 0,23},
{ 13, BFE1|BWA, 1100, 0, 57, 0,23},
{ 13, BFE2|BWA, 1100, 0, 57, 0,23},
{ 13, BFW1|BWA, 1100, 0, 50, 0,23},
{ 13, BFW2|BWA, 1100, 0, 30, 0,23},
{ 13, BFW3|BWA, 1100, 0, 26, 0,23},
{ 13, BFW4|BWA, 1100, 0, 23, 0,23},
*/
/* Tele2 */
/*
{ 14, BFR5|BWT, 100, 7, 0, 2,4},
{ 14, BFR5|BWT, 100, 23, 0, 9,17},
{ 14, BFR5|BWA, 100, 15, 0, 5,20},
{ 14, BFR5|BWA, 100, 11, 0, 0,23},
{ 14, BFR2|BWT, 100, 7, 0, 2,4},
{ 14, BFR2|BWT, 100, 23, 0, 18,20},
{ 14, BFR2|BWA, 100, 30, 0, 5,20},
{ 14, BFR2|BWA, 100, 20, 0, 0,23},
{ 14, BFFN|BWT, 100, 7, 0, 2,4},
{ 14, BFFN|BWT, 100, 23, 0, 18,20},
{ 14, BFFN|BWA, 100, 30, 0, 5,20},
{ 14, BFFN|BWE, 100, 30, 0, 0,23},
*/
{ 14, 0|BWT, 100, 200, 9,17},
{ 14, 0|BWT, 100, 150, 0,23},
{ 14, 0|BWE, 100, 100, 0,23},
{ 14, 2|BWT, 100, 916, 8,17},
{ 14, 2|BWA, 100, 824, 0,23},
{ 14, 3|BWT, 100, 684, 8,17},
{ 14, 3|BWA, 100, 580, 0,23},
{ 14, 4|BWT, 100, 804, 8,17},
{ 14, 4|BWA, 100, 684, 0,23},
{ 14, 5|BWT, 100, 1148, 8,17},
{ 14, 5|BWA, 100, 974, 0,23},
{ 14, 7|BWT, 100, 2540, 8,17},
{ 14, 7|BWA, 100, 2158, 0,23},
{ 14, 8|BWT, 100, 2865, 8,17},
{ 14, 8|BWA, 100, 2436, 0,23},
/* Debitel, kein CbC */
/*{ 15, BFCY|BWA, 6000, 230, 0, 0,23},
{ 15, BFNH|BWA, 6000, 230, 0, 0,23},
{ 15, BFR5|BWA, 6000, 230, 0, 0,23},
{ 15, BFR2|BWA, 6000, 230, 0, 0,23},
{ 15, BFFN|BWA, 6000, 230, 0, 0,23},*/
/* tesion */
{ 16, 0|BWA, 100, 380, 9,20},
{ 16, 0|BWA, 100, 260, 0,23},
{ 16, 1|BWA, 100, 980, 9,20},
{ 16, 1|BWA, 100, 480, 0,23},
{ 16, 2|BWA, 100, 590, 9,20},
{ 16, 2|BWA, 100, 470, 0,23},
{ 16, 3|BWA, 100, 790, 9,20},
{ 16, 3|BWA, 100, 530, 0,23},
{ 16, 4|BWA, 100, 890, 9,20},
{ 16, 4|BWA, 100, 800, 0,23},
{ 16, 5|BWA, 100, 1690, 0,23},
{ 16, 6|BWA, 100, 1990, 0,23},
/* Hutchison */
/*
{ 17, BFR5|BWT, 1000, 220, 0, 9,20},
{ 17, BFR5|BWA, 1000, 170, 0, 0,23},
{ 17, BFR2|BWT, 1000, 440, 0, 9,20},
{ 17, BFR2|BWA, 1000, 220, 0, 0,23},
{ 17, BFFN|BWT, 1000, 440, 0, 9,20},
{ 17, BFFN|BWA, 1000, 220, 0, 0,23},*/
/* Esprit Telecom */
/*
{ 18, BFCY|BWA, 100, 230, 0, 0,23},
{ 18, BFNH|BWA, 100, 230, 0, 0,23},
{ 18, BFR5|BWA, 100, 230, 0, 8,17},
{ 18, BFR5|BWA, 100, 130, 0, 0,23},
{ 18, BFR2|BWA, 100, 380, 0, 8,17},
{ 18, BFR2|BWA, 100, 170, 0, 0,23},
{ 18, BFFN|BWA, 100, 380, 0, 8,17},
{ 18, BFFN|BWA, 100, 170, 0, 0,23},
{ 18, BFML|BWA, 100, 880, 0, 8,17},
{ 18, BFML|BWA, 100, 360, 0, 0,23},
{ 18, BFEY|BWA, 100, 540, 0, 0,23},
{ 18, BFE1|BWA, 100, 610, 0, 0,23},
{ 18, BFE2|BWA, 100, 1140, 0, 0,23},
{ 18, BFW1|BWA, 100, 860, 0, 0,23},
{ 18, BFW2|BWA, 100, 1440, 0, 0,23},
{ 18, BFW3|BWA, 100, 2070, 0, 0,23},
{ 18, BFW4|BWA, 100, 2340, 0, 0,23},*/
{ -1, 0, 0, 0, 0,0}};
#ifndef ISDNLOG
int tarifz;
unsigned char wt;
char tmp[10];
int dauer;
#endif
unsigned long ftage[] = {19980410,19980413,19980501,19980521, 19980601,0};
#ifndef ISDNLOG
main(argc,argv)
int argc;
char *argv[];
{
dauer=300;
if (argc==1)
tarifz=4;
else
tarifz=atoi(argv[1]);
if (argc==3)
dauer=atoi(argv[2]);
UpdateList();
}
#endif
#ifdef ISDNLOG
double pay(time_t ts, int dauer, int tarifz, int pro)
#else
void UpdateList()
#endif
{
#ifdef ISDNLOG
long t,z,g,ft;
#else
long t,z,g,r,s,ft;
#endif
unsigned char tarnum;
struct tm *dt;
#ifndef ISDNLOG
time_t ts;
#endif
unsigned long tarbit;
#ifndef ISDNLOG
ts=time(NULL);
#endif
#ifdef ISDNLOG
unsigned char wt;
int e = -1;
#endif
/* ts-=3600; */
dt=localtime(&ts);
ft=(1900+dt->tm_year)*10000+(1+dt->tm_mon)*100+dt->tm_mday;
if (dt->tm_wday >0 && dt->tm_wday < 6) wt=BWT;
else wt=BWE;
t=0;
while (ftage[t]) {if (ftage[t]==ft) wt=BWE; t++;}
#ifndef ISDNLOG
printf("%d\n",wt);
#endif
for (t=0;t<NUMPROV;t++) prov[t].flag&=0x7f,prov[t].minpr=0;
tarbit=1;
t=tarifz;
while (t>1) tarbit<<=1,t--;
#ifndef ISDNLOG
printf("Tarifbits: %lx\n",tarbit);
#endif
t=0;
while (tt[t].prov>=0) {
#ifdef ISDNLOG
if (!(prov[tt[t].prov].flag&0x80) && (prov[tt[t].prov].prefix == pro)) {
e = tt[t].prov;
#else
if (!(prov[tt[t].prov].flag&0x80)) {
#endif
if (tt[t].tarber&tarbit) {
tarnum=tt[t].tar;
z=t;
t=0;
while (tarife[t].prov>=0) {
if ((tarife[t].prov==tt[z].prov) &&
((tarife[t].dist&0xf)==tarnum) &&
(tarife[t].dist&wt)) {
if (dt->tm_hour >= tarife[t].strth && dt->tm_hour <= tarife[t].stoph) {
prov[tarife[t].prov].flag|=0x80;
if (!(prov[tarife[t].prov].flag&F_EINH)) { /* Preis pro Minute abrechnen */
g=(dauer*100L+tarife[t].taktl-1)/tarife[t].taktl;
prov[tarife[t].prov].longer=(g*tarife[t].taktl/100)-dauer;
g=g*tarife[t].taktl/60;
prov[tarife[t].prov].minpr=prov[tarife[t].prov].zuschl+((g*tarife[t].minpr)+500)/1000;
if (prov[tarife[t].prov].flag&F_NETTO)
prov[tarife[t].prov].minpr=((prov[tarife[t].prov].minpr*116)+50)/100;
goto exitwhile1;
}
else { /* Einheiten */
g=(10*dauer+tarife[t].minpr-1)/tarife[t].minpr;
prov[tarife[t].prov].minpr=g*tarife[t].taktl/100;
if (prov[tarife[t].prov].flag&F_NETTO)
prov[tarife[t].prov].minpr=((prov[tarife[t].prov].minpr*116)+50)/100;
prov[tarife[t].prov].longer=(short)((g*tarife[t].minpr-10*dauer)/10);
goto exitwhile1;
}
}
}
t++;
}
exitwhile1:
t=z;
}
}
t++;
}
#ifndef ISDNLOG
printf("Tarife für %d:%02d Minuten in Tarifzone %s um %d:%02d\n\n",dauer/60, dauer%60,tarnam[tarifz-1],dt->tm_hour, dt->tm_min);
for (t=0;t<NUMPROV;t++) srt[t]=t;
for (t=0;t<NUMPROV-1;t++) {
r=prov[srt[t]].minpr;
s=t;
for (g=t+1;g<NUMPROV;g++) {
if (prov[srt[g]].minpr<r)
r=prov[srt[g]].minpr,s=g;
}
r=srt[t];
srt[t]=srt[s];
srt[s]=r;
}
for (t=0;t<NUMPROV;t++) {
if (prov[srt[t]].flag&0x80) {
printf("%-16s (010%2d) %3d.%02d\n",prov[srt[t]].name,prov[srt[t]].prefix,prov[srt[t]].minpr/100,
prov[srt[t]].minpr%100);
}
}
#else
return((e == -1) ? -1.0 : (prov[e].minpr / 100.0));
#endif
}

View File

@ -2,7 +2,7 @@
*
* ISDN accounting for isdn4linux. (Report-module)
*
* Copyright 1995, 1998 by Andreas Kool (akool@isdn4linux.de)
* Copyright 1995, 1999 by Andreas Kool (akool@isdn4linux.de)
* and Stefan Luethje (luethje@sl-gw.lake.de)
*
* This program is free software; you can redistribute it and/or modify
@ -24,6 +24,15 @@
*
*
* $Log$
* Revision 1.52 1998/12/09 20:39:54 akool
* - new option "-0x:y" for leading zero stripping on internal S0-Bus
* - new option "-o" to suppress causes of other ISDN-Equipment
* - more support for the internal S0-bus
* - Patches from Jochen Erwied <mack@Joker.E.Ruhr.DE>, fixes TelDaFax Tarif
* - workaround from Sebastian Kanthak <sebastian.kanthak@muehlheim.de>
* - new CHARGEINT chapter in the README from
* "Georg v.Zezschwitz" <gvz@popocate.hamburg.pop.de>
*
* Revision 1.51 1998/11/24 20:52:41 akool
* - changed my email-adress
* - new Option "-R" to supply the preselected provider (-R24 -> Telepassport)
@ -2041,7 +2050,9 @@ static void how_expensive(one_call *cur_call)
{
register int zone = -1, zone2 = -1, pro = -1, dur = (int)cur_call->duration;
auto double pay2, onesec;
#if OLD
extern double pay(time_t ts, int dauer, int tarifz, int pro);
#endif
if (!cur_call->dir && (dur > 0) && (cur_call->dm <= 0.0)) {
@ -2086,10 +2097,14 @@ static void how_expensive(one_call *cur_call)
pro = preselect;
if (pro) {
#if OLD
cur_call->dm = pay(cur_call->t, (int)cur_call->duration, zone, pro);
#endif
if (cur_call->dm <= 0.0) { /* ooops - not supported by that provider ... retry with Telekom */
#if OLD
cur_call->dm = pay(cur_call->t, (int)cur_call->duration, zone, pro = 33);
#endif
cur_call->provider = 0;
} /* if */
} /* if */
@ -2112,7 +2127,9 @@ static int print_entries(one_call *cur_call, double unit, int *nx, char *myname)
{
register int i, pro;
auto int computed = 0;
#if OLD
extern double pay(time_t ts, int dauer, int tarifz, int pro);
#endif
#if 0
register int tarifz;
auto double takt;
@ -2160,10 +2177,10 @@ static int print_entries(one_call *cur_call, double unit, int *nx, char *myname)
case 3 : tarifz = 4;
break;
} /* switch */
#if OLD
unit = cur_call->dm = cur_call->dm =
pay(cur_call->t, (int)cur_call->duration, tarifz, pro);
#endif
cur_call->eh = 0;
} /* if */
usage_provider[pro]++;

View File

@ -0,0 +1,8 @@
# Kennzahl 98, mögliche Varianten:
# 0=Nikoma Minutentakt
# 1=Nikoma Sekundentakt
# 2=Nikocity Minutentakt
# 3=Nikocity Sekundentakt
# 4=Mox Telecom AG
# 5=C@llas Clever Communications
P:98=4

View File

@ -1,3 +1,4 @@
# Copyright 1995, 1999 by Andreas Kool (akool@isdn4linux.de)
0010 |free| | | | | Operator Service | Handvermittlung Inland und Ausland. Eine T-Net-Verbindung zu dieser RufNr. ist kostenlos. Nach erfolgreicher Vermittlung werden die fuer das Gesprach geltenden Verbindungstarife erhoben.
0031800 |free| | | | | Plus Freephone Service (Niederl.) | Plus Freephone Service (Niederlande). Eine T-Net-Verbindung zu dieser Rufnummer ist kostenfrei.
0041800 |free| | | | | Plus Freephone Service (Schweiz) | Plus Freephone Service (Schweiz). Eine T-Net-Verbindung zu dieser Rufnummer ist kostenfrei.
@ -71,9 +72,9 @@
01141 |City| | | | | Auftrags-und Ansagedienst | Auftrags- und Ansagedienst. Sie erreichen diesen Dienst zum Citytarif. Weitere Informationen erhalten Sie unter dieser RufNr. oder der RufNr. 0 11 14 (zum Nulltarif).
0115 |City| | | | | Ansagen (regional) | Regionale Ansagedienste. Sie erreichen diesen Dienst zum Citytarif.
0116 |City| | | | | Ansagen (bundesweit) | Bundesweite Ansagedienste. Sie erreichen diesen Dienst zum Citytarif.
01171 |free| | | | | St”rungsannahme PK | Privatkundenservice der Deutschen Telekom. Eine T-Net-Verbindung zu dieser Rufnummer ist kostenfrei.
01172 |free| | | | | St”rungsannahme GK | Geschaftskundenservice der Deutschen Telekom. Eine T-Net-Verbindung zu dieser Rufnummer ist kostenfrei.
01174 |free| | | | | St”rungsannahme Kabelfernsehen Deutsche Telekom. | St”rungsstelle fuer Kabelfernsehen. Eine T-Net-Verbindung zu dieser Rufnummer ist kostenfrei.
01171 |free| | | | | alte St”rungsannahme PK | Privatkundenservice der Deutschen Telekom. Eine T-Net-Verbindung zu dieser Rufnummer ist kostenfrei.
01172 |free| | | | | alte St”rungsannahme GK | Geschaftskundenservice der Deutschen Telekom. Eine T-Net-Verbindung zu dieser Rufnummer ist kostenfrei.
01174 |free| | | | | alte St”rungsannahme Kabelfernsehen DTAG | St”rungsstelle fuer Kabelfernsehen. Eine T-Net-Verbindung zu dieser Rufnummer ist kostenfrei.
01189 | | | | 3.8 | 3.8 | Auskunft T-Komfort | Komfortauskunft Inland.
01191 |City| | | | | Zeitansage | Zeitansage.Sie erreichen diesen Dienst zum Citytarif.
0130 |free| | | | | freecall 0130 | freecall 0130. Eine T-Net-Verbindung zu dieser Rufnummer ist kostenfrei.
@ -162,6 +163,7 @@
0191011 |City| | | | | Online-Dienste Zugang PPP | Selbstwahlverbindungen zum Zugang Online-Dienste. Sie erreichen diesen Dienst zum Citytarif.
01914 |City| | | | | Online-Dienste AOL Zugang | Selbstwahlverbindungen zum Zugang Online-Dienst von AOL Es gelten die Preise f<>r CityCall Verbindungen
0191023 |City| | | | | Online-Dienste 1&1 |
0191501 |? | | | | | o.tel.o Online Zugang PPP |
02000 |? | | | | | Expo 2000 Hotline | Expo 2000 Hotline. Eine T-Net-Verbindung kostet 5 TE inkl. 60 Sek. + nach 60 Sek. 1 TE je angefangene 12 Sek. 12 12
0800 |free| | | | | freecall 0800 | freecall 0800. Eine T-Net-Verbindung zu dieser Rufnummer ist kostenfrei.
110 |free| | | | | Polizei/Notruf | Polizeinotruf. Eine T-Net-Verbindung zu dieser Rufnummer ist kostenfrei.
@ -213,6 +215,10 @@
11814 |? | | | | | Auskunft Ausland Teleglobe | GmbH
11889 |? | | | | | Auskunft Ausland VIAG INTERKOM | GmbH & Co. KG, München
11856 |? | | | | | Auskunft Ausland WorldCom | Telecommunication Services GmbH, Frankfurt
#QUELLE: Programm "t-tarife.exe" Version: 1.16 Stand: 07.1998
0800 33 02000 |free| | | | |St”rungsannahme PK |
0800 33 01172 |free| | | | |St”rungsannahme GK |
0800 33 01174 |free| | | | |St”rungsannahme Kabelfernsehen DTAG |
# QUELLE: Programm "t-tarife.exe" Version: 1.16 Stand: 07.1998
# http://www.telekom.de
# http://www.regtp.de
# sowie eigene Recherchen, Stand: 22-Nov-98
# sowie eigene Recherchen, Stand: 06-Jan-99

284
isdnlog/tarif.dat Normal file
View File

@ -0,0 +1,284 @@
# @(#)tarif.dat 08-Jan-99 21:00
#
# Copyright 1995, 1999 by Andreas Kool (akool@isdn4linux.de)
#
V:1.00 [08-Jan-99]
#
# P: Provider
# G: tt.mm.jjjj Tarif g<>ltig ab
# C: Comment's
# A: Takt
# I: Internet-Zugangsnummer
# Z: (Zone)
# 0=City 8=E2-Netz G=Internet
# 1=Region 50 9=Euro City
# 2=Fern A=Euro 1
# 3=C-Netz B=Euro 2
# 4=C-Mobilbox C=Welt 1
# 5=D1-Netz D=Welt 2
# 6=D2-Netz E=Welt 3
# 7=E-plus-Netz F=Welt 4
#
# T: (Tag)
# W=Werktag
# E=Wochenende/Feiertag
# *=jeder Tag (flat rate)
#
P:11=o.tel.o
G:01.01.1999
C:Homepage: http://www.o-tel-o.de
C:Hotline: 01803/1998 oder 0800/7370 (Geschaeftskunden)
C:Adresse: 96038 Bamberg
A:60/60
I:010110191501
Z:1-2
T:W09-18=0.29
T:W18-22=0.15
T:W22-09=0.15
T:E=0.15
Z:3-8
T:W08-21=0.89
T:W21-08=0.49
T:E=0.49
Z:G
T:W09-18=0.16
T:W18-22=0.16
T:W22-09=0.10
T:E=0.10
################################################################
P:15=RSL COM
A:60/60
Z:1-2
T:W08-18=0.25 # Standard
T:W18-21=0.13 # Abend
T:W21-08=0.07 # Nacht
T:E08-21=0.13
T:E21-08=0.07
Z:3-8
T:W08-21=0.65
T:W21-08=0.45
T:E=0.45
################################################################
P:19,0=MobilCom
G:01.01.1999
C:MobilCom AG
C:Homepage: http://www.mobilcom.de
C:Hotline: 01805/191919
C:Adresse: Postfach 1249, 24822 Schleswig
A:60/60
I:0101901929 # (Benutzername: mobilcom; Passwort: mobilcom)
Z:1-2
T:*=0.19
Z:3-8
T:*=0.99
Z:9-C
T:*=0.69
Z:G
T:*=0.19
################################################################
P:28=Telebridge
G:01.01.1999
C:Hotline: 01805/335 440
C:Adresse: Zeppelinstraße 3, 73105
C: Dürnau
C:Reseller von COLT
A:60/60
Z:0
T:*=0.09
Z:1
T:*=0.14
Z:2
T:*=0.22
Z:3-8
T:*=0.49
################################################################
P:30=TelDaFax
A:1/1
Z:1-2
T:W09-18=0.17
T:W18-09=0.09
T:E=0.09
Z:3-8
T:W08-21=0.835
T:W21-08=0.476
T:E=0.476
################################################################
P:33=DTAG
C:Deutsche Telekom AG
A:0.12
Z:0
T:W02-05=240 # Nacht
T:W05-09=150 # Spar
T:W09-18=90 # Standard
T:W18-21=150 # Spar
T:W21-02=240 # Mondschein
T:E05-21=150 # Spar
T:E21-05=240 # Mondschein
Z:1-2
T:W02-05=120 # Nacht
T:W05-09=60 # Spar
T:W09-18=30 # Standard
T:W18-21=60 # Spar
T:W21-02=60 # Mondschein
T:E=60 # Spar
Z:3-8
T:W09-18=7.5 # Standard
T:W18-09=15 # Spar
T:E=15 # Spar
Z:4
T:W09-18=5.267 # Standard
T:W18-09=3.592 # Spar
T:E=3.592 # Spar
Z:7
T:W09-18=11.333 # Standard
T:W18-09=4.683 # Spar
T:E=4.683 # Spar
################################################################
P:50=Talkline
G:15.01.1999
C:Homepage: http://www.null1050.de
C:Hotline: 01802/2002
C:Faxabruf: 01802/2001
A:60/60
I:01050/019251 # (Benutzername: talknet; Passwort: talknet; Nameserver: 195.252.128.53)
Z:1-2
T:W09-18=0.29
T:W18-21=0.19
T:W21-09=0.09
T:E09-21=0.19
T:E21-09=0.09
Z:3-8
T:*=0.99
Z:G
T:W09-18=0.16
T:W18-21=0.09
T:W21-09=0.09
T:E=0.09
################################################################
P:70=Arcor
C:Mannesmann Arcor
A:60/60
I:010700192070 # (Benutzername: arcor; Passwort: internet; Proxy: proxy.arcor-ip.de:80; Startseite: http://www.call.arcor.net)
Z:1-2
T:W09-18=0.18 # Standard
T:W18-09=0.10 # Spar
T:E=0.10 # Spar
Z:3-5
T:W09-18=0.96
T:W18-09=0.48
T:E=0.48
Z:6
T:W09-18=0.94
T:W18-09=0.46
T:E=0.46
Z:7
T:W09-18=1.25
T:W18-09=0.56
T:E=0.56
Z:8
T:W09-18=0.96
T:W18-09=0.48
T:E=0.48
Z:G
T:*09-18=0.14
T:*18-09=0.10
################################################################
P:79=Viatel
C:Homepage: http://www.viatel.de
C:Hotline: 0800/79-01079
C:Telefon: 069/94 994-0
C:Telefax: 069/94 994-100
C:Adresse: Hanauer Landstraße 187-189,
C: 60314 Frankfurt am Main
A:30/1
Z:1-2
T:W09-18=0.16
T:W18-09=0.09
T:E=0.09
Z:3-8
T:W09-21=0.73
T:W21-09=0.36
T:E=0.36
################################################################
P:90=Viag Intercom
A:60/60
Z:1-2
T:W08-18=0.17
T:W18-08=0.10
T:E=0.10
Z:3-8
T:W08-21=0.99
T:W21-08=0.59
T:E=0.59
Z:G
T:*=0.10
################################################################
P:98,0=Nikoma Minutentakt
G:01.01.1999
C:Nikoma Media Works GmbH
C:Reseller von Star Telecom
A:60/60
Z:1-2
T:*09-21=0.15
T:*21-09=0.12
Z:3-8
T:*=0.50
################################################################
P:98,1=Nikoma Sekundentakt
G:01.01.1999
C:Nikoma Media Works GmbH
C:Reseller von Star Telecom
A:1/1
Z:1-2
T:*09-21=0.168
T:*21-09=0.134
Z:3-8
T:*=0.56
################################################################
P:98,2=Nikoma Nikocity Minutentakt
G:01.01.1999
C:Nikoma Media Works GmbH
C:Reseller von Star Telecom
A:60/60
Z:0
T:W09-21=0.8
T:W21-09=0.6
Z:1-2
T:*09-21=0.15
T:*21-09=0.10
Z:3-8
T:*=0.50
################################################################
P:98,3=Nikoma Nikocity Sekundentakt
G:01.01.1999
C:Nikoma Media Works GmbH
C:Reseller von Star Telecom
A:1/1
Z:0
T:W09-21=0.896
T:W21-09=0.672
Z:1-2
T:*09-21=0.168
T:*21-09=0.134
Z:3-8
T:*=0.56
################################################################
P:98,4=Mox
G:01.01.1999
C:Mox Telecom AG
C:Reseller von Star Telecom
A:1/1
Z:1-2
T:*=0.159
Z:3-8
T:*=0.559
################################################################
P:98,5=C@llas L
G:01.11.1998
C:C@llas Clever Communications
C:Reseller von Star Telecom
A:60/60
Z:1-2
T:*=0.22
Z:3-8
T:*=0.64

View File

@ -2,7 +2,7 @@
*
* ISDN accounting for isdn4linux. (Utilities)
*
* Copyright 1995, 1998 by Andreas Kool (akool@isdn4linux.de)
* Copyright 1995, 1999 by Andreas Kool (akool@isdn4linux.de)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -19,6 +19,15 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log$
* Revision 1.16 1998/12/09 20:40:19 akool
* - new option "-0x:y" for leading zero stripping on internal S0-Bus
* - new option "-o" to suppress causes of other ISDN-Equipment
* - more support for the internal S0-bus
* - Patches from Jochen Erwied <mack@Joker.E.Ruhr.DE>, fixes TelDaFax Tarif
* - workaround from Sebastian Kanthak <sebastian.kanthak@muehlheim.de>
* - new CHARGEINT chapter in the README from
* "Georg v.Zezschwitz" <gvz@popocate.hamburg.pop.de>
*
* Revision 1.15 1998/11/24 20:53:07 akool
* - changed my email-adress
* - new Option "-R" to supply the preselected provider (-R24 -> Telepassport)
@ -382,6 +391,8 @@ char *double2str(double n, int l, int d, int flags)
*pd++ = *ps++;
} /* if */
retstr[retnum][l + 1] = 0;
if (flags & DEB) {
p = retstr[retnum] + 1;
@ -922,7 +933,7 @@ go: if (!ndigit)
int print_version(char *myname)
{
_print_msg("%s Version %s, Copyright (C) 1995, 1996, 1997, 1998\n",myname,VERSION);
_print_msg("%s Version %s, Copyright (C) 1995, 1996, 1997, 1998, 1999\n",myname,VERSION);
/*
_print_msg(" Andreas Kool (akool@isdn4linux.de)\n");
_print_msg(" and Stefan Luethje (luethje@sl-gw.lake.de)\n\n");

View File

@ -2,7 +2,7 @@
*
* ISDN accounting for isdn4linux.
*
* Copyright 1995, 1998 by Andreas Kool (akool@isdn4linux.de)
* Copyright 1995, 1999 by Andreas Kool (akool@isdn4linux.de)
* and Stefan Luethje (luethje@sl-gw.lake.de)
*
* This program is free software; you can redistribute it and/or modify
@ -20,6 +20,15 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log$
* Revision 1.24 1998/12/09 20:40:27 akool
* - new option "-0x:y" for leading zero stripping on internal S0-Bus
* - new option "-o" to suppress causes of other ISDN-Equipment
* - more support for the internal S0-bus
* - Patches from Jochen Erwied <mack@Joker.E.Ruhr.DE>, fixes TelDaFax Tarif
* - workaround from Sebastian Kanthak <sebastian.kanthak@muehlheim.de>
* - new CHARGEINT chapter in the README from
* "Georg v.Zezschwitz" <gvz@popocate.hamburg.pop.de>
*
* Revision 1.23 1998/11/24 20:53:10 akool
* - changed my email-adress
* - new Option "-R" to supply the preselected provider (-R24 -> Telepassport)
@ -623,6 +632,8 @@ typedef struct {
int ctakt;
int zone;
int uid;
int tip;
int tz;
} CALL;
/****************************************************************************/
@ -770,6 +781,7 @@ _EXTERN CALL call[MAXCHAN];
_EXTERN int q931dmp;
#endif
_EXTERN int CityWeekend;
_EXTERN int preselect;
_EXTERN int dual;
_EXTERN char mlabel[BUFSIZ];
_EXTERN char *amtsholung;

View File

@ -2,7 +2,7 @@
*
* ISDN accounting for isdn4linux. (Utilities)
*
* Copyright 1995, 1998 by Andreas Kool (akool@isdn4linux.de)
* Copyright 1995, 1999 by Andreas Kool (akool@isdn4linux.de)
*
* splitting into nations 1998 by Michael Reinelt (reinelt@eunet.at)
*
@ -21,6 +21,15 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log$
* Revision 1.6 1998/12/09 20:40:30 akool
* - new option "-0x:y" for leading zero stripping on internal S0-Bus
* - new option "-o" to suppress causes of other ISDN-Equipment
* - more support for the internal S0-bus
* - Patches from Jochen Erwied <mack@Joker.E.Ruhr.DE>, fixes TelDaFax Tarif
* - workaround from Sebastian Kanthak <sebastian.kanthak@muehlheim.de>
* - new CHARGEINT chapter in the README from
* "Georg v.Zezschwitz" <gvz@popocate.hamburg.pop.de>
*
* Revision 1.5 1998/11/24 20:53:18 akool
* - changed my email-adress
* - new Option "-R" to supply the preselected provider (-R24 -> Telepassport)
@ -87,17 +96,24 @@
char *Providername(int number)
{
register char *p;
extern char *realProvidername(int prefix);
if ((p = realProvidername(number)) != (char *)NULL)
return(p);
switch (number) {
case 10 : return("Teleglobe"); /* GmbH, Gutleutstraße 85, 60329 Frankfurt 01010 */
case 11 : return("o.tel.o"); /* communications GmbH, Am Bonneshof 35, 40474 Düsseldorf 01011 */
case 12 : return("Tele Danmark"); /* Internetz GmbH, Süderstraße 75, 20097 Hamburg 01012 */
case 13 : return("Kinnevik"); /* Telecommunciations International S.A., 75, route de Longwy, L-8080 Bertrange, Luxembourg 01013 */
case 13 : return("Tele 2 (Kinnevik)"); /* Telecommunciations International S.A., 75, route de Longwy, L-8080 Bertrange, Luxembourg 01013 */
case 14 : return("EWE TEL"); /* GmbH, Donnerschweer Straße 22-26, 26123 Oldenburg 01014 */
case 15 : return("RSL COM"); /* Deutschland GmbH, Lyoner Straße 36, 60528 Frankfurt/Main 01015 */
case 16 : return("LausitzNet"); /* Telekommunikationsgesellschaft mbH, Lausitzer Straße 1-7, 03046 Cottbus 01016 */
case 17 : return("SEC"); /* Service AG, Dieskaustraße 246, 04249 Leipzig 01017 */
case 18 : return("debitel"); /* Kommunikationstechnik GmbH & Co KG, Schelmenwasenstr. 37 - 39, 70567 Stuttgart 01018 */
case 19 : return("CityLine (Mobilcom)"); /* Telefondienste GmbH, Schwarzer Weg 13, 24837 Schleswig 01019 */
case 19 : return("Mobilcom (CityLine)"); /* Telefondienste GmbH, Schwarzer Weg 13, 24837 Schleswig 01019 */
case 20 : return("ISIS"); /* Multimedia Net GmbH, Kaistraße 6, 40221 Düsseldorf 01020 */
case 21 : return("QS"); /* Communication Service GmbH, Oberländer Ufer 180-182, 50968 Köln 01021 */
case 22 : return("NetCologne"); /* GmbH, Maarweg 163, 50825 Köln 01022 */
@ -158,11 +174,11 @@ char *Providername(int number)
case 76 : return("QuickNet"); /* Telenetworks & Service AG, Else-Lasker-Schüler-Straße 47, 42107 Wuppertal 01076 */
case 77 : return("E-Plus"); /* Mobilfunk GmbH, E-Plus-Platz 1, 40468 Düsseldorf 01077 */
case 78 : return("3U"); /* Telekommunikation GmbH, Äußere Zittauer Straße 51, 02708 Löbau 01078 */
case 79 : return("VIAPHONE"); /* GmbH, Hanauer Landstraße 187, 60314 Frankfurt 01079 */
case 79 : return("Viatel (VIAPHONE)"); /* GmbH, Hanauer Landstraße 187, 60314 Frankfurt 01079 */
case 80 : return("Telegate"); /* Aktiengesellschaft für telefonische Informationsdienste, Bahnhofstraße 26, 82211 Herrsching 01080 */
case 81 : return("Infotel"); /* bV, Onderlangs 120, 6812 CJ Arnhem, Niederlande 01081 */
case 82 : return("AugustaKom"); /* Telekommunikation GmbH & Co.KG Hoher Weg 1 86152 Augsburg 01082 */
case 83 : return("Würzburger"); /* Telekommunikationsgesellschaft mbH, Bahnhofstraße 12-18, 97070 Würzburg 01083 */
case 83 : return("Wuerzburger"); /* Telekommunikationsgesellschaft mbH, Bahnhofstraße 12-18, 97070 Würzburg 01083 */
case 84 : return("Telegroup"); /* Network Services GmbH, Grossenbaumer Weg 6, 40472 Düsseldorf 01084 */
case 85 : return("WESTCom"); /* GmbH, Hebelstraße 22 c, 69115 Heidelberg 01085 */
case 86 : return("ONE.TEL"); /* Limited (UK), Clements House, 14-18 Gresham Street, London, EC2V 7JE, England 01086 */
@ -178,7 +194,7 @@ char *Providername(int number)
case 96 : return("GELSEN-NET"); /* Kommunikationsgesellschaft mbH, Munscheidstraße 14, 45886 Gelsenkirchen 01096 */
case 97 : return("AT & T-Unisource"); /* Communication Services (Deutschland) GmbH, Lyoner Str. 15, 60528 Frankfurt 01097 */
case 98 : return("STAR"); /* Telecommunications Deutschland GmbH, Voltastraße 1a, 60486 Frankfurt 01098 */
/* Reseller von STAR : C@llas, Mox */
/* Reseller von STAR : C@llas, Mox, Nikoma */
case 99 : return("ECONOPHONE"); /* GmbH, Flughafenstraße 54b, 22335 Hamburg 01099 */
/* Reseller von ECONOPHONE : Telco */
case 100 : return("TELELEV"); /* Telekommunikation GmbH, Dönhoffstraße 39, 51373 Leverkusen 010000 */