diff --git a/isdnlog/holiday-default.dat b/isdnlog/holiday-default.dat new file mode 100644 index 00000000..60e8d72d --- /dev/null +++ b/isdnlog/holiday-default.dat @@ -0,0 +1,18 @@ +V:-0.1 default [2001/10/10] + +W:1 Monday +W:2 Tuesday +W:3 Wednesday +W:4 Thursday +W:5 Friday +W:6 Saturday +W:7 Sunday +W:W weekday +W:E weekend +W:H holiday +W:* everyday + +D:1.1 New Year's Day +D:easter Easter +D:1.5 May Day +D:25.12 Christmas diff --git a/isdnlog/rate-default.dat b/isdnlog/rate-default.dat new file mode 100644 index 00000000..8df0bf69 --- /dev/null +++ b/isdnlog/rate-default.dat @@ -0,0 +1,12 @@ +V:0.01-default [2001/10/10] + +U:%.3f UNITS + +P:10 . +B:1234 +D:x + +# 1 currency unit per minute +Z:1 . +A:* +T:*/*=1.00/60 diff --git a/isdnlog/samples/rate.conf.default b/isdnlog/samples/rate.conf.default new file mode 100644 index 00000000..784bf87a --- /dev/null +++ b/isdnlog/samples/rate.conf.default @@ -0,0 +1 @@ +P:10 diff --git a/isdnlog/samples/stop b/isdnlog/samples/stop index 93f94d7c..c368cccc 100644 --- a/isdnlog/samples/stop +++ b/isdnlog/samples/stop @@ -1,37 +1,53 @@ #!/bin/sh -# very simple reload-example for the new chargemax feature of isdnlog -# this is called by isdnlog every time we get a AOCD and chargesum of -# active device is greater then CHARGEMAX. -# there are three parameter available: +# Very simple reload default for the chargemax feature of isdnlog. +# This is called by isdnlog every time we get a AOCD and chargesum of +# active device is greater than CHARGEMAX. +# there are three parameters available: # # first ($1) is chargesum-CHARGEMAX # second ($2) is ALIAS as defined in ISDNLOG.CONF # third ($3) is total chargesum for active device +msg=`tempfile -p isdn` + +myecho() { + echo "$@" >> $msg +} + case "$1" in 5\.*) - echo "WARNING, charge-limit set by CHARGEMAX is reached!" >> /dev/console - echo "$2 is talking to much!" >> /dev/console -# /bin/aplay /usr/sounds/attention.au + myecho "WARNING, charge-limit set by CHARGEMAX is reached!" + myecho "$2 is talking too much!" +# /bin/play /usr/sounds/attention.au ;; 10\.* | 11\.* ) - echo "WARNING, $2 got charge-overflow == $1, total chargesum == $3" >> /dev/console - echo "next chargeint will cause i4l to stop" >> /dev/console -# /bin/aplay /usr/sounds/earthdestruction.au + myecho "WARNING, $2 got charge-overflow == $1, total chargesum == $3" + myecho "next chargeint will cause i4l to stop" +# /bin/play /usr/sounds/earthdestruction.au ;; 20\.* | 21\.* ) - echo "reload got charge-overflow == $1, now i4l will be stopped!" >> /dev/console - /sbin/init.d/i4l stop + myecho "reload got charge-overflow == $1, now ipppd will be stopped!" + /sbin/init.d/isdnutils stop ipppd ;; 25\.* | 26\.* ) - echo "aeh, still alive?! so we'll do a reboot!!" >> /dev/console -# /bin/aplay /usr/sounds/crash.au - /sbin/reboot +# echo "aeh, still alive?! so we'll do a reboot!!" >> /dev/console +# /bin/play /usr/sounds/crash.au +# /sbin/reboot + myecho "still alive?! Stopping ISDN subsystem!" + /usr/sbin/isdnctrl system off ;; esac -echo "got charge_ov=$1 dev=$2 scharge=$3 " >> /dev/console +myecho "got charge_ov=$1 dev=$2 scharge=$3 " + +if [ -s "$msg" ]; then + logger -f $msg -p daemon.notice -t isdnlog + cat $msg >> /dev/console +fi +rm -f $msg + +exit 0 diff --git a/isdnlog/tools/cdb/Makefile.in b/isdnlog/tools/cdb/Makefile.in index 35e84288..672a933c 100644 --- a/isdnlog/tools/cdb/Makefile.in +++ b/isdnlog/tools/cdb/Makefile.in @@ -43,15 +43,15 @@ distclean: clean -rm config.{status,log,h,cache} Makefile .depend install-dirs: - install -d -m0755 $(MAN1DIR) $(MAN3DIR) $(LIBDIR) $(BINDIR) \ - $(INCDIR) + install -d -m0755 $(MAN1DIR) $(MAN3DIR) $(LIBDIR) $(BINDIR) $(INCDIR) install: - install -m0755 $(BINS) $(BINDIR) - install -m0644 $(MAN1) $(MAN1DIR) - install -m0644 $(MAN3) $(MAN3DIR) - install -m0644 $(LIBS) $(LIBDIR) - install -m0644 freecdb.h freecdbmake.h $(INCDIR) + true + # install -m0755 $(BINS) $(BINDIR) + # install -m0644 $(MAN1) $(MAN1DIR) + # install -m0644 $(MAN3) $(MAN3DIR) + # install -m0644 $(LIBS) $(LIBDIR) + # install -m0644 freecdb.h freecdbmake.h $(INCDIR) cdbdump: cdbdump.o cdb_unpack.o diff --git a/isdnlog/tools/isdnrate.man b/isdnlog/tools/isdnrate.man index c4cf8205..5d5b2b1c 100644 --- a/isdnlog/tools/isdnrate.man +++ b/isdnlog/tools/isdnrate.man @@ -145,8 +145,9 @@ Connect to a running isdnrate daemon. This avoids long startup times. .P .B \-D Start as a daemon, waiting for connections from a client. The socket -.I /tmp/isdnrate -is created, which clients can connect to. +.I /var/run/isdnrate/socket +is created, which clients can connect to +(the socket can be changed by using the -O option). .P .B \-D2 Start as a daemon and go background. @@ -171,8 +172,8 @@ Show info about following numbers. If no provider is given, the preselected provider is used. .P .BI \-O socketfile -Write socket to given filename on start of daemon. Default is -.IR tmp/isdnrate . +Use given filename as the socket on start of daemon. Default is +.IR /var/run/isdnrate/socket . .P .BI \-P piddir Write own PID to diff --git a/isdnlog/tools/tools.h b/isdnlog/tools/tools.h index ddd98a8a..eabd9e1b 100644 --- a/isdnlog/tools/tools.h +++ b/isdnlog/tools/tools.h @@ -622,6 +622,13 @@ #define _GNU_SOURCE 1 +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -630,12 +637,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include #include #include #include diff --git a/isdnlog/tools/zone.c b/isdnlog/tools/zone.c index e4b34d53..e0a064db 100644 --- a/isdnlog/tools/zone.c +++ b/isdnlog/tools/zone.c @@ -523,7 +523,8 @@ static int _getZ(struct sth *sthp, char *from, char *sto) { from=sto; sto=temp; } - strncpy(newfrom, from, LENGTH-1); + if (newfrom != from) + memmove(newfrom, from, LENGTH-1); while (strlen(newfrom)) { UL lifrom = (UL) atol(newfrom); /* keys could be long */ US ifrom = (US) lifrom;