isdnlog: close all files and open again after kill -HUP
isdnrep: support vbox version 2.0 isdnconf: changes by Roderich Schupp <roderich@syntec.m.EUnet.de> conffile: ignore spaces at the end of a line
This commit is contained in:
parent
27d569f592
commit
0c4679d06a
|
@ -1,4 +1,4 @@
|
||||||
## $Id: Makefile.in,v 1.27 1997/05/20 19:00:51 luethje Exp $
|
## $Id: Makefile.in,v 1.28 1997/05/25 19:40:43 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.28 1997/05/25 19:40:43 luethje
|
||||||
|
## isdnlog: close all files and open again after kill -HUP
|
||||||
|
## isdnrep: support vbox version 2.0
|
||||||
|
## isdnconf: changes by Roderich Schupp <roderich@syntec.m.EUnet.de>
|
||||||
|
## conffile: ignore spaces at the end of a line
|
||||||
|
##
|
||||||
## Revision 1.27 1997/05/20 19:00:51 luethje
|
## Revision 1.27 1997/05/20 19:00:51 luethje
|
||||||
## some primitve changes
|
## some primitve changes
|
||||||
##
|
##
|
||||||
|
@ -226,7 +232,7 @@ SERVICEFILE = /etc/services
|
||||||
# DON'T EDIT BELOW THIS LINE
|
# DON'T EDIT BELOW THIS LINE
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
VERSION = 2.99.20
|
VERSION = 2.99.21
|
||||||
|
|
||||||
ifeq ($(POSTGRES),1)
|
ifeq ($(POSTGRES),1)
|
||||||
DEFS += -DPOSTGRES
|
DEFS += -DPOSTGRES
|
||||||
|
|
|
@ -682,7 +682,8 @@ starten. Eine genaue Beschreibung findet man unter dem Kapitel isdnrep.
|
||||||
Dieser Eintrag ist optional.
|
Dieser Eintrag ist optional.
|
||||||
|
|
||||||
Beipiel:
|
Beipiel:
|
||||||
VBOXCMD = /usr/bin/zyxeltowav
|
VBOXCMD1 = /usr/bin/zyxeltowav # Fuer Version vbox 0.x und 1.x
|
||||||
|
VBOXCMD2 = /usr/bin/zyxeltowav # Fuer Version vbox 2.x
|
||||||
|
|
||||||
Wenn der isdnrep via HTML angekommene Faxe anzeigen soll, dann muss hier
|
Wenn der isdnrep via HTML angekommene Faxe anzeigen soll, dann muss hier
|
||||||
der Pfad eingetragen werden. Eine genaue Beschreibung findet man unter
|
der Pfad eingetragen werden. Eine genaue Beschreibung findet man unter
|
||||||
|
@ -2083,6 +2084,7 @@ angegeben werden.
|
||||||
8 die Byte-Angaben ("ibyte", "obyte")
|
8 die Byte-Angaben ("ibyte", "obyte")
|
||||||
Hier koennen auch Kombinationen angegeben werden
|
Hier koennen auch Kombinationen angegeben werden
|
||||||
(z.b. 2 + 4 = 6 == "/dev/isdnctrl" und "/dev/isdninfo")
|
(z.b. 2 + 4 = 6 == "/dev/isdnctrl" und "/dev/isdninfo")
|
||||||
|
Diese Datei wird bei einem "kill -HUP" geschlossen und wieder geoeffnet.
|
||||||
(log=X)
|
(log=X)
|
||||||
|
|
||||||
-s isdnlog fuehrt nach jedem Schreibzugriff auf die "/tmp/isdnctrl0"
|
-s isdnlog fuehrt nach jedem Schreibzugriff auf die "/tmp/isdnctrl0"
|
||||||
|
@ -2104,6 +2106,7 @@ angegeben werden.
|
||||||
werden soll. Nur gueltig mit Option -m zusammen!
|
werden soll. Nur gueltig mit Option -m zusammen!
|
||||||
Es ist moeglich parallel die Option -C X zu setzen. Dann wird
|
Es ist moeglich parallel die Option -C X zu setzen. Dann wird
|
||||||
sowohl auf der Console als auch in der Datei die Ausgabe ausgegeben.
|
sowohl auf der Console als auch in der Datei die Ausgabe ausgegeben.
|
||||||
|
Diese Datei wird bei einem "kill -HUP" geschlossen und wieder geoeffnet.
|
||||||
(outfile="value")
|
(outfile="value")
|
||||||
|
|
||||||
-lX Angabe der gewuenschten Meldungen, die in's syslog eingetragen
|
-lX Angabe der gewuenschten Meldungen, die in's syslog eingetragen
|
||||||
|
@ -2714,14 +2717,22 @@ program /play/file
|
||||||
Dieses teilt man dem isdnrep wieder ueber die Datei isdn.conf mit. Es muss
|
Dieses teilt man dem isdnrep wieder ueber die Datei isdn.conf mit. Es muss
|
||||||
dort unter [ISDNLOG] der Eintrag
|
dort unter [ISDNLOG] der Eintrag
|
||||||
|
|
||||||
VBOXCMD = /usr/bin/program
|
VBOXCMD1 = /usr/bin/program1
|
||||||
|
|
||||||
eingefuegt werden.
|
fuer Version 0.x und 1.x vom vbox
|
||||||
Das Programm muss dann die Datei auf stdout ausgeben.
|
und
|
||||||
Das Programm muss zuerst den Datei-Typ bekanntgeben.
|
|
||||||
Um das Zyxel-Format in eine WAVE-Datei auszugeben, kann man folgendes Skript
|
VBOXCMD2 = /usr/bin/program2
|
||||||
|
|
||||||
|
fuer Version 2.x vom vbox
|
||||||
|
eingefuegt werden. Es koennen auch beide gesetzt sein, da der isdnrep selber
|
||||||
|
erkennt, welches Format die entsprechende Datei hat.
|
||||||
|
|
||||||
|
Das Programm muss zuerst den Datei-Typ und die Sound-Datei auf stdout ausgeben.
|
||||||
|
Um das Zyxel-Format in eine WAVE-Datei auszugeben, kann man folgende Skripte
|
||||||
verwenden:
|
verwenden:
|
||||||
|
|
||||||
|
Fuer Version 0.x und 1.x:
|
||||||
-----------------------------------------------------------
|
-----------------------------------------------------------
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
##
|
##
|
||||||
|
@ -2730,7 +2741,7 @@ verwenden:
|
||||||
## ACHTUNG! Wenn die Pfade falsch gesetzt sind oder fehlen,
|
## ACHTUNG! Wenn die Pfade falsch gesetzt sind oder fehlen,
|
||||||
## stuerzt netscape einfach ab!
|
## stuerzt netscape einfach ab!
|
||||||
|
|
||||||
PATH=$PATH:"Pfad zum sox":"Pfad zun den pvftools"
|
PATH=$PATH:"Pfad zum sox":"Pfad zu den pvftools"
|
||||||
FILENAME1=/tmp/voxplay.$$.voc
|
FILENAME1=/tmp/voxplay.$$.voc
|
||||||
FILENAME2=/tmp/voxplay.$$.wav
|
FILENAME2=/tmp/voxplay.$$.wav
|
||||||
VOLUME=8
|
VOLUME=8
|
||||||
|
@ -2738,7 +2749,7 @@ VOLUME=8
|
||||||
zyxeltopvf < $1 | \
|
zyxeltopvf < $1 | \
|
||||||
pvfspeed 0.8 | \
|
pvfspeed 0.8 | \
|
||||||
pvfamp $VOLUME | \
|
pvfamp $VOLUME | \
|
||||||
pvfcut 0.8 | \
|
pvfcut 0.20 | \
|
||||||
pvftovoc > $FILENAME1
|
pvftovoc > $FILENAME1
|
||||||
|
|
||||||
sox $FILENAME1 $FILENAME2
|
sox $FILENAME1 $FILENAME2
|
||||||
|
@ -2750,9 +2761,38 @@ cat $FILENAME2
|
||||||
rm -f $FILENAME1 $FILENAME2
|
rm -f $FILENAME1 $FILENAME2
|
||||||
-----------------------------------------------------------
|
-----------------------------------------------------------
|
||||||
|
|
||||||
Das obige Skript benoetigt die Pakete sox und pvftools.
|
Fuer Version 2.x:
|
||||||
|
-----------------------------------------------------------
|
||||||
|
#! /bin/sh
|
||||||
|
##
|
||||||
|
## Kommando zum abspielen von Voicenachrichten vom vbox-1.0
|
||||||
|
##
|
||||||
|
## ACHTUNG! Wenn die Pfade falsch gesetzt sind oder fehlen,
|
||||||
|
## stuerzt netscape einfach ab!
|
||||||
|
|
||||||
|
PATH=$PATH:"Pfad zum sox":"Pfad zu den pvftools":"Pfad zum vbox"
|
||||||
|
FILENAME1=/tmp/voxplay.$$.voc
|
||||||
|
FILENAME2=/tmp/voxplay.$$.wav
|
||||||
|
VOLUME=8
|
||||||
|
|
||||||
|
vboxtoau <$1 | \
|
||||||
|
autopvf | \
|
||||||
|
pvfamp $VOLUME | \
|
||||||
|
pvfcut 0.20 | \
|
||||||
|
pvftovoc > $FILENAME1
|
||||||
|
|
||||||
|
sox $FILENAME1 $FILENAME2
|
||||||
|
|
||||||
|
echo Content-Type: audio/x-wav
|
||||||
|
echo
|
||||||
|
cat $FILENAME2
|
||||||
|
|
||||||
|
rm -f $FILENAME1 $FILENAME2
|
||||||
|
-----------------------------------------------------------
|
||||||
|
|
||||||
|
Die obigen Skripte benoetigen die Pakete sox und pvftools.
|
||||||
Es ist darauf zu achten, dass die benoetigten Programme im Pfad stehen.
|
Es ist darauf zu achten, dass die benoetigten Programme im Pfad stehen.
|
||||||
Andernfalls quittiert netscape 3.0 gold dieses mit einem "bus error".
|
Andernfalls quittiert netscape 3.0 gold (alpha??) dieses mit einem "bus error".
|
||||||
|
|
||||||
Damit der Browser etwas mit dem Typ "audio/x-wav" anfangen kann, muss
|
Damit der Browser etwas mit dem Typ "audio/x-wav" anfangen kann, muss
|
||||||
an den folgenden Dateien noch Zeilen angefuegt werden:
|
an den folgenden Dateien noch Zeilen angefuegt werden:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: isdnconf.c,v 1.8 1997/05/05 21:21:42 luethje Exp $
|
/* $Id: isdnconf.c,v 1.9 1997/05/25 19:40:53 luethje Exp $
|
||||||
*
|
*
|
||||||
* ISDN accounting for isdn4linux. (Report-module)
|
* ISDN accounting for isdn4linux. (Report-module)
|
||||||
*
|
*
|
||||||
|
@ -19,6 +19,12 @@
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*
|
*
|
||||||
* $Log: isdnconf.c,v $
|
* $Log: isdnconf.c,v $
|
||||||
|
* Revision 1.9 1997/05/25 19:40:53 luethje
|
||||||
|
* isdnlog: close all files and open again after kill -HUP
|
||||||
|
* isdnrep: support vbox version 2.0
|
||||||
|
* isdnconf: changes by Roderich Schupp <roderich@syntec.m.EUnet.de>
|
||||||
|
* conffile: ignore spaces at the end of a line
|
||||||
|
*
|
||||||
* Revision 1.8 1997/05/05 21:21:42 luethje
|
* Revision 1.8 1997/05/05 21:21:42 luethje
|
||||||
* bugfix for option -M
|
* bugfix for option -M
|
||||||
*
|
*
|
||||||
|
@ -618,22 +624,34 @@ int main(int argc, char *argv[], char *envp[])
|
||||||
}
|
}
|
||||||
|
|
||||||
if (number[0] != '\0')
|
if (number[0] != '\0')
|
||||||
|
{
|
||||||
strcpy(number, expand_number(number));
|
strcpy(number, expand_number(number));
|
||||||
|
if (isdnmon)
|
||||||
|
print_msg(PRT_NORMAL,"%s\t",number);
|
||||||
|
}
|
||||||
|
|
||||||
if (areacode[0] != '\0')
|
if (areacode[0] != '\0')
|
||||||
{
|
{
|
||||||
char *ptr;
|
char *ptr;
|
||||||
|
int len;
|
||||||
|
|
||||||
if ((ptr = get_areacode(areacode,NULL,quiet?C_NO_ERROR|C_NO_WARN:0)) != NULL)
|
if ((ptr = get_areacode(areacode,&len,quiet?C_NO_ERROR|C_NO_WARN:0)) != NULL)
|
||||||
{
|
{
|
||||||
print_msg(PRT_NORMAL,"%s%s",ptr,isdnmon?" ":"\n");
|
|
||||||
|
|
||||||
if (!isdnmon)
|
if (!isdnmon)
|
||||||
|
{
|
||||||
|
print_msg(PRT_NORMAL,"%s\n",ptr);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print_msg(PRT_NORMAL,"%s\t%d\t",ptr,len);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
if (!isdnmon)
|
if (!isdnmon)
|
||||||
exit(3);
|
exit(3);
|
||||||
|
|
||||||
|
print_msg(PRT_NORMAL,"\t0\t");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (optind < argc && !add)
|
if (optind < argc && !add)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: isdnlog.c,v 1.11 1997/05/09 23:30:47 luethje Exp $
|
/* $Id: isdnlog.c,v 1.12 1997/05/25 19:40:58 luethje Exp $
|
||||||
*
|
*
|
||||||
* ISDN accounting for isdn4linux. (log-module)
|
* ISDN accounting for isdn4linux. (log-module)
|
||||||
*
|
*
|
||||||
|
@ -19,6 +19,12 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
*
|
*
|
||||||
* $Log: isdnlog.c,v $
|
* $Log: isdnlog.c,v $
|
||||||
|
* Revision 1.12 1997/05/25 19:40:58 luethje
|
||||||
|
* isdnlog: close all files and open again after kill -HUP
|
||||||
|
* isdnrep: support vbox version 2.0
|
||||||
|
* isdnconf: changes by Roderich Schupp <roderich@syntec.m.EUnet.de>
|
||||||
|
* conffile: ignore spaces at the end of a line
|
||||||
|
*
|
||||||
* Revision 1.11 1997/05/09 23:30:47 luethje
|
* Revision 1.11 1997/05/09 23:30:47 luethje
|
||||||
* isdnlog: new switch -O
|
* isdnlog: new switch -O
|
||||||
* isdnrep: new format %S
|
* isdnrep: new format %S
|
||||||
|
@ -62,7 +68,7 @@
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
/* Letzte Exit-Nummer: 45 */
|
/* Letzte Exit-Nummer: 47 */
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
@ -105,6 +111,28 @@ static void hup_handler(int isig)
|
||||||
if (readconfig(myname) != 0)
|
if (readconfig(myname) != 0)
|
||||||
Exit(41);
|
Exit(41);
|
||||||
|
|
||||||
|
if (fprot != NULL && tmpout != NULL && *tmpout != '\0')
|
||||||
|
{
|
||||||
|
fclose(fprot);
|
||||||
|
|
||||||
|
if ((fprot = fopen(tmpout,"a")) == NULL)
|
||||||
|
{
|
||||||
|
print_msg(PRT_ERR,"Can not open file `%s': %s!\n",tmpout, strerror(errno));
|
||||||
|
Exit(46);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fout != NULL && outfile != NULL && *outfile != '\0')
|
||||||
|
{
|
||||||
|
fclose(fout);
|
||||||
|
|
||||||
|
if ((fout = fopen(outfile,"a")) == NULL)
|
||||||
|
{
|
||||||
|
print_msg(PRT_ERR,"Can not open file `%s': %s!\n",outfile, strerror(errno));
|
||||||
|
Exit(47);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
signal(SIGHUP, hup_handler);
|
signal(SIGHUP, hup_handler);
|
||||||
} /* hup_handler */
|
} /* hup_handler */
|
||||||
|
|
||||||
|
@ -728,11 +756,10 @@ int main(int argc, char *argv[], char *envp[])
|
||||||
register char *p;
|
register char *p;
|
||||||
register int i, res = 0;
|
register int i, res = 0;
|
||||||
auto int lastarg;
|
auto int lastarg;
|
||||||
auto char fn[BUFSIZ];
|
|
||||||
auto char rlogfile[PATH_MAX];
|
auto char rlogfile[PATH_MAX];
|
||||||
auto char **devices = NULL;
|
auto char **devices = NULL;
|
||||||
#ifdef TESTCENTER
|
#ifdef TESTCENTER
|
||||||
extern void test_center(void);
|
extern void test_center(char*);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -746,6 +773,10 @@ int main(int argc, char *argv[], char *envp[])
|
||||||
|
|
||||||
lastarg = set_options(argc,argv);
|
lastarg = set_options(argc,argv);
|
||||||
|
|
||||||
|
#ifdef TESTCENTER
|
||||||
|
test_center(argv[lastarg]);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (outfile != NULL)
|
if (outfile != NULL)
|
||||||
{
|
{
|
||||||
if (!message)
|
if (!message)
|
||||||
|
@ -808,10 +839,6 @@ int main(int argc, char *argv[], char *envp[])
|
||||||
|
|
||||||
openlog(myshortname, LOG_NDELAY, LOG_DAEMON);
|
openlog(myshortname, LOG_NDELAY, LOG_DAEMON);
|
||||||
|
|
||||||
#ifdef TESTCENTER
|
|
||||||
test_center();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (xinfo && read_user_access())
|
if (xinfo && read_user_access())
|
||||||
Exit(22);
|
Exit(22);
|
||||||
|
|
||||||
|
@ -842,10 +869,10 @@ int main(int argc, char *argv[], char *envp[])
|
||||||
else
|
else
|
||||||
p = argv[lastarg];
|
p = argv[lastarg];
|
||||||
|
|
||||||
sprintf(fn, "%s/%s", TMPDIR, p);
|
sprintf(tmpout, "%s/%s", TMPDIR, p);
|
||||||
} /* if */
|
} /* if */
|
||||||
|
|
||||||
if (!verbose || ((fprot = fopen(fn, "a")) != (FILE *)NULL)) {
|
if (!verbose || ((fprot = fopen(tmpout, "a")) != (FILE *)NULL)) {
|
||||||
|
|
||||||
for (i = 0; i < MAXCHAN; i++)
|
for (i = 0; i < MAXCHAN; i++)
|
||||||
clearchan(i, 1);
|
clearchan(i, 1);
|
||||||
|
@ -923,7 +950,7 @@ int main(int argc, char *argv[], char *envp[])
|
||||||
fclose(fprot);
|
fclose(fprot);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
print_msg(PRT_ERR, msg1, myshortname, fn, strerror(errno));
|
print_msg(PRT_ERR, msg1, myshortname, tmpout, strerror(errno));
|
||||||
res = 5;
|
res = 5;
|
||||||
} /* else */
|
} /* else */
|
||||||
|
|
||||||
|
@ -931,7 +958,7 @@ int main(int argc, char *argv[], char *envp[])
|
||||||
fclose(fcons);
|
fclose(fcons);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
print_msg(PRT_ERR, msg1, myshortname, fn, strerror(errno));
|
print_msg(PRT_ERR, msg1, myshortname, ptty, strerror(errno));
|
||||||
res = 3;
|
res = 3;
|
||||||
} /* else */
|
} /* else */
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: isdnlog.h,v 1.6 1997/05/09 23:30:50 luethje Exp $
|
/* $Id: isdnlog.h,v 1.7 1997/05/25 19:41:02 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: isdnlog.h,v $
|
* $Log: isdnlog.h,v $
|
||||||
|
* Revision 1.7 1997/05/25 19:41:02 luethje
|
||||||
|
* isdnlog: close all files and open again after kill -HUP
|
||||||
|
* isdnrep: support vbox version 2.0
|
||||||
|
* isdnconf: changes by Roderich Schupp <roderich@syntec.m.EUnet.de>
|
||||||
|
* conffile: ignore spaces at the end of a line
|
||||||
|
*
|
||||||
* Revision 1.6 1997/05/09 23:30:50 luethje
|
* Revision 1.6 1997/05/09 23:30:50 luethje
|
||||||
* isdnlog: new switch -O
|
* isdnlog: new switch -O
|
||||||
* isdnrep: new format %S
|
* isdnrep: new format %S
|
||||||
|
@ -237,6 +243,7 @@ _EXTERN int watchdog;
|
||||||
_EXTERN char *isdnctrl;
|
_EXTERN char *isdnctrl;
|
||||||
_EXTERN char isdnctrl2[FNSIZE];
|
_EXTERN char isdnctrl2[FNSIZE];
|
||||||
_EXTERN char *outfile;
|
_EXTERN char *outfile;
|
||||||
|
_EXTERN char tmpout[PATH_MAX];
|
||||||
|
|
||||||
_EXTERN IFO ifo[ISDN_MAX_CHANNELS];
|
_EXTERN IFO ifo[ISDN_MAX_CHANNELS];
|
||||||
_EXTERN IO io[ISDN_MAX_CHANNELS];
|
_EXTERN IO io[ISDN_MAX_CHANNELS];
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
#include "isdnlog.h"
|
#include "isdnlog.h"
|
||||||
|
|
||||||
void test_center (void)
|
void test_center (char* string)
|
||||||
{
|
{
|
||||||
#if 0
|
#if 1
|
||||||
|
printf("%d\n",CheckTime(string));
|
||||||
|
exit(0);
|
||||||
|
#elif 0
|
||||||
char File[256];
|
char File[256];
|
||||||
int Cnt = 20000;
|
int Cnt = 20000;
|
||||||
|
|
||||||
|
@ -89,7 +92,7 @@ void test_center (void)
|
||||||
printf("Accepted\n");
|
printf("Accepted\n");
|
||||||
|
|
||||||
Exit(-3);
|
Exit(-3);
|
||||||
#elif 1
|
#elif 0
|
||||||
readconfig("isdnlog");
|
readconfig("isdnlog");
|
||||||
Exit(-4);
|
Exit(-4);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: isdnrep.c,v 1.26 1997/05/19 22:58:18 luethje Exp $
|
/* $Id: isdnrep.c,v 1.27 1997/05/25 19:41:06 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.27 1997/05/25 19:41:06 luethje
|
||||||
|
* isdnlog: close all files and open again after kill -HUP
|
||||||
|
* isdnrep: support vbox version 2.0
|
||||||
|
* isdnconf: changes by Roderich Schupp <roderich@syntec.m.EUnet.de>
|
||||||
|
* conffile: ignore spaces at the end of a line
|
||||||
|
*
|
||||||
* Revision 1.26 1997/05/19 22:58:18 luethje
|
* Revision 1.26 1997/05/19 22:58:18 luethje
|
||||||
* - bugfix: it is possible to install isdnlog now
|
* - bugfix: it is possible to install isdnlog now
|
||||||
* - improved performance for read files for vbox files and mgetty files.
|
* - improved performance for read files for vbox files and mgetty files.
|
||||||
|
@ -198,6 +204,7 @@
|
||||||
#include <linux/limits.h>
|
#include <linux/limits.h>
|
||||||
|
|
||||||
#include "isdnrep.h"
|
#include "isdnrep.h"
|
||||||
|
#include "../../vbox/src/libvbox.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
@ -289,6 +296,7 @@ typedef struct {
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int version;
|
int version;
|
||||||
|
int compression;
|
||||||
int used;
|
int used;
|
||||||
time_t time;
|
time_t time;
|
||||||
char type;
|
char type;
|
||||||
|
@ -342,6 +350,7 @@ static int time_in_interval(time_t t1, time_t t2, char type);
|
||||||
static char *nam2html(char *file);
|
static char *nam2html(char *file);
|
||||||
static char *get_a_day(time_t t, int d_diff, int m_diff, int flag);
|
static char *get_a_day(time_t t, int d_diff, int m_diff, int flag);
|
||||||
static char *get_time_string(time_t begin, time_t end, int d_diff, int m_diff);
|
static char *get_time_string(time_t begin, time_t end, int d_diff, int m_diff);
|
||||||
|
static char *create_vbox_file(char *file, int *compression);
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
@ -400,23 +409,51 @@ int send_html_request(char *myname, char *option)
|
||||||
char commandline[PATH_MAX];
|
char commandline[PATH_MAX];
|
||||||
char *filetype = NULL;
|
char *filetype = NULL;
|
||||||
char *command = NULL;
|
char *command = NULL;
|
||||||
|
char *vboxfile = NULL;
|
||||||
|
int compression;
|
||||||
|
|
||||||
|
|
||||||
if (*option == C_VBOX)
|
if (*option == C_VBOX)
|
||||||
{
|
{
|
||||||
sprintf(file,"%s%c%s",vboxpath,C_SLASH,option+2);
|
sprintf(file,"%s%c%s",vboxpath,C_SLASH,option+2);
|
||||||
command = vboxcommand;
|
|
||||||
|
|
||||||
if (option[1] == '1')
|
if (option[1] == '1')
|
||||||
|
{
|
||||||
|
if (vboxcommand1)
|
||||||
|
command = vboxcommand1;
|
||||||
|
else
|
||||||
filetype = "application/x-zyxel4";
|
filetype = "application/x-zyxel4";
|
||||||
|
}
|
||||||
else
|
else
|
||||||
if (option[1] == '2')
|
if (option[1] == '2')
|
||||||
{
|
{
|
||||||
|
if (vboxcommand2)
|
||||||
|
command = vboxcommand2;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
vboxfile = strcpy(file,create_vbox_file(file,&compression));
|
||||||
|
|
||||||
|
switch(compression)
|
||||||
|
{
|
||||||
|
case 2 : filetype = "application/x-zyxel2";
|
||||||
|
break;
|
||||||
|
case 3 : filetype = "application/x-zyxel3";
|
||||||
|
break;
|
||||||
|
case 4 : filetype = "application/x-zyxel4";
|
||||||
|
break;
|
||||||
|
case 6 : filetype = "application/x-ulaw";
|
||||||
|
break;
|
||||||
|
default: print_msg(PRT_NORMAL, "Content-Type: text/plain\n\n");
|
||||||
|
print_msg(PRT_NORMAL, "%s: unsupported compression type of vbox file :`%d'\n",myname,compression);
|
||||||
|
return -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print_msg(PRT_NORMAL, "Content-Type: text/plain\n\n");
|
print_msg(PRT_NORMAL, "Content-Type: text/plain\n\n");
|
||||||
print_msg(PRT_NORMAL, "%s:invalid version of vbox `%c'\n",myname,option[0]);
|
print_msg(PRT_NORMAL, "%s: unsupported version of vbox `%c'\n",myname,option[0]);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -424,14 +461,18 @@ int send_html_request(char *myname, char *option)
|
||||||
if (*option == C_FAX)
|
if (*option == C_FAX)
|
||||||
{
|
{
|
||||||
sprintf(file,"%s%c%s",mgettypath,C_SLASH,option+2);
|
sprintf(file,"%s%c%s",mgettypath,C_SLASH,option+2);
|
||||||
command = mgettycommand;
|
|
||||||
|
|
||||||
if (option[1] == '3')
|
if (option[1] == '3')
|
||||||
|
{
|
||||||
|
if (mgettycommand)
|
||||||
|
command = mgettycommand;
|
||||||
|
else
|
||||||
filetype = "application/x-faxg3";
|
filetype = "application/x-faxg3";
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print_msg(PRT_NORMAL, "Content-Type: text/plain\n\n");
|
print_msg(PRT_NORMAL, "Content-Type: text/plain\n\n");
|
||||||
print_msg(PRT_NORMAL, "%s:invalid version of fax `%c%c'\n",myname,option[0]);
|
print_msg(PRT_NORMAL, "%s:unsupported version of fax `%c%c'\n",myname,option[0]);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -456,6 +497,15 @@ int send_html_request(char *myname, char *option)
|
||||||
sprintf(commandline,"%s %s",command?command:"cat",file);
|
sprintf(commandline,"%s %s",command?command:"cat",file);
|
||||||
system(commandline);
|
system(commandline);
|
||||||
|
|
||||||
|
if (vboxfile)
|
||||||
|
{
|
||||||
|
if (unlink(vboxfile))
|
||||||
|
{
|
||||||
|
print_msg(PRT_ERR,"Can not delete file `%s': %s!\n",file, strerror(errno));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2550,14 +2600,23 @@ static int set_vbox_entry(const char *path, const char *file)
|
||||||
file_list *lptr = NULL;
|
file_list *lptr = NULL;
|
||||||
char string[PATH_MAX];
|
char string[PATH_MAX];
|
||||||
int cnt;
|
int cnt;
|
||||||
|
FILE *fp;
|
||||||
|
vaheader_t ptr;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (1 /*vboxversion < 2*/)
|
|
||||||
{
|
|
||||||
sprintf(string,"%s%c%s",path,C_SLASH,file);
|
sprintf(string,"%s%c%s",path,C_SLASH,file);
|
||||||
|
|
||||||
if (access(string,R_OK))
|
if ((fp = fopen(string,"r")) == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
fread(&ptr,sizeof(vaheader_t),1,fp);
|
||||||
|
fclose(fp);
|
||||||
|
|
||||||
|
if (strncmp(ptr.magic,"VBOX",4))
|
||||||
|
{
|
||||||
|
/* Version 0.x and 1.x of vbox! */
|
||||||
|
|
||||||
if ((cnt = sscanf(file,"%2d%2d%2d%2d%2d%2d",
|
if ((cnt = sscanf(file,"%2d%2d%2d%2d%2d%2d",
|
||||||
&(tm.tm_year),
|
&(tm.tm_year),
|
||||||
&(tm.tm_mon),
|
&(tm.tm_mon),
|
||||||
|
@ -2566,8 +2625,8 @@ static int set_vbox_entry(const char *path, const char *file)
|
||||||
&(tm.tm_min),
|
&(tm.tm_min),
|
||||||
&(tm.tm_sec))) != 6)
|
&(tm.tm_sec))) != 6)
|
||||||
{
|
{
|
||||||
/* Not implemented yet! */
|
print_msg(PRT_ERR,"invalid file name `%s'!\n",file);
|
||||||
print_msg(PRT_ERR, "Internal error: wrong number of parameter (%d) or wrong version of vbox!\n",cnt);
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((lptr = (file_list*) calloc(1,sizeof(file_list))) == NULL)
|
if ((lptr = (file_list*) calloc(1,sizeof(file_list))) == NULL)
|
||||||
|
@ -2591,19 +2650,33 @@ static int set_vbox_entry(const char *path, const char *file)
|
||||||
lptr->type = C_VBOX;
|
lptr->type = C_VBOX;
|
||||||
lptr->used = 0;
|
lptr->used = 0;
|
||||||
lptr->version = 1;
|
lptr->version = 1;
|
||||||
|
lptr->compression = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (vboxversion == 2)
|
|
||||||
{
|
{
|
||||||
/* Not implemented yet! */
|
/* Version 2.x of vbox! */
|
||||||
print_msg(PRT_ERR, "Version %d of vbox is not implemented yet!\n",vboxversion);
|
|
||||||
|
if ((lptr = (file_list*) calloc(1,sizeof(file_list))) == NULL)
|
||||||
|
{
|
||||||
|
print_msg(PRT_ERR, nomemory);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lptr->name = strdup(file);
|
||||||
|
lptr->time = ntohl(ptr.time);
|
||||||
|
lptr->type = C_VBOX;
|
||||||
|
lptr->used = 0;
|
||||||
|
lptr->version = 2;
|
||||||
|
lptr->compression = ntohl(ptr.compression);
|
||||||
|
}
|
||||||
|
/*
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
print_msg(PRT_ERR, "Version %d of vbox is not implemented yet!\n",vboxversion);
|
||||||
print_msg(PRT_ERR, "Invalid version %d of vbox!\n",vboxversion);
|
print_msg(PRT_ERR, "Invalid version %d of vbox!\n",vboxversion);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
return set_element_list(lptr);
|
return set_element_list(lptr);
|
||||||
}
|
}
|
||||||
|
@ -2635,6 +2708,7 @@ static int set_mgetty_entry(const char *path, const char *file)
|
||||||
lptr->type = C_FAX;
|
lptr->type = C_FAX;
|
||||||
lptr->used = 0;
|
lptr->used = 0;
|
||||||
lptr->version = 3;
|
lptr->version = 3;
|
||||||
|
lptr->compression = 0;
|
||||||
|
|
||||||
return set_element_list(lptr);
|
return set_element_list(lptr);
|
||||||
}
|
}
|
||||||
|
@ -2929,3 +3003,49 @@ static char *get_time_string(time_t begin, time_t end, int d_diff, int m_diff)
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static char *create_vbox_file(char *file, int *compression)
|
||||||
|
{
|
||||||
|
int fdin, fdout, len;
|
||||||
|
char string[BUFSIZ];
|
||||||
|
char *fileout = NULL;
|
||||||
|
vaheader_t header;
|
||||||
|
|
||||||
|
if ((fdin = open(file,O_RDONLY)) == -1)
|
||||||
|
{
|
||||||
|
print_msg(PRT_ERR,"Can not open file `%s': %s!\n",file, strerror(errno));
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (read(fdin,&header,sizeof(vaheader_t)) == sizeof(vaheader_t))
|
||||||
|
{
|
||||||
|
if (compression != NULL)
|
||||||
|
*compression = ntohl(header.compression);
|
||||||
|
|
||||||
|
if ((fileout = tmpnam(NULL)) == NULL || (fdout = open(fileout,O_WRONLY | O_CREAT,0444)) == -1)
|
||||||
|
{
|
||||||
|
print_msg(PRT_ERR,"Can not open file `%s': %s!\n",fileout, strerror(errno));
|
||||||
|
close(fdin);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
while((len = read(fdin,string,BUFSIZ)) > 0)
|
||||||
|
{
|
||||||
|
if (write(fdout,string,len) != len)
|
||||||
|
{
|
||||||
|
print_msg(PRT_ERR,"Can not write to file `%s': %s!\n",fileout, strerror(errno));
|
||||||
|
close(fdout);
|
||||||
|
close(fdin);
|
||||||
|
unlink(fileout);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
close(fdout);
|
||||||
|
}
|
||||||
|
|
||||||
|
close(fdin);
|
||||||
|
return fileout;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: isdnconf.c,v 1.10 1997/05/15 22:21:45 luethje Exp $
|
/* $Id: isdnconf.c,v 1.11 1997/05/25 19:41:13 luethje Exp $
|
||||||
*
|
*
|
||||||
* ISDN accounting for isdn4linux. (Utilities)
|
* ISDN accounting for isdn4linux. (Utilities)
|
||||||
*
|
*
|
||||||
|
@ -20,6 +20,12 @@
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*
|
*
|
||||||
* $Log: isdnconf.c,v $
|
* $Log: isdnconf.c,v $
|
||||||
|
* Revision 1.11 1997/05/25 19:41:13 luethje
|
||||||
|
* isdnlog: close all files and open again after kill -HUP
|
||||||
|
* isdnrep: support vbox version 2.0
|
||||||
|
* isdnconf: changes by Roderich Schupp <roderich@syntec.m.EUnet.de>
|
||||||
|
* conffile: ignore spaces at the end of a line
|
||||||
|
*
|
||||||
* Revision 1.10 1997/05/15 22:21:45 luethje
|
* Revision 1.10 1997/05/15 22:21:45 luethje
|
||||||
* New feature: isdnrep can transmit via HTTP fax files and vbox files.
|
* New feature: isdnrep can transmit via HTTP fax files and vbox files.
|
||||||
*
|
*
|
||||||
|
@ -929,10 +935,9 @@ static int _readconfig(char *_myname)
|
||||||
start_procs.infoargs = NULL;
|
start_procs.infoargs = NULL;
|
||||||
start_procs.flags = 0;
|
start_procs.flags = 0;
|
||||||
conf_dat = NULL;
|
conf_dat = NULL;
|
||||||
vboxversion = 0;
|
|
||||||
vboxpath = NULL;
|
vboxpath = NULL;
|
||||||
vboxcommand = NULL;
|
vboxcommand1 = NULL;
|
||||||
mgettyversion = 0;
|
vboxcommand2 = NULL;
|
||||||
mgettypath = NULL;
|
mgettypath = NULL;
|
||||||
mgettycommand = NULL;
|
mgettycommand = NULL;
|
||||||
|
|
||||||
|
@ -1083,17 +1088,14 @@ static int Set_Globals(section *SPtr)
|
||||||
currency++;
|
currency++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((CEPtr = Get_Entry(Ptr->entries,CONF_ENT_VBOXVER)) != NULL)
|
|
||||||
vboxversion = strtod(CEPtr->value,NULL);
|
|
||||||
|
|
||||||
if ((CEPtr = Get_Entry(Ptr->entries,CONF_ENT_VBOXPATH)) != NULL)
|
if ((CEPtr = Get_Entry(Ptr->entries,CONF_ENT_VBOXPATH)) != NULL)
|
||||||
vboxpath = CEPtr->value;
|
vboxpath = CEPtr->value;
|
||||||
|
|
||||||
if ((CEPtr = Get_Entry(Ptr->entries,CONF_ENT_VBOXCMD)) != NULL)
|
if ((CEPtr = Get_Entry(Ptr->entries,CONF_ENT_VBOXCMD1)) != NULL)
|
||||||
vboxcommand = CEPtr->value;
|
vboxcommand1 = CEPtr->value;
|
||||||
|
|
||||||
if ((CEPtr = Get_Entry(Ptr->entries,CONF_ENT_MGTYVER)) != NULL)
|
if ((CEPtr = Get_Entry(Ptr->entries,CONF_ENT_VBOXCMD2)) != NULL)
|
||||||
mgettyversion = strtod(CEPtr->value,NULL);
|
vboxcommand2 = CEPtr->value;
|
||||||
|
|
||||||
if ((CEPtr = Get_Entry(Ptr->entries,CONF_ENT_MGTYPATH)) != NULL)
|
if ((CEPtr = Get_Entry(Ptr->entries,CONF_ENT_MGTYPATH)) != NULL)
|
||||||
mgettypath = CEPtr->value;
|
mgettypath = CEPtr->value;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: tools.h,v 1.14 1997/05/15 22:21:49 luethje Exp $
|
/* $Id: tools.h,v 1.15 1997/05/25 19:41:16 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: tools.h,v $
|
* $Log: tools.h,v $
|
||||||
|
* Revision 1.15 1997/05/25 19:41:16 luethje
|
||||||
|
* isdnlog: close all files and open again after kill -HUP
|
||||||
|
* isdnrep: support vbox version 2.0
|
||||||
|
* isdnconf: changes by Roderich Schupp <roderich@syntec.m.EUnet.de>
|
||||||
|
* conffile: ignore spaces at the end of a line
|
||||||
|
*
|
||||||
* Revision 1.14 1997/05/15 22:21:49 luethje
|
* Revision 1.14 1997/05/15 22:21:49 luethje
|
||||||
* New feature: isdnrep can transmit via HTTP fax files and vbox files.
|
* New feature: isdnrep can transmit via HTTP fax files and vbox files.
|
||||||
*
|
*
|
||||||
|
@ -408,7 +414,8 @@
|
||||||
|
|
||||||
#define CONF_ENT_VBOXVER "VBOXVERSION"
|
#define CONF_ENT_VBOXVER "VBOXVERSION"
|
||||||
#define CONF_ENT_VBOXPATH "VBOXPATH"
|
#define CONF_ENT_VBOXPATH "VBOXPATH"
|
||||||
#define CONF_ENT_VBOXCMD "VBOXCMD"
|
#define CONF_ENT_VBOXCMD1 "VBOXCMD1"
|
||||||
|
#define CONF_ENT_VBOXCMD2 "VBOXCMD2"
|
||||||
#define CONF_ENT_MGTYVER "MGETTYVERSION"
|
#define CONF_ENT_MGTYVER "MGETTYVERSION"
|
||||||
#define CONF_ENT_MGTYPATH "MGETTYPATH"
|
#define CONF_ENT_MGTYPATH "MGETTYPATH"
|
||||||
#define CONF_ENT_MGTYCMD "MGETTYCMD"
|
#define CONF_ENT_MGTYCMD "MGETTYCMD"
|
||||||
|
@ -648,10 +655,9 @@ _EXTERN char* logfile = LOGFILE;
|
||||||
_EXTERN int (*_print_msg)(const char *, ...) = printf;
|
_EXTERN int (*_print_msg)(const char *, ...) = printf;
|
||||||
_EXTERN int use_new_config = 1;
|
_EXTERN int use_new_config = 1;
|
||||||
_EXTERN char ***lineformats = NULL;
|
_EXTERN char ***lineformats = NULL;
|
||||||
_EXTERN int vboxversion = 0;
|
|
||||||
_EXTERN char *vboxpath = NULL;
|
_EXTERN char *vboxpath = NULL;
|
||||||
_EXTERN char *vboxcommand = NULL;
|
_EXTERN char *vboxcommand1 = NULL;
|
||||||
_EXTERN int mgettyversion = 0;
|
_EXTERN char *vboxcommand2 = NULL;
|
||||||
_EXTERN char *mgettypath = NULL;
|
_EXTERN char *mgettypath = NULL;
|
||||||
_EXTERN char *mgettycommand = NULL;
|
_EXTERN char *mgettycommand = NULL;
|
||||||
|
|
||||||
|
@ -665,10 +671,9 @@ _EXTERN char* logfile;
|
||||||
_EXTERN int (*_print_msg)(const char *, ...);
|
_EXTERN int (*_print_msg)(const char *, ...);
|
||||||
_EXTERN int use_new_config;
|
_EXTERN int use_new_config;
|
||||||
_EXTERN char ***lineformats;
|
_EXTERN char ***lineformats;
|
||||||
_EXTERN int vboxversion;
|
|
||||||
_EXTERN char *vboxpath;
|
_EXTERN char *vboxpath;
|
||||||
_EXTERN char *vboxcommand;
|
_EXTERN char *vboxcommand1;
|
||||||
_EXTERN int mgettyversion;
|
_EXTERN char *vboxcommand2;
|
||||||
_EXTERN char *mgettypath;
|
_EXTERN char *mgettypath;
|
||||||
_EXTERN char *mgettycommand;
|
_EXTERN char *mgettycommand;
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,8 @@ Die Syntax wurde allerdings um Untersektionen erweitert. Ein Eintrag kann
|
||||||
wieder eine Sektion darstellen. Diese Untersektionen koennen beliebig oft
|
wieder eine Sektion darstellen. Diese Untersektionen koennen beliebig oft
|
||||||
verschachtelt sein.
|
verschachtelt sein.
|
||||||
|
|
||||||
|
Alle Tabulatoren und Leerzeichen am Ende einer Zeile werden ignoriert.
|
||||||
|
|
||||||
Es wird die Gross/Kleinschreibung bei den Eintrags- und Sektionsnamen
|
Es wird die Gross/Kleinschreibung bei den Eintrags- und Sektionsnamen
|
||||||
ignoriert. Also vor dem Gleichheitszeichen. Danach wird sehr wohl in
|
ignoriert. Also vor dem Gleichheitszeichen. Danach wird sehr wohl in
|
||||||
Gross und Kleinschreibung unterschieden.
|
Gross und Kleinschreibung unterschieden.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: conffile.c,v 1.15 1997/04/15 22:37:20 luethje Exp $
|
/* $Id: conffile.c,v 1.16 1997/05/25 19:41:23 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: conffile.c,v $
|
* $Log: conffile.c,v $
|
||||||
|
* Revision 1.16 1997/05/25 19:41:23 luethje
|
||||||
|
* isdnlog: close all files and open again after kill -HUP
|
||||||
|
* isdnrep: support vbox version 2.0
|
||||||
|
* isdnconf: changes by Roderich Schupp <roderich@syntec.m.EUnet.de>
|
||||||
|
* conffile: ignore spaces at the end of a line
|
||||||
|
*
|
||||||
* Revision 1.15 1997/04/15 22:37:20 luethje
|
* Revision 1.15 1997/04/15 22:37:20 luethje
|
||||||
* allows the character `"' in the program argument like the shell.
|
* allows the character `"' in the program argument like the shell.
|
||||||
* some bugfixes.
|
* some bugfixes.
|
||||||
|
@ -587,6 +593,14 @@ static entry* Append_Entry(entry** Entry, char *Variable, char* Value, section *
|
||||||
|
|
||||||
if (Value != NULL)
|
if (Value != NULL)
|
||||||
{
|
{
|
||||||
|
if (!(Flag & C_ALLOW_LAST_BLANKS))
|
||||||
|
{
|
||||||
|
int len = strlen(Value)-1;
|
||||||
|
|
||||||
|
while (len >= 0 && isspace(Value[len]))
|
||||||
|
Value[len--] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
if (((*Entry)->value = strdup(Value)) == NULL)
|
if (((*Entry)->value = strdup(Value)) == NULL)
|
||||||
{
|
{
|
||||||
free_entry(*Entry);
|
free_entry(*Entry);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
/* $Id: conffile.h,v 1.7 1997/04/15 00:20:16 luethje Exp $
|
/* $Id: conffile.h,v 1.8 1997/05/25 19:41:25 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: conffile.h,v $
|
* $Log: conffile.h,v $
|
||||||
|
* Revision 1.8 1997/05/25 19:41:25 luethje
|
||||||
|
* isdnlog: close all files and open again after kill -HUP
|
||||||
|
* isdnrep: support vbox version 2.0
|
||||||
|
* isdnconf: changes by Roderich Schupp <roderich@syntec.m.EUnet.de>
|
||||||
|
* conffile: ignore spaces at the end of a line
|
||||||
|
*
|
||||||
* Revision 1.7 1997/04/15 00:20:16 luethje
|
* Revision 1.7 1997/04/15 00:20:16 luethje
|
||||||
* replace variables: some bugfixes, README comleted
|
* replace variables: some bugfixes, README comleted
|
||||||
*
|
*
|
||||||
|
@ -49,6 +55,7 @@
|
||||||
#define C_NOT_UNIQUE 4
|
#define C_NOT_UNIQUE 4
|
||||||
#define C_APPEND 8
|
#define C_APPEND 8
|
||||||
#define C_NO_WARN_FILE 16
|
#define C_NO_WARN_FILE 16
|
||||||
|
#define C_ALLOW_LAST_BLANKS 32
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# $Id: config.in,v 1.17 1997/04/08 00:02:28 luethje Exp $
|
# $Id: config.in,v 1.18 1997/05/25 19:41:29 luethje Exp $
|
||||||
#
|
#
|
||||||
# The whole configuration stuff is borrowed from the kernel
|
# The whole configuration stuff is borrowed from the kernel
|
||||||
# configuration.
|
# configuration.
|
||||||
|
@ -32,7 +32,7 @@ string 'Write lock files here' CONFIG_LOCKDIR
|
||||||
string 'Prefix for the lock file' CONFIG_LOCKFILE
|
string 'Prefix for the lock file' CONFIG_LOCKFILE
|
||||||
string 'General configuration directory' CONFIG_I4LCONFDIR
|
string 'General configuration directory' CONFIG_I4LCONFDIR
|
||||||
string 'Global configuration file' CONFIG_CONFFILE
|
string 'Global configuration file' CONFIG_CONFFILE
|
||||||
string 'Global phone number file file' CONFIG_CALLERIDFILE
|
string 'Global phone number file' CONFIG_CALLERIDFILE
|
||||||
string 'User configuration file' CONFIG_USERCONFFILE
|
string 'User configuration file' CONFIG_USERCONFFILE
|
||||||
comment 'Configuration library options'
|
comment 'Configuration library options'
|
||||||
string 'Your country code' CONFIG_COUNTRYCODE
|
string 'Your country code' CONFIG_COUNTRYCODE
|
||||||
|
|
Loading…
Reference in New Issue