splitt the files callerid.conf and ~/.isdn.

This commit is contained in:
luethje 1997-04-03 22:34:48 +00:00
parent 6ecacbc2c8
commit f5c608a012
5 changed files with 38 additions and 12 deletions

View File

@ -1,8 +1,9 @@
/* $Id: functions.c,v 1.3 1997/03/31 20:50:55 akool Exp $
/* $Id: functions.c,v 1.4 1997/04/03 22:34:48 luethje Exp $
*
* ISDN accounting for isdn4linux. (log-module)
*
* Copyright 1995, 1997 by Andreas Kool (akool@Kool.f.EUnet.de)
* and Stefan Luethje (luethje@sl-gw.lake.de)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -163,11 +164,11 @@ void logger(int chan)
tries = 0;
while (((fd = open(logname, O_WRONLY | O_APPEND | O_EXCL)) == -1) && (tries < 1000))
while (((fd = open(logfile, O_WRONLY | O_APPEND | O_EXCL)) == -1) && (tries < 1000))
tries++;
if ((tries < 1000) && ((flog = fdopen(fd, "a")) == (FILE *)NULL))
print_msg(PRT_ERR, "Can not open file `%s': %s!\n", logname, strerror(errno));
print_msg(PRT_ERR, "Can not open file `%s': %s!\n", logfile, strerror(errno));
else {
fprintf(flog, "%s|%-16s|%-16s|%5d|%10d|%10d|%5d|%c|%3d|%10ld|%10ld|%s|%d|%d|%g|%s|%8.2f|\n",
s + 4, call[chan].num[CALLING], call[chan].num[CALLED],

View File

@ -1,8 +1,9 @@
/* $Id: isdnlog.c,v 1.3 1997/03/29 09:24:23 akool Exp $
/* $Id: isdnlog.c,v 1.4 1997/04/03 22:34:49 luethje Exp $
*
* ISDN accounting for isdn4linux. (log-module)
*
* Copyright 1995, 1997 by Andreas Kool (akool@Kool.f.EUnet.de)
* and Stefan Luethje (luethje@sl-gw.lake.de)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -27,7 +28,7 @@
/*****************************************************************************/
/* Letzte Exit-Nummer: 42 */
/* Letzte Exit-Nummer: 43 */
/*****************************************************************************/
@ -739,10 +740,21 @@ int main(int argc, char *argv[], char *envp[])
} /* else */
strcpy((char *)logname, LOGFILE);
if (replay)
strcat((char *)logname, ".rep");
strcat((char *)logfile, ".rep");
else
if (access(logfile,W_OK) && errno == ENOENT)
{
if ((flog = fopen(logfile, "w")) == NULL)
{
print_msg(PRT_ERR,"Can not write file `%s' (%s)!\n", logfile, strerror(errno));
Exit(43);
}
else
fclose(flog);
flog = NULL;
}
openlog(myshortname, LOG_NDELAY, LOG_DAEMON);

View File

@ -1,8 +1,9 @@
/* $Id: isdnlog.h,v 1.3 1997/03/23 23:11:54 luethje Exp $
/* $Id: isdnlog.h,v 1.4 1997/04/03 22:34:50 luethje Exp $
*
* ISDN accounting for isdn4linux.
*
* Copyright 1995, 1997 by Andreas Kool (akool@Kool.f.EUnet.de)
* and Stefan Luethje (luethje@sl-gw.lake.de)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -19,6 +20,9 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log: isdnlog.h,v $
* Revision 1.4 1997/04/03 22:34:50 luethje
* splitt the files callerid.conf and ~/.isdn.
*
* Revision 1.3 1997/03/23 23:11:54 luethje
* improved performance
*
@ -219,7 +223,6 @@ _EXTERN int width;
_EXTERN int watchdog;
_EXTERN char *isdnctrl;
_EXTERN char isdnctrl2[FNSIZE];
_EXTERN char logname[FNSIZE];
_EXTERN char pidfile[SHORT_STRING_SIZE];
_EXTERN IFO ifo[ISDN_MAX_CHANNELS];

View File

@ -1,4 +1,5 @@
/*
/* $Id: server.c,v 1.2 1997/04/03 22:34:51 luethje Exp $
*
* ISDN accounting for isdn4linux.
*
* Copyright 1996 by Stefan Luethje (luethje@sl-gw.lake.de)
@ -17,6 +18,10 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log: server.c,v $
* Revision 1.2 1997/04/03 22:34:51 luethje
* splitt the files callerid.conf and ~/.isdn.
*
*/
/****************************************************************************/

View File

@ -1,4 +1,5 @@
/*
/* $Id: user_access.c,v 1.2 1997/04/03 22:34:52 luethje Exp $
*
* ISDN accounting for isdn4linux.
*
* Copyright 1996 by Stefan Luethje (luethje@sl-gw.lake.de)
@ -17,6 +18,10 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log: user_access.c,v $
* Revision 1.2 1997/04/03 22:34:52 luethje
* splitt the files callerid.conf and ~/.isdn.
*
*/
/* Alle Funktionen liefern im Fehlerfall -1 oder NULL */