- bugfix: it is possible to install isdnlog now
- improved performance for read files for vbox files and mgetty files. - it is possible to decide via config if you want to use avon or areacode.
This commit is contained in:
parent
66c2d0852e
commit
02f1102b7d
2
HOWTO
2
HOWTO
|
@ -131,7 +131,7 @@ xisdn voruebergehend aus der Distribution genommen wurde!!!!
|
||||||
Konfigurationsdatei "isdnlog.conf" in die neue Syntax umzuwandeln.
|
Konfigurationsdatei "isdnlog.conf" in die neue Syntax umzuwandeln.
|
||||||
Dieses passiert automatisch mit make install
|
Dieses passiert automatisch mit make install
|
||||||
Es werden in dieser Version alle Telefonnummern in der Datei callerid.conf
|
Es werden in dieser Version alle Telefonnummern in der Datei callerid.conf
|
||||||
ausgelagert, so dass die isdn.conf sehr klien wird.
|
ausgelagert, so dass die isdn.conf sehr klein wird.
|
||||||
|
|
||||||
6. Erster Start des neuen isdnlog:
|
6. Erster Start des neuen isdnlog:
|
||||||
|
|
||||||
|
|
15
Makefile
15
Makefile
|
@ -1,4 +1,4 @@
|
||||||
# $Id: Makefile,v 1.14 1997/05/16 12:23:26 fritz Exp $
|
# $Id: Makefile,v 1.15 1997/05/19 22:57:52 luethje Exp $
|
||||||
#
|
#
|
||||||
# Toplevel Makefile for isdn4k-utils
|
# Toplevel Makefile for isdn4k-utils
|
||||||
#
|
#
|
||||||
|
@ -10,6 +10,10 @@ all: do-it-all
|
||||||
#
|
#
|
||||||
# Make "config" the default target if there is no configuration file.
|
# Make "config" the default target if there is no configuration file.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# Following line is important for lib and isdnlog (sl).
|
||||||
|
export ROOTDIR=$(shell pwd)
|
||||||
|
|
||||||
ifeq (.config,$(wildcard .config))
|
ifeq (.config,$(wildcard .config))
|
||||||
include .config
|
include .config
|
||||||
do-it-all: subtargets
|
do-it-all: subtargets
|
||||||
|
@ -19,9 +23,6 @@ do-it-all: config
|
||||||
endif
|
endif
|
||||||
|
|
||||||
SUBDIRS :=
|
SUBDIRS :=
|
||||||
ifeq ($(CONFIG_LIB_AREACODE),y)
|
|
||||||
SUBDIRS := $(SUBDIRS) areacode lib
|
|
||||||
endif
|
|
||||||
ifeq ($(CONFIG_ISDNCTRL),y)
|
ifeq ($(CONFIG_ISDNCTRL),y)
|
||||||
SUBDIRS := $(SUBDIRS) isdnctrl
|
SUBDIRS := $(SUBDIRS) isdnctrl
|
||||||
endif
|
endif
|
||||||
|
@ -54,7 +55,11 @@ ifeq ($(CONFIG_IMONTTY),y)
|
||||||
SUBDIRS := $(SUBDIRS) imontty
|
SUBDIRS := $(SUBDIRS) imontty
|
||||||
endif
|
endif
|
||||||
ifeq ($(CONFIG_ISDNLOG),y)
|
ifeq ($(CONFIG_ISDNLOG),y)
|
||||||
SUBDIRS := $(SUBDIRS) isdnlog
|
SUBDIRS := $(SUBDIRS) areacode lib isdnlog
|
||||||
|
else
|
||||||
|
ifeq ($(CONFIG_LIB_AREACODE),y)
|
||||||
|
SUBDIRS := $(SUBDIRS) areacode
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq ($(CONFIG_IPPPSTATS),y)
|
ifeq ($(CONFIG_IPPPSTATS),y)
|
||||||
SUBDIRS := $(SUBDIRS) ipppstats
|
SUBDIRS := $(SUBDIRS) ipppstats
|
||||||
|
|
|
@ -4,6 +4,10 @@
|
||||||
# the original Makefile, it is called GNUmakefile.
|
# the original Makefile, it is called GNUmakefile.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
#ifndef CONFIG_AREACODE_DATA
|
||||||
|
#CONFIG_AREACODE_DATA=x
|
||||||
|
#endif
|
||||||
|
|
||||||
ifeq (../.config,$(wildcard ../.config))
|
ifeq (../.config,$(wildcard ../.config))
|
||||||
include ../.config
|
include ../.config
|
||||||
DATAOPTS := DATATARGET=$(shell echo $(CONFIG_AREACODE_DATA))/areacodes
|
DATAOPTS := DATATARGET=$(shell echo $(CONFIG_AREACODE_DATA))/areacodes
|
||||||
|
@ -18,6 +22,8 @@ endif
|
||||||
all: .depend
|
all: .depend
|
||||||
$(MAKE) -f make/linux.mak $(BUILDOPTS) all
|
$(MAKE) -f make/linux.mak $(BUILDOPTS) all
|
||||||
|
|
||||||
|
depend dep: .depend
|
||||||
|
|
||||||
.depend:
|
.depend:
|
||||||
$(MAKE) -f make/linux.mak $(BUILDOPTS) depend
|
$(MAKE) -f make/linux.mak $(BUILDOPTS) depend
|
||||||
|
|
||||||
|
@ -33,9 +39,15 @@ distclean:
|
||||||
|
|
||||||
install-man:
|
install-man:
|
||||||
|
|
||||||
install:
|
install: all
|
||||||
mkdir -p $(CONFIG_AREACODE_DATA)
|
ifeq ($(CONFIG_LIB_AREACODE),y)
|
||||||
$(MAKE) -f make/linux.mak $(INSTALLOPTS) install
|
mkdir -p $(CONFIG_AREACODE_DATA)
|
||||||
|
$(MAKE) -f make/linux.mak $(INSTALLOPTS) install
|
||||||
|
endif
|
||||||
|
|
||||||
|
# -@test "$(CONFIG_AREACODE_DATA)" != "x" && \
|
||||||
|
# mkdir -p $(CONFIG_AREACODE_DATA) && \
|
||||||
|
# $(MAKE) -f make/linux.mak $(INSTALLOPTS) install
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
rm -f $(shell echo $(CONFIG_AREACODE_DATA))/areacodes
|
rm -f $(shell echo $(CONFIG_AREACODE_DATA))/areacodes
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
## $Id: Makefile.in,v 1.25 1997/05/17 01:08:11 luethje Exp $
|
## $Id: Makefile.in,v 1.26 1997/05/19 22:58:02 luethje Exp $
|
||||||
##
|
##
|
||||||
## ISDN accounting for isdn4linux.
|
## ISDN accounting for isdn4linux.
|
||||||
##
|
##
|
||||||
|
@ -19,6 +19,12 @@
|
||||||
## 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.26 1997/05/19 22:58:02 luethje
|
||||||
|
## - bugfix: it is possible to install isdnlog now
|
||||||
|
## - improved performance for read files for vbox files and mgetty files.
|
||||||
|
## - it is possible to decide via config if you want to use avon or
|
||||||
|
## areacode.
|
||||||
|
##
|
||||||
## Revision 1.25 1997/05/17 01:08:11 luethje
|
## Revision 1.25 1997/05/17 01:08:11 luethje
|
||||||
## some bugfixes
|
## some bugfixes
|
||||||
##
|
##
|
||||||
|
@ -159,6 +165,7 @@ INSTALL_DATA := $(INSTALL) -m 0644 -o 0 -g 0
|
||||||
LIBISDNDIR := @LIBISDNDIR@
|
LIBISDNDIR := @LIBISDNDIR@
|
||||||
I4LCONFDIR := @I4LCONFDIR@
|
I4LCONFDIR := @I4LCONFDIR@
|
||||||
CONFFILE := @CONFFILE@
|
CONFFILE := @CONFFILE@
|
||||||
|
CALLERIDFILE := @CALLERIDFILE@
|
||||||
OLDCONFDIR := @OLDCONFDIR@
|
OLDCONFDIR := @OLDCONFDIR@
|
||||||
OLDCONFFILE := @OLDCONFFILE@
|
OLDCONFFILE := @OLDCONFFILE@
|
||||||
LIBAREA := @LIBAREA@
|
LIBAREA := @LIBAREA@
|
||||||
|
@ -183,12 +190,13 @@ export CHARGEMAX := 1000.00
|
||||||
|
|
||||||
ifndef ROOTDIR
|
ifndef ROOTDIR
|
||||||
export ROOTDIR=$(shell pwd)
|
export ROOTDIR=$(shell pwd)
|
||||||
PREFIXDIR=.
|
|
||||||
MAKELIB =1
|
MAKELIB =1
|
||||||
else
|
else
|
||||||
PREFIXDIR=$(ROOTDIR)
|
#PREFIXDIR=$(ROOTDIR)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
PREFIXDIR=.
|
||||||
|
|
||||||
ifeq ($(MAKELIB),1)
|
ifeq ($(MAKELIB),1)
|
||||||
SUBDIRS = $(LIBISDNDIR)
|
SUBDIRS = $(LIBISDNDIR)
|
||||||
endif
|
endif
|
||||||
|
@ -203,9 +211,7 @@ CC = $(_CC)
|
||||||
|
|
||||||
INCLUDE = -I./connect -I./tools -I$(PREFIXDIR) -I$(LIBISDNDIR)
|
INCLUDE = -I./connect -I./tools -I$(PREFIXDIR) -I$(LIBISDNDIR)
|
||||||
|
|
||||||
ifneq ($(LIBAREA),1)
|
|
||||||
LIB = $(DBMLIB)
|
LIB = $(DBMLIB)
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -217,7 +223,7 @@ SERVICEFILE = /etc/services
|
||||||
# DON'T EDIT BELOW THIS LINE
|
# DON'T EDIT BELOW THIS LINE
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
VERSION = 2.99.19
|
VERSION = 2.99.20
|
||||||
|
|
||||||
ifeq ($(POSTGRES),1)
|
ifeq ($(POSTGRES),1)
|
||||||
DEFS += -DPOSTGRES
|
DEFS += -DPOSTGRES
|
||||||
|
@ -294,7 +300,7 @@ rootperm:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
uninstall: rootperm
|
uninstall: rootperm
|
||||||
if ps -x | fgrep $(ISDNLOG) >/dev/null; then kill `cat $(RUNDIR)/isdnlog.pid`; fi
|
if ps -x | fgrep $(ISDNLOG) >/dev/null; then kill `cat $(RUNDIR)/isdnlog.pid` 2>/dev/null; fi
|
||||||
rm -f $(SBINDIR)/$(ISDNLOG) $(BINDIR)/$(ISDNREP) $(BINDIR)/$(ISDNCONF)
|
rm -f $(SBINDIR)/$(ISDNLOG) $(BINDIR)/$(ISDNREP) $(BINDIR)/$(ISDNCONF)
|
||||||
rm -f $(MAN8DIR)/isdnlog.8 $(MAN1DIR)/isdnrep.1
|
rm -f $(MAN8DIR)/isdnlog.8 $(MAN1DIR)/isdnrep.1
|
||||||
|
|
||||||
|
@ -302,20 +308,24 @@ installdirs: rootperm
|
||||||
$(INSTALL_DIR) $(I4LCONFDIR)
|
$(INSTALL_DIR) $(I4LCONFDIR)
|
||||||
$(INSTALL_DIR) $(BINDIR)
|
$(INSTALL_DIR) $(BINDIR)
|
||||||
$(INSTALL_DIR) $(SBINDIR)
|
$(INSTALL_DIR) $(SBINDIR)
|
||||||
$(INSTALL_DIR) $(MAN1DIR)
|
# $(INSTALL_DIR) $(MAN1DIR)
|
||||||
$(INSTALL_DIR) $(MAN8DIR)
|
# $(INSTALL_DIR) $(MAN8DIR)
|
||||||
|
|
||||||
install: depend all rootperm installdirs
|
install: depend all rootperm installdirs
|
||||||
if ps -x | fgrep $(ISDNLOG) >/dev/null; then kill `cat $(RUNDIR)/isdnlog.pid`; fi
|
@echo "Killing running isdnlog!"
|
||||||
-test ! -d $(OLDCONFDIR) || (cp -auv $(OLDCONFDIR)/* $(I4LCONFDIR) \
|
-@if ps -x | fgrep $(ISDNLOG) >/dev/null; then kill `cat $(RUNDIR)/isdnlog.pid 2>/dev/null`; fi
|
||||||
|
-@test ! -d $(OLDCONFDIR) || cp -auv $(OLDCONFDIR)/$(USERFILE) $(I4LCONFDIR)
|
||||||
|
-@test ! -d $(OLDCONFDIR) || (cp -auv $(OLDCONFDIR)/$(OLDCONFFILE) $(I4LCONFDIR) \
|
||||||
&& $(ISDNREP) 1>/dev/null 2>&1) \
|
&& $(ISDNREP) 1>/dev/null 2>&1) \
|
||||||
&& mv $(I4LCONFDIR)/$(OLDCONFFILE) $(I4LCONFDIR)/$(OLDCONFFILE).old
|
&& mv $(I4LCONFDIR)/$(OLDCONFFILE) $(I4LCONFDIR)/$(OLDCONFFILE).old
|
||||||
$(GENCONF) $(I4LCONFDIR)/$(CONFFILE)
|
$(GENCONF) $(I4LCONFDIR)/$(CONFFILE) $(I4LCONFDIR)/$(CALLERIDFILE)
|
||||||
|
@echo "Generate config files. Wait a moment..."
|
||||||
|
@$(ISDNCONF) -c 040 1>/dev/null 2>&1
|
||||||
$(INSTALL_BIN) $(ISDNLOG) $(SBINDIR)
|
$(INSTALL_BIN) $(ISDNLOG) $(SBINDIR)
|
||||||
$(INSTALL_BIN) $(ISDNREP) $(BINDIR)
|
$(INSTALL_BIN) $(ISDNREP) $(BINDIR)
|
||||||
$(INSTALL_BIN) $(ISDNCONF) $(BINDIR)
|
$(INSTALL_BIN) $(ISDNCONF) $(BINDIR)
|
||||||
$(INSTALL_DATA) isdnlog/isdnlog.8 $(MAN8DIR)
|
# $(INSTALL_DATA) isdnlog/isdnlog.8 $(MAN8DIR)
|
||||||
$(INSTALL_DATA) isdnrep/isdnrep.1 $(MAN1DIR)
|
# $(INSTALL_DATA) isdnrep/isdnrep.1 $(MAN1DIR)
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "Don't forget to create $(I4LCONFDIR)/$(USERFILE)"
|
@echo "Don't forget to create $(I4LCONFDIR)/$(USERFILE)"
|
||||||
@echo ""
|
@echo ""
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
# Lock und PID-Files
|
|
||||||
ISDNLOG - Version 3.0 - 4-Mai-97 22:09
|
ISDNLOG - Version 3.0 - 4-Mai-97 22:09
|
||||||
|
|
||||||
|
|
||||||
|
@ -338,17 +337,38 @@ Dazu siehe jedoch Kapitel 15. Dual-Mode !
|
||||||
3. Installation
|
3. Installation
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
Nun kann isdnlog ausgepackt (wohl bereits geschehen ;-) und erstellt
|
Da isdnlog seit der Version 3.0 nur noch im isdn4k-utils freigegeben wird,
|
||||||
sowie installiert werden:
|
findet die Konfiguration ueber das Menu statt. Es darf also nicht mehr direkt
|
||||||
|
in dem Makefile editiert werden.
|
||||||
|
|
||||||
cd /usr/src
|
Die alte Datei isdnlog.conf wird, wenn vorhanden in die Dateien isdn.conf und
|
||||||
tar xzf isdnlog.tar.gz
|
callerid.conf umgesetzt. Dieses macht die Installation automatisch.
|
||||||
cd isdnlog-<Version>
|
|
||||||
make install
|
|
||||||
|
|
||||||
Vor dem "make" koennen folgende Eintraege koennen im Installationsmenue
|
Die alte Konfigurationsdatei isdnlog.conf wird ins neue Verzeichnis uebernommen.
|
||||||
den eigenen Gegebenheiten angepasst werden. Bitte nicht mehr direkt im Makefile
|
Allerdings traegt sie dann den Namen isdnlog.conf.old.
|
||||||
editieren, da diese Eintraege ueberschrieben werden.
|
|
||||||
|
Es ist dabei zu beachten, dass bei allen Telefonnummern, die in der
|
||||||
|
isdnlog.conf, die mit einem "*" oder einem "?" beginnen, dieses Zeichen
|
||||||
|
geloescht wird.
|
||||||
|
|
||||||
|
Beispiel:
|
||||||
|
|
||||||
|
*8154711 -> 8154711
|
||||||
|
081547* -> 081547*
|
||||||
|
|
||||||
|
Wenn das Zeichen ("*" oder "?") nur als Platzhalter fuer eine "0" stand, kann
|
||||||
|
man es lassen, andernfalls muss eine manuelle Nacheditierung stattfinden.
|
||||||
|
|
||||||
|
Auch die Datei isdnlog.users wird uebernommen. Allerdings finden hier keine
|
||||||
|
Aenderungen statt.
|
||||||
|
|
||||||
|
Das Vornummernverzeichnis AVON wird nicht uebernommen. Da sich die Syntax
|
||||||
|
etwas geaendert hat. Muss die alte Datei von Hand an die neue angefuegt werden.
|
||||||
|
Aber normalerweise wird bei der Installation von isdnlog empfohlen die
|
||||||
|
areacode-Library zu verwenden.
|
||||||
|
|
||||||
|
Hier sind nochmal alle Eintraege aufgefuehrt, die isdnlog im Makefile enthaelt,
|
||||||
|
die ueber das Menue konfiguriert werden:
|
||||||
|
|
||||||
COPTS
|
COPTS
|
||||||
Compiler-Optionen fuer den gcc
|
Compiler-Optionen fuer den gcc
|
||||||
|
@ -508,6 +528,16 @@ COUNTRYPREFIX:
|
||||||
Es enthaelt den Prefix zur Laenderkennung. Beim Kompilieren ist dieser
|
Es enthaelt den Prefix zur Laenderkennung. Beim Kompilieren ist dieser
|
||||||
Wert defaultmaessig auf "+" gesetzt. Dieser Eintrag ist optional.
|
Wert defaultmaessig auf "+" gesetzt. Dieser Eintrag ist optional.
|
||||||
|
|
||||||
|
CODELIB:
|
||||||
|
Es kann nach dem Kompilieren eingestellt werden, welche Library verwendet
|
||||||
|
werden soll. Fuer AVON wird dort "AVON" eingetragen und fuer areacode
|
||||||
|
wird dort "AREACODE" eingetragen. Andere Werte sind dort zur Zeit nicht
|
||||||
|
erlaubt. Es sollte dann aber zusaetzlich AREALIB bzw. AVONLIB eingetragen
|
||||||
|
werden.
|
||||||
|
Dieser Eintrag ist optional.
|
||||||
|
Beispiel:
|
||||||
|
CODELIB=avon
|
||||||
|
|
||||||
AREALIB:
|
AREALIB:
|
||||||
Enthaelt den vollen Pfad zu der Datei "areacodes". Diese Angabe ist
|
Enthaelt den vollen Pfad zu der Datei "areacodes". Diese Angabe ist
|
||||||
optional und nur notwendig, wenn sich der Pfad nach der Compilation
|
optional und nur notwendig, wenn sich der Pfad nach der Compilation
|
||||||
|
@ -570,39 +600,46 @@ gehalten, sondern nur noch nach Beendigung eines Gespraeches wird die Datei
|
||||||
geoeffnet, der Eintrag ergaenzt und anschliessend wieder geschlossen.
|
geoeffnet, der Eintrag ergaenzt und anschliessend wieder geschlossen.
|
||||||
Dadurch ist es jetzt moeglich diese Datei zu verschieben, wenn der isdnlog
|
Dadurch ist es jetzt moeglich diese Datei zu verschieben, wenn der isdnlog
|
||||||
laeuft und gerade kein Gespraech beendet wird.
|
laeuft und gerade kein Gespraech beendet wird.
|
||||||
|
Dieser Eintrag ist optional.
|
||||||
|
|
||||||
RELOADCMD = reload
|
RELOADCMD = reload
|
||||||
|
|
||||||
Hiermit wird ein ausfuehrbares Programm (z.b. Shell-Script) angegeben,
|
Hiermit wird ein ausfuehrbares Programm (z.b. Shell-Script) angegeben,
|
||||||
mit dem isdnlog ein evtl. wildgewordenes isdn4linux reanimieren kann.
|
mit dem isdnlog ein evtl. wildgewordenes isdn4linux reanimieren kann.
|
||||||
(Ein Beispiel findet sich im Kapitel 14.1 Watchdog)
|
(Ein Beispiel findet sich im Kapitel 14.1 Watchdog)
|
||||||
|
Dieser Eintrag ist optional.
|
||||||
|
|
||||||
STOPCMD = stop
|
STOPCMD = stop
|
||||||
|
|
||||||
Hiermit wird ein ausfuehrbares Programm (z.b. Shell-Script) angegeben,
|
Hiermit wird ein ausfuehrbares Programm (z.b. Shell-Script) angegeben,
|
||||||
mit dem isdnlog isdn4linux terminieren kann.
|
mit dem isdnlog isdn4linux terminieren kann.
|
||||||
(Ein Beispiel findet sich im Kapitel 14.2 CHARGEMAX)
|
(Ein Beispiel findet sich im Kapitel 14.2 CHARGEMAX)
|
||||||
|
Dieser Eintrag ist optional.
|
||||||
|
|
||||||
REBOOTCMD = /sbin/reboot
|
REBOOTCMD = /sbin/reboot
|
||||||
|
|
||||||
Hiermit wird ein ausfuehrbares Programm (z.b. Shell-Script) angegeben,
|
Hiermit wird ein ausfuehrbares Programm (z.b. Shell-Script) angegeben,
|
||||||
mit dem isdnlog Linux herunterfahren kann.
|
mit dem isdnlog Linux herunterfahren kann.
|
||||||
(Ein Beispiel findet sich im Kapitel 14.2 CHARGEMAX)
|
(Ein Beispiel findet sich im Kapitel 14.2 CHARGEMAX)
|
||||||
|
Dieser Eintrag ist optional.
|
||||||
|
|
||||||
CHARGEMAX = 15.00
|
CHARGEMAX = 15.00
|
||||||
|
|
||||||
Hiermit wird (in DM) angegeben, wieviel Geld man pro Tag maximal
|
Hiermit wird (in DM) angegeben, wieviel Geld man pro Tag maximal
|
||||||
mit isdn4linux vertelefonieren moechte.
|
mit isdn4linux vertelefonieren moechte.
|
||||||
|
Dieser Eintrag ist pflicht!
|
||||||
|
|
||||||
CONNECTMAX = 18000,0
|
CONNECTMAX = 18000,0
|
||||||
|
|
||||||
Hiermit wird (in Sekunden) angegeben, wieviel Zeit man pro Monat
|
Hiermit wird (in Sekunden) angegeben, wieviel Zeit man pro Monat
|
||||||
maximal Online sein moechte.
|
maximal Online sein moechte.
|
||||||
|
Dieser Eintrag ist optional.
|
||||||
|
|
||||||
BYTEMAX = 67108864,0
|
BYTEMAX = 67108864,0
|
||||||
|
|
||||||
Hiermit wird (in Byte) angegeben, wieviel Byte man maximal pro
|
Hiermit wird (in Byte) angegeben, wieviel Byte man maximal pro
|
||||||
Monat saugen moechte.
|
Monat saugen moechte.
|
||||||
|
Dieser Eintrag ist optional.
|
||||||
|
|
||||||
CURRENCY=factor,currency
|
CURRENCY=factor,currency
|
||||||
|
|
||||||
|
@ -630,6 +667,38 @@ lassen will, kann man hier z.B. folgenden Wert setzen:
|
||||||
|
|
||||||
CURRENCY=0.1043,DM
|
CURRENCY=0.1043,DM
|
||||||
|
|
||||||
|
Dieser Eintrag ist optional.
|
||||||
|
|
||||||
|
Wenn der isdnrep via HTML aufgezeichneten Anrufe abspielen soll, dann muss hier
|
||||||
|
der Pfad eingetragen werden. Eine genaue Beschreibung findet man unter
|
||||||
|
dem Kapitel isdnrep.
|
||||||
|
Dieser Eintrag ist optional.
|
||||||
|
|
||||||
|
Beipiel:
|
||||||
|
VBOXPATH = /var/spool/vbox/fred/incoming
|
||||||
|
|
||||||
|
Der isdnrep kann fuer jeden aufgezeichneten Anruf ein Koonvertierungsprogramm
|
||||||
|
starten. Eine genaue Beschreibung findet man unter dem Kapitel isdnrep.
|
||||||
|
Dieser Eintrag ist optional.
|
||||||
|
|
||||||
|
Beipiel:
|
||||||
|
VBOXCMD = /usr/bin/zyxeltowav
|
||||||
|
|
||||||
|
Wenn der isdnrep via HTML angekommene Faxe anzeigen soll, dann muss hier
|
||||||
|
der Pfad eingetragen werden. Eine genaue Beschreibung findet man unter
|
||||||
|
dem Kapitel isdnrep.
|
||||||
|
Dieser Eintrag ist optional.
|
||||||
|
|
||||||
|
Beipiel:
|
||||||
|
MGETTYPATH = /var/spool/fax/incoming
|
||||||
|
|
||||||
|
Der isdnrep kann fuer jedes Fax ein Koonvertierungsprogramm starten.
|
||||||
|
Eine genaue Beschreibung findet man unter dem Kapitel isdnrep.
|
||||||
|
Dieser Eintrag ist optional.
|
||||||
|
|
||||||
|
Beipiel:
|
||||||
|
MGETTYCMD = /usr/bin/g3tojpg
|
||||||
|
|
||||||
Fuer den isdnrep kann man einen oder mehrere Formatsstrings definieren,
|
Fuer den isdnrep kann man einen oder mehrere Formatsstrings definieren,
|
||||||
wie der isdnrep die einzelnen Gebuehren anzeigen soll. Die genaue Syntax
|
wie der isdnrep die einzelnen Gebuehren anzeigen soll. Die genaue Syntax
|
||||||
wird unter dem Kapitel isdnrep beschrieben.
|
wird unter dem Kapitel isdnrep beschrieben.
|
||||||
|
|
|
@ -542,6 +542,7 @@ I4LCONFDIR=$CONFIG_I4LCONFDIR
|
||||||
OLDCONFDIR=$CONFIG_ISDNLOG_OLDI4LCONFDIR
|
OLDCONFDIR=$CONFIG_ISDNLOG_OLDI4LCONFDIR
|
||||||
OLDCONFFILE=$CONFIG_ISDNLOG_OLDI4LCONFFILE
|
OLDCONFFILE=$CONFIG_ISDNLOG_OLDI4LCONFFILE
|
||||||
CONFFILE=$CONFIG_CONFFILE
|
CONFFILE=$CONFIG_CONFFILE
|
||||||
|
CALLERIDFILE=$CONFIG_CALLERIDFILE
|
||||||
RUNDIR=$CONFIG_RUNDIR
|
RUNDIR=$CONFIG_RUNDIR
|
||||||
SERV_PORT=$CONFIG_ISDNLOG_SERV_PORT
|
SERV_PORT=$CONFIG_ISDNLOG_SERV_PORT
|
||||||
USERFILE=$CONFIG_ISDNLOG_USERFILE
|
USERFILE=$CONFIG_ISDNLOG_USERFILE
|
||||||
|
@ -566,6 +567,7 @@ I4LCONFDIR="/etc/isdn"
|
||||||
OLDCONFDIR="/etc/isdnlog"
|
OLDCONFDIR="/etc/isdnlog"
|
||||||
OLDCONFFILE="isdnlog.conf"
|
OLDCONFFILE="isdnlog.conf"
|
||||||
CONFFILE="isdn.conf"
|
CONFFILE="isdn.conf"
|
||||||
|
CALLERIDFILE="callerid.conf"
|
||||||
RUNDIR="/var/run"
|
RUNDIR="/var/run"
|
||||||
ALIB=area
|
ALIB=area
|
||||||
SERV_PORT=20011
|
SERV_PORT=20011
|
||||||
|
@ -1952,6 +1954,7 @@ s%@USERFILE@%$USERFILE%g
|
||||||
s%@OLDCONFDIR@%$OLDCONFDIR%g
|
s%@OLDCONFDIR@%$OLDCONFDIR%g
|
||||||
s%@OLDCONFFILE@%$OLDCONFFILE%g
|
s%@OLDCONFFILE@%$OLDCONFFILE%g
|
||||||
s%@CONFFILE@%$CONFIG_CONFFILE%g
|
s%@CONFFILE@%$CONFIG_CONFFILE%g
|
||||||
|
s%@CALLERIDFILE@%$CONFIG_CALLERIDFILE%g
|
||||||
s%@LOGFILE@%$LOGFILE%g
|
s%@LOGFILE@%$LOGFILE%g
|
||||||
s%@COUNTRYCODE@%$COUNTRYCODE%g
|
s%@COUNTRYCODE@%$COUNTRYCODE%g
|
||||||
s%@COUNTRYPREFIX@%$COUNTRYPREFIX%g
|
s%@COUNTRYPREFIX@%$COUNTRYPREFIX%g
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
## $Id: genconf,v 1.5 1997/05/10 01:21:00 luethje Exp $
|
## $Id: genconf,v 1.6 1997/05/19 22:58:13 luethje Exp $
|
||||||
##
|
##
|
||||||
## installation script for the config file of isdnlog
|
## installation script for the config file of isdnlog
|
||||||
##
|
##
|
||||||
|
@ -20,6 +20,12 @@
|
||||||
## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
##
|
##
|
||||||
## $Log: genconf,v $
|
## $Log: genconf,v $
|
||||||
|
## Revision 1.6 1997/05/19 22:58:13 luethje
|
||||||
|
## - bugfix: it is possible to install isdnlog now
|
||||||
|
## - improved performance for read files for vbox files and mgetty files.
|
||||||
|
## - it is possible to decide via config if you want to use avon or
|
||||||
|
## areacode.
|
||||||
|
##
|
||||||
## Revision 1.5 1997/05/10 01:21:00 luethje
|
## Revision 1.5 1997/05/10 01:21:00 luethje
|
||||||
## some primitive changes
|
## some primitive changes
|
||||||
##
|
##
|
||||||
|
@ -40,6 +46,8 @@
|
||||||
##
|
##
|
||||||
|
|
||||||
CONFFILE=$1
|
CONFFILE=$1
|
||||||
|
CALLERIDFILE=$2
|
||||||
|
|
||||||
RESFILE=/tmp/`basename $0`.res.$$
|
RESFILE=/tmp/`basename $0`.res.$$
|
||||||
|
|
||||||
setentry() {
|
setentry() {
|
||||||
|
@ -94,7 +102,7 @@ setentry "[GLOBAL]" "COUNTRYCODE" "$COUNTRYCODE"
|
||||||
setentry "[GLOBAL]" "COUNTRYPREFIX" "$COUNTRYPREFIX"
|
setentry "[GLOBAL]" "COUNTRYPREFIX" "$COUNTRYPREFIX"
|
||||||
setentry "[ISDNLOG]" "CHARGEMAX" "$CHARGEMAX"
|
setentry "[ISDNLOG]" "CHARGEMAX" "$CHARGEMAX"
|
||||||
setentry "[ISDNLOG]" "REPFMT" '\" %X %D %15.15H %T %-15.15F %7u %U %I %O\"'
|
setentry "[ISDNLOG]" "REPFMT" '\" %X %D %15.15H %T %-15.15F %7u %U %I %O\"'
|
||||||
setentry "[ISDNLOG]" "REPFMTSHORT" '\"%X%D %8.8H %T %-14.14F %U%I %O\"'
|
setentry "[ISDNLOG]" "REPFMTSHORT" '\"%X%D %8.8H %T %-14.14F%U%I %O\"'
|
||||||
setentry "[ISDNLOG]" "REPFMTWWW" '\"%X %D %17.17H %T %-17.17F %-20.20l SI: %S %9u %U %I %O\"'
|
setentry "[ISDNLOG]" "REPFMTWWW" '\"%X %D %17.17H %T %-17.17F %-20.20l SI: %S %9u %U %I %O\"'
|
||||||
setentry "[ISDNLOG]" "OLABEL" "$OLABEL"
|
setentry "[ISDNLOG]" "OLABEL" "$OLABEL"
|
||||||
setentry "[ISDNLOG]" "ILABEL" "$ILABEL"
|
setentry "[ISDNLOG]" "ILABEL" "$ILABEL"
|
||||||
|
@ -102,9 +110,21 @@ setentry "[ISDNLOG]" "LOGFILE" "$LOGFILE"
|
||||||
|
|
||||||
|
|
||||||
# Change the variables $1 to \$1 and so one.
|
# Change the variables $1 to \$1 and so one.
|
||||||
sed -e "s/\([^\]\)\$\([0-9][ ]\)/\1\\\\$\2/g" $CONFFILE >$RESFILE
|
sed -e "s/\([^\]\)\$\([0-9][ ]\)/\1\\\\$\2/g" $CONFFILE |\
|
||||||
|
sed -e "s/\([^\]\)\$\([0-9][ ]\)/\1\\\\$\2/g" >$RESFILE
|
||||||
cp $RESFILE $CONFFILE
|
cp $RESFILE $CONFFILE
|
||||||
|
|
||||||
rm -f $RESFILE
|
|
||||||
|
|
||||||
echo " Ready."
|
echo " Ready."
|
||||||
|
|
||||||
|
if [ -f $USERFILE ]
|
||||||
|
then
|
||||||
|
# Change the variables $1 to \$1 and so one.
|
||||||
|
echo -n "Adding some entries to the config file \"$CALLERIDFILE\"..."
|
||||||
|
sed -e "s/\([^\]\)\$\([0-9][ ]\)/\1\\\\$\2/g" $CALLERIDFILE |\
|
||||||
|
sed -e "s/\(NUMBER[ ]*=[ ]*\)\*/\1/" |\
|
||||||
|
sed -e "s/\([^\]\)\$\([0-9][ ]\)/\1\\\\$\2/g" >$RESFILE
|
||||||
|
cp $RESFILE $CALLERIDFILE
|
||||||
|
echo " Ready."
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f $RESFILE
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: isdnrep.c,v 1.25 1997/05/17 14:58:28 luethje Exp $
|
/* $Id: isdnrep.c,v 1.26 1997/05/19 22:58:18 luethje Exp $
|
||||||
*
|
*
|
||||||
* ISDN accounting for isdn4linux. (Report-module)
|
* ISDN accounting for isdn4linux. (Report-module)
|
||||||
*
|
*
|
||||||
|
@ -20,6 +20,12 @@
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*
|
*
|
||||||
* $Log: isdnrep.c,v $
|
* $Log: isdnrep.c,v $
|
||||||
|
* Revision 1.26 1997/05/19 22:58:18 luethje
|
||||||
|
* - bugfix: it is possible to install isdnlog now
|
||||||
|
* - improved performance for read files for vbox files and mgetty files.
|
||||||
|
* - it is possible to decide via config if you want to use avon or
|
||||||
|
* areacode.
|
||||||
|
*
|
||||||
* Revision 1.25 1997/05/17 14:58:28 luethje
|
* Revision 1.25 1997/05/17 14:58:28 luethje
|
||||||
* bug fix in HTML-Link
|
* bug fix in HTML-Link
|
||||||
*
|
*
|
||||||
|
@ -223,6 +229,9 @@
|
||||||
#define C_VBOX 'v'
|
#define C_VBOX 'v'
|
||||||
#define C_FAX 'f'
|
#define C_FAX 'f'
|
||||||
|
|
||||||
|
#define F_VBOX 1
|
||||||
|
#define F_FAX 2
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define F_BEGIN 1
|
#define F_BEGIN 1
|
||||||
|
@ -352,6 +361,7 @@ static int file_root_size = 0;
|
||||||
static int file_root_member = 0;
|
static int file_root_member = 0;
|
||||||
static char *_myname;
|
static char *_myname;
|
||||||
static time_t _begintime;
|
static time_t _begintime;
|
||||||
|
static int read_path = 0;
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
@ -471,9 +481,6 @@ int read_logfile(char *myname)
|
||||||
if (html & H_PRINT_HEADER)
|
if (html & H_PRINT_HEADER)
|
||||||
html_header();
|
html_header();
|
||||||
|
|
||||||
if (html)
|
|
||||||
get_file_list();
|
|
||||||
|
|
||||||
if (lineformat == NULL)
|
if (lineformat == NULL)
|
||||||
{
|
{
|
||||||
if (html)
|
if (html)
|
||||||
|
@ -485,6 +492,10 @@ int read_logfile(char *myname)
|
||||||
if (get_format(lineformat) == NULL)
|
if (get_format(lineformat) == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
/* following two lines must be after get_format()! */
|
||||||
|
if (html)
|
||||||
|
get_file_list();
|
||||||
|
|
||||||
clear_sum(&day_sum);
|
clear_sum(&day_sum);
|
||||||
clear_sum(&day_com_sum);
|
clear_sum(&day_com_sum);
|
||||||
clear_sum(&all_sum);
|
clear_sum(&all_sum);
|
||||||
|
@ -1525,6 +1536,15 @@ static prt_fmt** get_format(const char *format)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch (Type)
|
||||||
|
{
|
||||||
|
case 'C': read_path |= F_VBOX;
|
||||||
|
break;
|
||||||
|
case 'G': read_path |= F_FAX;
|
||||||
|
break;
|
||||||
|
default : break;
|
||||||
|
}
|
||||||
|
|
||||||
fmt->s_type= Type;
|
fmt->s_type= Type;
|
||||||
fmt->range = strdup(Range);
|
fmt->range = strdup(Range);
|
||||||
fmt->type = FMT_FMT;
|
fmt->type = FMT_FMT;
|
||||||
|
@ -2485,8 +2505,11 @@ static char *print_diff_date(char *start, char *stop)
|
||||||
|
|
||||||
static int get_file_list(void)
|
static int get_file_list(void)
|
||||||
{
|
{
|
||||||
set_dir_entries(vboxpath,set_vbox_entry);
|
if (read_path & F_VBOX)
|
||||||
set_dir_entries(mgettypath,set_mgetty_entry);
|
set_dir_entries(vboxpath,set_vbox_entry);
|
||||||
|
|
||||||
|
if (read_path & F_FAX)
|
||||||
|
set_dir_entries(mgettypath,set_mgetty_entry);
|
||||||
|
|
||||||
qsort(file_root,file_root_member,sizeof(file_list*),Compare_files);
|
qsort(file_root,file_root_member,sizeof(file_list*),Compare_files);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
32
lib/Makefile
32
lib/Makefile
|
@ -36,29 +36,31 @@ endif
|
||||||
CC = $(_CC)
|
CC = $(_CC)
|
||||||
|
|
||||||
export AVON = avon
|
export AVON = avon
|
||||||
|
export I4LCONFDIR
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
# DON'T EDIT BELOW THIS LINE
|
# DON'T EDIT BELOW THIS LINE
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
ifdef LIBAREA
|
AREADIR = ../areacode
|
||||||
LIBDIR = areacode
|
LIB_AREA = $(AREADIR)/areacode.o
|
||||||
LIB_AREA = $(LIBDIR)/areacode.o
|
|
||||||
DEFS += -DLIBAREA
|
ifeq ($(LIBAREA),1)
|
||||||
else
|
DEFS += -DLIBAREA
|
||||||
LIBDIR = avon
|
|
||||||
LIB_AREA = $(LIBDIR)/createDB.o
|
|
||||||
DEFS += -DAVON=\"$(AVON)\"
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
SUBDIRS = $(LIBDIR)
|
AVONDIR = avon
|
||||||
|
LIB_AVON += $(AVONDIR)/createDB.o
|
||||||
|
DEFS += -DAVON=\"$(AVON)\"
|
||||||
|
|
||||||
|
SUBDIRS = $(AVONDIR) #$(AREADIR)
|
||||||
|
|
||||||
DEFS += -I$(PREFIXDIR)
|
DEFS += -I$(PREFIXDIR)
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(CC) $(CFLAGS) $(DEFS) -c -o $@ $<
|
$(CC) $(CFLAGS) $(DEFS) -c -o $@ $<
|
||||||
|
|
||||||
all: libs libisdn.a
|
all: .depend libs libisdn.a
|
||||||
|
|
||||||
libs:
|
libs:
|
||||||
set -e; for i in `echo $(SUBDIRS)`; do $(MAKE) -C $$i; done
|
set -e; for i in `echo $(SUBDIRS)`; do $(MAKE) -C $$i; done
|
||||||
|
@ -80,14 +82,18 @@ distclean: clean
|
||||||
install: depend all
|
install: depend all
|
||||||
set -e; for i in `echo $(SUBDIRS)`; do $(MAKE) -C $$i depend; done
|
set -e; for i in `echo $(SUBDIRS)`; do $(MAKE) -C $$i depend; done
|
||||||
set -e; for i in `echo $(SUBDIRS)`; do $(MAKE) -C $$i all; done
|
set -e; for i in `echo $(SUBDIRS)`; do $(MAKE) -C $$i all; done
|
||||||
set -e; for i in `echo $(SUBDIRS)`; do $(MAKE) -C $$i install; done
|
ifneq ($(CONFIG_LIB_AREACODE),y)
|
||||||
|
set -e; for i in `echo $(AVONDIR)`; do $(MAKE) -C $$i install; done
|
||||||
|
#else
|
||||||
|
# set -e; for i in `echo $(AREADIR)`; do $(MAKE) -C $$i install; done
|
||||||
|
endif
|
||||||
|
|
||||||
deinstall: distclean
|
deinstall: distclean
|
||||||
set -e; for i in `echo $(SUBDIRS)`; do $(MAKE) -C $$i deinstall; done
|
set -e; for i in `echo $(SUBDIRS)`; do $(MAKE) -C $$i deinstall; done
|
||||||
|
|
||||||
|
|
||||||
libisdn.a: conffile.o isdntools.o libtools.o $(LIB_AREA)
|
libisdn.a: conffile.o isdntools.o libtools.o $(LIB_AREA) $(LIB_AVON)
|
||||||
ar rs libisdn.a isdntools.o conffile.o libtools.o $(LIB_AREA)
|
ar rs libisdn.a isdntools.o conffile.o libtools.o $(LIB_AREA) $(LIB_AVON)
|
||||||
|
|
||||||
ifeq (.depend,$(wildcard .depend))
|
ifeq (.depend,$(wildcard .depend))
|
||||||
include .depend
|
include .depend
|
||||||
|
|
|
@ -57,13 +57,16 @@ distclean:
|
||||||
# TODO: build a shared version and install it.
|
# TODO: build a shared version and install it.
|
||||||
#
|
#
|
||||||
install-avon:
|
install-avon:
|
||||||
$(MAKE) -f Makefile I4LCONFDIR=$(LIB_AVON_DATA) install
|
$(MAKE) -f Makefile I4LCONFDIR=$(CONFIG_I4LCONFDIR) install
|
||||||
|
|
||||||
uninstall-avon:
|
uninstall-avon:
|
||||||
$(MAKE) -f Makefile I4LCONFDIR=$(LIB_AVON_DATA) deinstall
|
$(MAKE) -f Makefile I4LCONFDIR=$(CONFIG_I4LCONFDIR) deinstall
|
||||||
|
|
||||||
ifeq ($(CONFIG_LIB_AREACODE),y)
|
ifeq ($(CONFIG_LIB_AREACODE),y)
|
||||||
|
|
||||||
install:
|
install:
|
||||||
|
$(MAKE) -f Makefile $(BUILDOPTS) all
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
else
|
else
|
||||||
install: install-avon
|
install: install-avon
|
||||||
|
|
|
@ -24,6 +24,7 @@ else
|
||||||
PREFIXDIR =$(ROOTDIR)
|
PREFIXDIR =$(ROOTDIR)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
# USER CONFIGURATION AREA
|
# USER CONFIGURATION AREA
|
||||||
######################################################################
|
######################################################################
|
||||||
|
@ -37,6 +38,10 @@ CC = $(_CC)
|
||||||
# DON'T EDIT BELOW THIS LINE
|
# DON'T EDIT BELOW THIS LINE
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
|
INSTALL =install
|
||||||
|
INSTALL_DIR := $(INSTALL) -m 0755 -o 0 -g 0 -d
|
||||||
|
INSTALL_AVON := $(INSTALL) -m 0644 $(AVON) $(I4LCONFDIR)
|
||||||
|
|
||||||
#CFLAGS = -I$(PREFIXDIR)
|
#CFLAGS = -I$(PREFIXDIR)
|
||||||
|
|
||||||
all: createDB.o
|
all: createDB.o
|
||||||
|
@ -53,12 +58,14 @@ distclean: clean
|
||||||
rm -f .depend
|
rm -f .depend
|
||||||
|
|
||||||
install: depend all
|
install: depend all
|
||||||
-test $(AVON) -ot $(I4LCONFDIR)/$(AVON) || ( $(INSTALL) -m 644 $(AVON) $(I4LCONFDIR) )
|
ifneq ($(CONFIG_LIB_AREACODE),y)
|
||||||
# -rm -f $(I4LCONFDIR)/$(AVON).pag $(I4LCONFDIR)/$(AVON).dir
|
-$(INSTALL_DIR) $(I4LCONFDIR)
|
||||||
|
-test $(AVON) -ot $(I4LCONFDIR)/$(AVON) || ( $(INSTALL_AVON) )
|
||||||
|
-@rm -f $(I4LCONFDIR)/$(AVON).pag $(I4LCONFDIR)/$(AVON).dir
|
||||||
|
endif
|
||||||
|
|
||||||
deinstall: distclean
|
deinstall: distclean
|
||||||
-rm -f $(I4LCONFDIR)/$(AVON)*
|
-rm -f $(I4LCONFDIR)/$(AVON)*
|
||||||
|
|
||||||
|
|
||||||
createDB.o: createDB.c createDB.h
|
createDB.o: createDB.c createDB.h
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: createDB.c,v 1.2 1997/04/17 23:29:50 luethje Exp $
|
/* $Id: createDB.c,v 1.3 1997/05/19 22:58:34 luethje Exp $
|
||||||
*
|
*
|
||||||
* ISDN accounting for isdn4linux. (Utilities)
|
* ISDN accounting for isdn4linux. (Utilities)
|
||||||
*
|
*
|
||||||
|
@ -19,6 +19,12 @@
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*
|
*
|
||||||
* $Log: createDB.c,v $
|
* $Log: createDB.c,v $
|
||||||
|
* Revision 1.3 1997/05/19 22:58:34 luethje
|
||||||
|
* - bugfix: it is possible to install isdnlog now
|
||||||
|
* - improved performance for read files for vbox files and mgetty files.
|
||||||
|
* - it is possible to decide via config if you want to use avon or
|
||||||
|
* areacode.
|
||||||
|
*
|
||||||
* Revision 1.2 1997/04/17 23:29:50 luethje
|
* Revision 1.2 1997/04/17 23:29:50 luethje
|
||||||
* new structure of isdnrep completed.
|
* new structure of isdnrep completed.
|
||||||
*
|
*
|
||||||
|
@ -36,11 +42,16 @@
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
#include "createDB.h"
|
#include "createDB.h"
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|
||||||
|
#define FILEMODE 0664
|
||||||
|
|
||||||
|
/****************************************************************************/
|
||||||
|
|
||||||
static int ln = 0;
|
static int ln = 0;
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
@ -49,7 +60,7 @@ static int (*print_msg)(const char *, ...) = printf;
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|
||||||
void set_print_fkt_for_avon(int (*new_print_msg)(const char *, ...))
|
void set_print_fct_for_avon(int (*new_print_msg)(const char *, ...))
|
||||||
{
|
{
|
||||||
print_msg = new_print_msg;
|
print_msg = new_print_msg;
|
||||||
}
|
}
|
||||||
|
@ -66,27 +77,37 @@ int createDB(char *fn, int force)
|
||||||
sprintf(s, "%s.dir", fn);
|
sprintf(s, "%s.dir", fn);
|
||||||
|
|
||||||
if (force || stat(s, &statbuf)) {
|
if (force || stat(s, &statbuf)) {
|
||||||
if ((f = open(s, O_CREAT | O_TRUNC | O_RDWR, 0666)) >= 0) {
|
if ((f = open(s, O_CREAT | O_TRUNC | O_RDWR, FILEMODE)) >= 0) {
|
||||||
close(f);
|
close(f);
|
||||||
|
|
||||||
sprintf(s, "%s.pag", fn);
|
sprintf(s, "%s.pag", fn);
|
||||||
|
|
||||||
if ((f = open(s, O_CREAT | O_TRUNC | O_RDWR, 0666)) >= 0) {
|
if ((f = open(s, O_CREAT | O_TRUNC | O_RDWR, FILEMODE)) >= 0) {
|
||||||
close(f);
|
close(f);
|
||||||
|
|
||||||
return(1);
|
if(!openDB(fn, O_RDWR | O_CREAT))
|
||||||
|
{
|
||||||
|
readAVON(fn);
|
||||||
|
closeDB();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
} /* if */
|
} /* if */
|
||||||
|
else
|
||||||
|
print_msg("Can not open file `%s': %s!\n",s,strerror(errno));
|
||||||
} /* if */
|
} /* if */
|
||||||
|
else
|
||||||
|
print_msg("Can not open file `%s': %s!\n",s,strerror(errno));
|
||||||
|
|
||||||
} /* if */
|
} /* if */
|
||||||
|
|
||||||
return(0);
|
return(-1);
|
||||||
} /* createDB */
|
} /* createDB */
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
int openDB(char *fn)
|
int openDB(char *fn, int flag)
|
||||||
{
|
{
|
||||||
dbm = dbm_open(fn, O_RDWR | O_CREAT, 0666);
|
dbm = dbm_open(fn, flag, FILEMODE);
|
||||||
return((dbm == (DBM *)NULL) ? -1 : 0);
|
return((dbm == (DBM *)NULL) ? -1 : 0);
|
||||||
} /* dbminit */
|
} /* dbminit */
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: createDB.h,v 1.2 1997/04/17 23:29:51 luethje Exp $
|
/* $Id: createDB.h,v 1.3 1997/05/19 22:58:36 luethje Exp $
|
||||||
*
|
*
|
||||||
* ISDN accounting for isdn4linux.
|
* ISDN accounting for isdn4linux.
|
||||||
*
|
*
|
||||||
|
@ -19,6 +19,12 @@
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*
|
*
|
||||||
* $Log: createDB.h,v $
|
* $Log: createDB.h,v $
|
||||||
|
* Revision 1.3 1997/05/19 22:58:36 luethje
|
||||||
|
* - bugfix: it is possible to install isdnlog now
|
||||||
|
* - improved performance for read files for vbox files and mgetty files.
|
||||||
|
* - it is possible to decide via config if you want to use avon or
|
||||||
|
* areacode.
|
||||||
|
*
|
||||||
* Revision 1.2 1997/04/17 23:29:51 luethje
|
* Revision 1.2 1997/04/17 23:29:51 luethje
|
||||||
* new structure of isdnrep completed.
|
* new structure of isdnrep completed.
|
||||||
*
|
*
|
||||||
|
@ -49,9 +55,9 @@
|
||||||
_EXTERN datum key, data;
|
_EXTERN datum key, data;
|
||||||
_EXTERN DBM *dbm SET_NULL;
|
_EXTERN DBM *dbm SET_NULL;
|
||||||
|
|
||||||
_EXTERN void set_print_fkt_for_avon(int (*new_print_msg)(const char *, ...));
|
_EXTERN void set_print_fct_for_avon(int (*new_print_msg)(const char *, ...));
|
||||||
_EXTERN int createDB(char *fn, int force);
|
_EXTERN int createDB(char *fn, int force);
|
||||||
_EXTERN int openDB(char *fn);
|
_EXTERN int openDB(char *fn, int flag);
|
||||||
_EXTERN void closeDB();
|
_EXTERN void closeDB();
|
||||||
_EXTERN void insertDB(char *num, char *area);
|
_EXTERN void insertDB(char *num, char *area);
|
||||||
_EXTERN void readAVON(char *fn);
|
_EXTERN void readAVON(char *fn);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: isdntools.c,v 1.12 1997/05/09 23:31:06 luethje Exp $
|
/* $Id: isdntools.c,v 1.13 1997/05/19 22:58:28 luethje Exp $
|
||||||
*
|
*
|
||||||
* ISDN accounting for isdn4linux. (Utilities)
|
* ISDN accounting for isdn4linux. (Utilities)
|
||||||
*
|
*
|
||||||
|
@ -19,6 +19,12 @@
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*
|
*
|
||||||
* $Log: isdntools.c,v $
|
* $Log: isdntools.c,v $
|
||||||
|
* Revision 1.13 1997/05/19 22:58:28 luethje
|
||||||
|
* - bugfix: it is possible to install isdnlog now
|
||||||
|
* - improved performance for read files for vbox files and mgetty files.
|
||||||
|
* - it is possible to decide via config if you want to use avon or
|
||||||
|
* areacode.
|
||||||
|
*
|
||||||
* Revision 1.12 1997/05/09 23:31:06 luethje
|
* Revision 1.12 1997/05/09 23:31:06 luethje
|
||||||
* isdnlog: new switch -O
|
* isdnlog: new switch -O
|
||||||
* isdnrep: new format %S
|
* isdnrep: new format %S
|
||||||
|
@ -131,6 +137,7 @@
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|
||||||
static int (*print_msg)(const char *, ...) = printf;
|
static int (*print_msg)(const char *, ...) = printf;
|
||||||
|
static char *_get_avon(char *code, int *Len, int flag);
|
||||||
static char *_get_areacode(char *code, int *Len, int flag);
|
static char *_get_areacode(char *code, int *Len, int flag);
|
||||||
static int create_runfile(const char *file, const char *format);
|
static int create_runfile(const char *file, const char *format);
|
||||||
|
|
||||||
|
@ -178,7 +185,8 @@ static char countrycodes[][2][30] = {
|
||||||
{"", ""},
|
{"", ""},
|
||||||
};
|
};
|
||||||
|
|
||||||
char *avonlib;
|
static char *avonlib = NULL;
|
||||||
|
static char *codelib = NULL;
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|
||||||
|
@ -187,9 +195,7 @@ void set_print_fct_for_lib(int (*new_print_msg)(const char *, ...))
|
||||||
print_msg = new_print_msg;
|
print_msg = new_print_msg;
|
||||||
set_print_fct_for_conffile(new_print_msg);
|
set_print_fct_for_conffile(new_print_msg);
|
||||||
set_print_fct_for_libtools(new_print_msg);
|
set_print_fct_for_libtools(new_print_msg);
|
||||||
#ifndef LIBAREA
|
|
||||||
set_print_fct_for_avon(new_print_msg);
|
set_print_fct_for_avon(new_print_msg);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
@ -498,11 +504,11 @@ static int create_runfile(const char *file, const char *format)
|
||||||
muss von jedem Programm aufgerufen werden!!!
|
muss von jedem Programm aufgerufen werden!!!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _MAX_VARS 5
|
#define _MAX_VARS 7
|
||||||
|
|
||||||
int Set_Codes(section* Section)
|
int Set_Codes(section* Section)
|
||||||
{
|
{
|
||||||
static char *ptr[_MAX_VARS] = {NULL,NULL,NULL,NULL,NULL};
|
static char *ptr[_MAX_VARS] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL};
|
||||||
int i;
|
int i;
|
||||||
int RetCode = 0;
|
int RetCode = 0;
|
||||||
entry *Entry;
|
entry *Entry;
|
||||||
|
@ -520,28 +526,30 @@ int Set_Codes(section* Section)
|
||||||
if ((SPtr = Get_Section(Section,CONF_SEC_GLOBAL)) == NULL)
|
if ((SPtr = Get_Section(Section,CONF_SEC_GLOBAL)) == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
#ifdef LIBAREA
|
|
||||||
if ((Entry = Get_Entry(SPtr->entries,CONF_ENT_AREALIB)) != NULL &&
|
if ((Entry = Get_Entry(SPtr->entries,CONF_ENT_AREALIB)) != NULL &&
|
||||||
Entry->value != NULL )
|
Entry->value != NULL )
|
||||||
ptr[0] = acFileName = strdup(Entry->value);
|
ptr[0] = acFileName = strdup(Entry->value);
|
||||||
#else
|
|
||||||
if ((Entry = Get_Entry(SPtr->entries,CONF_ENT_AVONLIB)) != NULL &&
|
if ((Entry = Get_Entry(SPtr->entries,CONF_ENT_AVONLIB)) != NULL &&
|
||||||
Entry->value != NULL )
|
Entry->value != NULL )
|
||||||
ptr[0] = avonlib = strdup(Entry->value);
|
ptr[1] = avonlib = strdup(Entry->value);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf(s, "%s%c%s", confdir(), C_SLASH, AVON);
|
sprintf(s, "%s%c%s", confdir(), C_SLASH, AVON);
|
||||||
ptr[0] = avonlib = strdup(s);
|
ptr[1] = avonlib = strdup(s);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if ((Entry = Get_Entry(SPtr->entries,CONF_ENT_COUNTRY_PREFIX)) != NULL &&
|
if ((Entry = Get_Entry(SPtr->entries,CONF_ENT_COUNTRY_PREFIX)) != NULL &&
|
||||||
Entry->value != NULL )
|
Entry->value != NULL )
|
||||||
ptr[1] = countryprefix = strdup(Entry->value);
|
ptr[2] = countryprefix = strdup(Entry->value);
|
||||||
|
|
||||||
if ((Entry = Get_Entry(SPtr->entries,CONF_ENT_AREA_PREFIX)) != NULL &&
|
if ((Entry = Get_Entry(SPtr->entries,CONF_ENT_AREA_PREFIX)) != NULL &&
|
||||||
Entry->value != NULL )
|
Entry->value != NULL )
|
||||||
ptr[2] = areaprefix = strdup(Entry->value);
|
ptr[3] = areaprefix = strdup(Entry->value);
|
||||||
|
|
||||||
|
if ((Entry = Get_Entry(SPtr->entries,CONF_ENT_CODELIB)) != NULL &&
|
||||||
|
Entry->value != NULL )
|
||||||
|
ptr[4] = codelib = strdup(Entry->value);
|
||||||
|
|
||||||
if ((Entry = Get_Entry(SPtr->entries,CONF_ENT_AREA)) != NULL &&
|
if ((Entry = Get_Entry(SPtr->entries,CONF_ENT_AREA)) != NULL &&
|
||||||
Entry->value != NULL )
|
Entry->value != NULL )
|
||||||
|
@ -549,11 +557,11 @@ int Set_Codes(section* Section)
|
||||||
ptr2 = Entry->value;
|
ptr2 = Entry->value;
|
||||||
|
|
||||||
if (strncmp(Entry->value,areaprefix,strlen(areaprefix)))
|
if (strncmp(Entry->value,areaprefix,strlen(areaprefix)))
|
||||||
ptr[3] = myarea = strdup(ptr2);
|
ptr[5] = myarea = strdup(ptr2);
|
||||||
else
|
else
|
||||||
ptr[3] = myarea = strdup(ptr2+strlen(areaprefix));
|
ptr[5] = myarea = strdup(ptr2+strlen(areaprefix));
|
||||||
|
|
||||||
if (ptr[3] != NULL)
|
if (ptr[5] != NULL)
|
||||||
RetCode++;
|
RetCode++;
|
||||||
else
|
else
|
||||||
print_msg("Error: Variable `%s' are not set!\n",CONF_ENT_AREA);
|
print_msg("Error: Variable `%s' are not set!\n",CONF_ENT_AREA);
|
||||||
|
@ -571,7 +579,7 @@ int Set_Codes(section* Section)
|
||||||
ptr2 = s;
|
ptr2 = s;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ptr[4] = mycountry = strdup(ptr2)) != NULL)
|
if ((ptr[6] = mycountry = strdup(ptr2)) != NULL)
|
||||||
RetCode++;
|
RetCode++;
|
||||||
else
|
else
|
||||||
print_msg("Error: Variable `%s' are not set!\n",CONF_ENT_COUNTRY);
|
print_msg("Error: Variable `%s' are not set!\n",CONF_ENT_COUNTRY);
|
||||||
|
@ -635,7 +643,19 @@ char *get_areacode(char *code, int *Len, int flag)
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((Ptr = _get_areacode(code,Len,flag)) != NULL)
|
if (codelib != NULL && !strcasecmp(codelib,"AVON"))
|
||||||
|
Ptr = _get_avon(code,Len,flag);
|
||||||
|
else
|
||||||
|
if (codelib != NULL && !strcasecmp(codelib,"AREACODE"))
|
||||||
|
Ptr = _get_areacode(code,Len,flag);
|
||||||
|
else
|
||||||
|
#ifdef LIBAREA
|
||||||
|
Ptr = _get_areacode(code,Len,flag);
|
||||||
|
#else
|
||||||
|
Ptr = _get_avon(code,Len,flag);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (Ptr != NULL)
|
||||||
return Ptr;
|
return Ptr;
|
||||||
|
|
||||||
i=0;
|
i=0;
|
||||||
|
@ -661,8 +681,7 @@ char *get_areacode(char *code, int *Len, int flag)
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|
||||||
#ifndef LIBAREA
|
static char *_get_avon(char *code, int *Len, int flag)
|
||||||
static char *_get_areacode(char *code, int *Len, int flag)
|
|
||||||
{
|
{
|
||||||
static int opened = 0;
|
static int opened = 0;
|
||||||
static char s[BUFSIZ];
|
static char s[BUFSIZ];
|
||||||
|
@ -680,18 +699,13 @@ static char *_get_areacode(char *code, int *Len, int flag)
|
||||||
|
|
||||||
if (!opened)
|
if (!opened)
|
||||||
{
|
{
|
||||||
auto char s[BUFSIZ];
|
|
||||||
|
|
||||||
|
|
||||||
if (avonlib == NULL && !(flag & C_NO_ERROR))
|
if (avonlib == NULL && !(flag & C_NO_ERROR))
|
||||||
print_msg("No path for AVON library defined!\n");
|
print_msg("No path for AVON library defined!\n");
|
||||||
|
|
||||||
if (!access(avonlib, R_OK))
|
if (!access(avonlib, R_OK))
|
||||||
{
|
{
|
||||||
if (createDB(avonlib, 0) && !openDB(avonlib))
|
createDB(avonlib,0);
|
||||||
readAVON(avonlib);
|
openDB(avonlib,O_WRONLY);
|
||||||
else
|
|
||||||
(void)openDB(avonlib);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
opened = 1;
|
opened = 1;
|
||||||
|
@ -723,11 +737,9 @@ static char *_get_areacode(char *code, int *Len, int flag)
|
||||||
|
|
||||||
return (s[0]?s:NULL);
|
return (s[0]?s:NULL);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|
||||||
#ifdef LIBAREA
|
|
||||||
static char *_get_areacode(char *code, int *Len, int flag)
|
static char *_get_areacode(char *code, int *Len, int flag)
|
||||||
{
|
{
|
||||||
auto int cc = 0;
|
auto int cc = 0;
|
||||||
|
@ -767,7 +779,6 @@ static char *_get_areacode(char *code, int *Len, int flag)
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
/* $Id: libisdn.h,v 1.6 1997/04/08 21:57:07 luethje Exp $
|
/* $Id: libisdn.h,v 1.7 1997/05/19 22:58:29 luethje Exp $
|
||||||
*
|
*
|
||||||
* ISDN accounting for isdn4linux.
|
* ISDN accounting for isdn4linux.
|
||||||
*
|
*
|
||||||
|
@ -20,6 +20,12 @@
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*
|
*
|
||||||
* $Log: libisdn.h,v $
|
* $Log: libisdn.h,v $
|
||||||
|
* Revision 1.7 1997/05/19 22:58:29 luethje
|
||||||
|
* - bugfix: it is possible to install isdnlog now
|
||||||
|
* - improved performance for read files for vbox files and mgetty files.
|
||||||
|
* - it is possible to decide via config if you want to use avon or
|
||||||
|
* areacode.
|
||||||
|
*
|
||||||
* Revision 1.6 1997/04/08 21:57:07 luethje
|
* Revision 1.6 1997/04/08 21:57:07 luethje
|
||||||
* Create the file isdn.conf
|
* Create the file isdn.conf
|
||||||
* some bug fixes for pid and lock file
|
* some bug fixes for pid and lock file
|
||||||
|
@ -45,11 +51,8 @@
|
||||||
#include "policy.h"
|
#include "policy.h"
|
||||||
#include "conffile.h"
|
#include "conffile.h"
|
||||||
|
|
||||||
#ifdef LIBAREA
|
#include "areacode/areacode.h"
|
||||||
# include "areacode/areacode.h"
|
#include "avon/createDB.h"
|
||||||
#else
|
|
||||||
# include "avon/createDB.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|
||||||
|
@ -115,6 +118,7 @@ extern char *basename __P((__const char *__name));
|
||||||
#define CONF_ENT_AREA "AREACODE"
|
#define CONF_ENT_AREA "AREACODE"
|
||||||
#define CONF_ENT_AREALIB "AREALIB"
|
#define CONF_ENT_AREALIB "AREALIB"
|
||||||
#define CONF_ENT_AVONLIB "AVON"
|
#define CONF_ENT_AVONLIB "AVON"
|
||||||
|
#define CONF_ENT_CODELIB "CODELIB"
|
||||||
|
|
||||||
#define CONF_SEC_VAR "VARIABLES"
|
#define CONF_SEC_VAR "VARIABLES"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue