mySQL-Patch of Sascha Matzke
This commit is contained in:
parent
d6534bfaaf
commit
ed98dbbfd0
|
@ -13,6 +13,10 @@ bool 'Support postgres95 SQL-Database' CONFIG_ISDNLOG_POSTGRES
|
|||
if [ "$CONFIG_ISDNLOG_POSTGRES" = "y" ]; then
|
||||
string 'directory of postgres95' CONFIG_ISDNLOG_POSTGRESDIR
|
||||
fi
|
||||
bool 'Support mysql SQL-Database' CONFIG_ISDNLOG_MYSQLDB
|
||||
if [ "$CONFIG_ISDNLOG_MYSQLDB" = "y" ]; then
|
||||
string 'directory of mysql' CONFIG_ISDNLOG_MYSQLDIR
|
||||
fi
|
||||
choice 'Country specific chargeinfo support' \
|
||||
"DE CONFIG_ISDNLOG_DE \
|
||||
NL CONFIG_ISDNLOG_NL \
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
##
|
||||
## $Log$
|
||||
## Revision 1.36 1998/03/29 19:54:04 luethje
|
||||
## idnrep: added html feature (incoming/outgoing calls)
|
||||
##
|
||||
## Revision 1.35 1998/03/15 22:35:44 tsbogend
|
||||
## not every CPU is from Intel (greetings from Digital :-))
|
||||
##
|
||||
|
@ -207,7 +210,9 @@ LIBAREA := @LIBAREA@
|
|||
RUNDIR := @RUNDIR@
|
||||
DBMLIB := @DBMLIB@
|
||||
POSTGRES := @POSTGRES@
|
||||
POSTGRESDIR := @POSTGRESDIR@
|
||||
POSTGRESDIR := @POSTGRESDIR@
|
||||
MYSQLDB := @MYSQLDB@
|
||||
MYSQLDIR := @MYSQLDIR@
|
||||
SERV_PORT := @SERV_PORT@
|
||||
USERFILE := @USERFILE@
|
||||
DEFS :=
|
||||
|
@ -259,7 +264,7 @@ SERVICEFILE = /etc/services
|
|||
# DON'T EDIT BELOW THIS LINE
|
||||
######################################################################
|
||||
|
||||
VERSION = 2.99.26
|
||||
VERSION = 2.99.27
|
||||
|
||||
ifeq ($(POSTGRES),1)
|
||||
DEFS += -DPOSTGRES
|
||||
|
@ -267,6 +272,12 @@ INCLUDE += -I$(POSTGRESDIR)/include
|
|||
LIB += -L$(POSTGRESDIR)/lib -lpq
|
||||
endif
|
||||
|
||||
ifeq ($(MYSQLDB),1)
|
||||
DEFS += -DMYSQLDB
|
||||
INCLUDE += -I$(MYSQLDIR)/include
|
||||
LIB += -L$(MYSQLDIR)/lib -lmysqlclient -lm
|
||||
endif
|
||||
|
||||
ifdef DBMALLOC
|
||||
DEFS += -DDBMALLOC=1
|
||||
LIB += -ldbmalloc
|
||||
|
@ -291,6 +302,10 @@ ifeq ($(POSTGRES),1)
|
|||
ISDNLOG_OBJS += isdnlog/postgres.o
|
||||
endif
|
||||
|
||||
ifeq ($(MYSQLDB),1)
|
||||
ISDNLOG_OBJS += isdnlog/mysqldb.o
|
||||
endif
|
||||
|
||||
ifdef TESTCENTER
|
||||
ISDNLOG_OBJS += isdnlog/test_center.o
|
||||
endif
|
||||
|
|
|
@ -108,6 +108,8 @@ Inhalt:
|
|||
14.4 BYTEMAX
|
||||
15. Dual-Mode
|
||||
16. SQL-Anbindung
|
||||
16.1. Postgres95
|
||||
16.2. MySQL
|
||||
17. Probleme?
|
||||
18. Verwendete Dateien
|
||||
19. Verwendete Environment-Variablen
|
||||
|
@ -3583,6 +3585,9 @@ Abschliessend muss isdnlog mit der weiteren Option "-2" gestartet werden.
|
|||
16. SQL-Anbindung
|
||||
-----------------
|
||||
|
||||
16.1. Postgres
|
||||
--------------
|
||||
|
||||
Wird isdnlog mit "POSTGRES=1" erstellt, traegt isdnlog alle
|
||||
Verbindungsinformationen zusaetzlich in eine Postgres95 SQL-Datenbank ein.
|
||||
(Datenbank "isdn", Tabelle "isdn2")
|
||||
|
@ -3632,6 +3637,68 @@ sowie
|
|||
$PGPORT
|
||||
auch ein postmaster auf einem anderen Host angesprochen werden.
|
||||
|
||||
16.2. MySQL
|
||||
-----------
|
||||
|
||||
Wenn im Konfigurationmenue mysql ausgewaehlt wird, werden alle
|
||||
Verbindungsdaten zusaetzlich zur Datei isdn.log in eine Tabelle in der
|
||||
Datenbank geschrieben.
|
||||
|
||||
Der Name der Datenbank, die Tabelle, der SQL-Host, der Username und
|
||||
das Passwort werden in der Datei ./isdnlog/mysqldb.h definiert.
|
||||
Standardmaessig enthalten sie folgende Werte.
|
||||
|
||||
DB_HOST = localhost
|
||||
DB_NAME = isdn
|
||||
DB_USER = isdn
|
||||
DB_PASSWD = isdn
|
||||
DB_TABLE = isdnlog
|
||||
|
||||
Zur Erstellung der Datenbank sind folgende Schritte notwendig.
|
||||
|
||||
# mysqladmin create isdn
|
||||
# mysql mysql < grants.txt (Inhalt wird spaeter erlaeutert)
|
||||
# mysqladmin reload
|
||||
# mysql isdn < table.txt (Inhalt wird spaeter erlaeutert)
|
||||
|
||||
Inhalt der Datei grants.txt:
|
||||
|
||||
--
|
||||
|
||||
INSERT INTO user VALUES ('localhost','isdn',password('isdn'),'N','N','N','N','N','N','N','N','N','N');
|
||||
INSERT INTO db VALUES ('localhost','isdn','isdn','N','Y','N','N','N','N');
|
||||
|
||||
--
|
||||
|
||||
Inhalt der Datei table.txt:
|
||||
|
||||
--
|
||||
|
||||
CREATE TABLE isdnlog (
|
||||
sdate date NOT NULL,
|
||||
stime time NOT NULL,
|
||||
calling varchar(30) NOT NULL,
|
||||
called varchar(30) NOT NULL,
|
||||
charge int(4) NOT NULL,
|
||||
dir char(1) NOT NULL,
|
||||
in_bytes int(4) NOT NULL,
|
||||
out_bytes int(4) NOT NULL,
|
||||
msec int(4) NOT NULL,
|
||||
sec int(4) NOT NULL,
|
||||
status int(4) NOT NULL,
|
||||
service int(4) NOT NULL,
|
||||
source int(4) NOT NULL,
|
||||
vrsion int(4) NOT NULL,
|
||||
factor double(16,4) NOT NULL,
|
||||
currency varchar(30) NOT NULL,
|
||||
pay double(16,4) NOT NULL,
|
||||
provider varchar(30) NOT NULL,
|
||||
KEY (sdate,stime),
|
||||
KEY (calling,called),
|
||||
KEY (pay,provider)
|
||||
);
|
||||
|
||||
--
|
||||
|
||||
17. Probleme?
|
||||
-------------
|
||||
|
|
|
@ -56,6 +56,63 @@ AC_DEFUN(AC_CHECK_POSTGRES, [
|
|||
AC_SUBST(POSTGRESDIR)
|
||||
])
|
||||
dnl
|
||||
dnl Check for mysql
|
||||
dnl
|
||||
|
||||
AC_DEFUN(AC_CHECK_MYSQLDB, [
|
||||
MYSQLDIR=""
|
||||
mydir="no"
|
||||
tst_mysqldir="$CONFIG_ISDNLOG_MYSQLDIR"
|
||||
|
||||
AC_ARG_WITH(mysql,
|
||||
[ --with-mysql=DIR Set mysql directory []],
|
||||
tst_mysqldir="${withval}")
|
||||
|
||||
if test "$tst_mysqldir" != "" || test "$CONFIG_ISDNLOG_MYSQLDB" = "y" ; then
|
||||
AC_MSG_CHECKING([for mysql in ${tst_mysqldir}])
|
||||
if test "${tst_mysqldir}" != "" ; then
|
||||
AC_EGREP_HEADER(MYSQL,${tst_mysqldir}/include/mysql.h,
|
||||
mydir=${tst_mysqldir})
|
||||
fi
|
||||
if test "$mydir" = "no" ; then
|
||||
AC_MSG_RESULT("$mydir")
|
||||
AC_MSG_CHECKING([for mysql in /lib/mysql])
|
||||
AC_EGREP_HEADER(MYSQL,/lib/mysql/include/mysql.h,
|
||||
mydir=/lib/mysql)
|
||||
fi
|
||||
if test "$mydir" = "no" ; then
|
||||
AC_MSG_RESULT("$mydir")
|
||||
AC_MSG_CHECKING([for mysql in /usr/lib/mysql])
|
||||
AC_EGREP_HEADER(MYSQL,/usr/lib/mysql/include/mysql.h,
|
||||
mydir=/usr/lib/mysql)
|
||||
fi
|
||||
if test "$mydir" = "no" ; then
|
||||
AC_MSG_RESULT("$mydir")
|
||||
AC_MSG_CHECKING([for mysql in /usr/local/mysql])
|
||||
AC_EGREP_HEADER(MYSQL,/usr/local/postgre95/include/mysql.h,
|
||||
mydir=/usr/local/mysql)
|
||||
fi
|
||||
if test "$mydir" = "no" ; then
|
||||
AC_MSG_RESULT("$mydir")
|
||||
AC_MSG_CHECKING([for mysql in /usr/local/lib/mysql])
|
||||
AC_EGREP_HEADER(MYSQL,/usr/local/lib/mysql/include/mysql.h,
|
||||
mydir=/usr/local/lib/mysql)
|
||||
fi
|
||||
fi
|
||||
if test "$mydir" != "no" ; then
|
||||
AC_MSG_RESULT("yes")
|
||||
MYSQLDB=1
|
||||
AC_DEFINE_UNQUOTED(MYSQLDB,1)
|
||||
else
|
||||
AC_MSG_RESULT("no MYSQL DISABLED")
|
||||
mydir=""
|
||||
fi
|
||||
MYSQLDIR="$mydir"
|
||||
AC_DEFINE_UNQUOTED(MYSQLDIR,"$mydir")
|
||||
AC_SUBST(MYSQLDB)
|
||||
AC_SUBST(MYSQLDIR)
|
||||
])
|
||||
dnl
|
||||
dnl Try finding linux sourcetree
|
||||
dnl
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@ ac_default_prefix=/usr/local
|
|||
ac_default_prefix=/usr
|
||||
ac_help="$ac_help
|
||||
--with-postgres=DIR Set postgres directory []"
|
||||
ac_help="$ac_help
|
||||
--with-mysql=DIR Set mysql directory []"
|
||||
ac_help="$ac_help
|
||||
--with-kernel=DIR Set kernel source directory [/usr/src/linux]"
|
||||
ac_help="$ac_help
|
||||
|
@ -560,6 +562,7 @@ AREACODE=${CONFIG_AREACODE:-""}
|
|||
AREAPREFIX=${CONFIG_AREA_PREFIX:-"0"}
|
||||
CONFIG_LIB_AREACODE=${CONFIG_LIB_AREACODE:-"y"}
|
||||
CONFIG_ISDNLOG_POSTGRESDIR=${CONFIG_ISDNLOG_POSTGRESDIR:-""}
|
||||
CONFIG_ISDNLOG_MYSQLDIR=${CONFIG_ISDNLOG_MYSQLDIR:-""}
|
||||
CONFIG_KERNELDIR=${CONFIG_KERNELDIR:-"/usr/src/linux"}
|
||||
LIBISDNDIR="../lib"
|
||||
bindir=${CONFIG_BINDIR:-"/usr/bin"}
|
||||
|
@ -584,6 +587,7 @@ AREACODE=`eval echo $AREACODE`
|
|||
AREAPREFIX=`eval echo $AREAPREFIX`
|
||||
CONFIG_LIB_AREACODE=`eval echo $CONFIG_LIB_AREACODE`
|
||||
CONFIG_ISDNLOG_POSTGRESDIR=`eval echo $CONFIG_ISDNLOG_POSTGRESDIR`
|
||||
CONFIG_ISDNLOG_MYSQLDIR=`eval echo $CONFIG_ISDNLOG_MYSQLDIR`
|
||||
CONFIG_KERNELDIR=`eval echo $CONFIG_KERNELDIR`
|
||||
bindir=`eval echo $bindir`
|
||||
sbindir=`eval echo $sbindir`
|
||||
|
@ -1151,7 +1155,7 @@ rm -f conftest*
|
|||
echo $ac_n "checking for postgres in /usr/local/lib/postgres95""... $ac_c" 1>&6
|
||||
echo "configure:1153: checking for postgres in /usr/local/lib/postgres95" >&5
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1155 "configure"
|
||||
#line 1158 "configure"
|
||||
#include "confdefs.h"
|
||||
#include </usr/lib/local/lib/postgre95/include/libpq-fe.h>
|
||||
EOF
|
||||
|
@ -1180,8 +1184,121 @@ EOF
|
|||
#define POSTGRESDIR "$pqdir"
|
||||
EOF
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
MYSQLDIR=""
|
||||
mydir="no"
|
||||
tst_mysqldir="$CONFIG_ISDNLOG_MYSQLDIR"
|
||||
|
||||
# Check whether --with-mysql or --without-mysql was given.
|
||||
if test "${with_mysql+set}" = set; then
|
||||
withval="$with_mysql"
|
||||
tst_mysqldir="${withval}"
|
||||
fi
|
||||
|
||||
|
||||
if test "$tst_mysqldir" != "" || test "$CONFIG_ISDNLOG_MYSQLDB" = "y" ; then
|
||||
echo $ac_n "checking for mysql in ${tst_mysqldir}""... $ac_c" 1>&6
|
||||
echo "configure:1201: checking for mysql in ${tst_mysqldir}" >&5
|
||||
if test "${tst_mysqldir}" != "" ; then
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1204 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <${tst_mysqldir}/include/mysql.h>
|
||||
EOF
|
||||
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
|
||||
egrep "MYSQL" >/dev/null 2>&1; then
|
||||
rm -rf conftest*
|
||||
mydir=${tst_mysqldir}
|
||||
fi
|
||||
rm -f conftest*
|
||||
|
||||
fi
|
||||
if test "$mydir" = "no" ; then
|
||||
echo "$ac_t"""$mydir"" 1>&6
|
||||
echo $ac_n "checking for mysql in /lib/mysql""... $ac_c" 1>&6
|
||||
echo "configure:1219: checking for mysql in /lib/mysql" >&5
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1221 "configure"
|
||||
#include "confdefs.h"
|
||||
#include </lib/mysql/include/mysql.h>
|
||||
EOF
|
||||
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
|
||||
egrep "MYSQL" >/dev/null 2>&1; then
|
||||
rm -rf conftest*
|
||||
mydir=/lib/mysql
|
||||
fi
|
||||
rm -f conftest*
|
||||
|
||||
fi
|
||||
if test "$mydir" = "no" ; then
|
||||
echo "$ac_t"""$mydir"" 1>&6
|
||||
echo $ac_n "checking for mysql in /usr/lib/mysql""... $ac_c" 1>&6
|
||||
echo "configure:1236: checking for mysql in /usr/lib/mysql" >&5
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1238 "configure"
|
||||
#include "confdefs.h"
|
||||
#include </usr/lib/mysql/include/mysql.h>
|
||||
EOF
|
||||
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
|
||||
egrep "MYSQL" >/dev/null 2>&1; then
|
||||
rm -rf conftest*
|
||||
mydir=/usr/lib/mysql
|
||||
fi
|
||||
rm -f conftest*
|
||||
|
||||
fi
|
||||
if test "$mydir" = "no" ; then
|
||||
echo "$ac_t"""$mydir"" 1>&6
|
||||
echo $ac_n "checking for mysql in /usr/local/mysql""... $ac_c" 1>&6
|
||||
echo "configure:1253: checking for mysql in /usr/local/mysql" >&5
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1255 "configure"
|
||||
#include "confdefs.h"
|
||||
#include </usr/local/mysql/include/mysql.h>
|
||||
EOF
|
||||
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
|
||||
egrep "MYSQL" >/dev/null 2>&1; then
|
||||
rm -rf conftest*
|
||||
mydir=/usr/local/mysql
|
||||
fi
|
||||
rm -f conftest*
|
||||
|
||||
fi
|
||||
if test "$mydir" = "no" ; then
|
||||
echo "$ac_t"""$mydir"" 1>&6
|
||||
echo $ac_n "checking for mysql in /usr/local/lib/mysql""... $ac_c" 1>&6
|
||||
echo "configure:1270: checking for mysql in /usr/local/lib/mysql" >&5
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1272 "configure"
|
||||
#include "confdefs.h"
|
||||
#include </usr/local/lib/mysql/include/mysql.h>
|
||||
EOF
|
||||
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
|
||||
egrep "MYSQL" >/dev/null 2>&1; then
|
||||
rm -rf conftest*
|
||||
mydir=/usr/local/lib/mysql
|
||||
fi
|
||||
rm -f conftest*
|
||||
|
||||
fi
|
||||
fi
|
||||
if test "$mydir" != "no" ; then
|
||||
echo "$ac_t"""yes"" 1>&6
|
||||
MYSQLDB=1
|
||||
cat >> confdefs.h <<EOF
|
||||
#define MYSQLDB 1
|
||||
EOF
|
||||
|
||||
else
|
||||
echo "$ac_t"""no MYSQL DISABLED"" 1>&6
|
||||
mydir=""
|
||||
fi
|
||||
MYSQLDIR="$mydir"
|
||||
cat >> confdefs.h <<EOF
|
||||
#define MYSQLDIR "$mydir"
|
||||
EOF
|
||||
|
||||
|
||||
|
||||
#AC_CHECK_LIB(dbmalloc, main)
|
||||
|
@ -2231,6 +2348,8 @@ s%@SET_MAKE@%$SET_MAKE%g
|
|||
s%@CPP@%$CPP%g
|
||||
s%@POSTGRES@%$POSTGRES%g
|
||||
s%@POSTGRESDIR@%$POSTGRESDIR%g
|
||||
s%@MYSQLDB@%$MYSQLDB%g
|
||||
s%@MYSQLDIR@%$MYSQLDIR%g
|
||||
s%@CONFIG_KERNELDIR@%$CONFIG_KERNELDIR%g
|
||||
s%@LIBOBJS@%$LIBOBJS%g
|
||||
s%@LIBISDNDIR@%$LIBISDNDIR%g
|
||||
|
|
|
@ -27,6 +27,7 @@ AREACODE=${CONFIG_AREACODE:-""}
|
|||
AREAPREFIX=${CONFIG_AREA_PREFIX:-"0"}
|
||||
CONFIG_LIB_AREACODE=${CONFIG_LIB_AREACODE:-"y"}
|
||||
CONFIG_ISDNLOG_POSTGRESDIR=${CONFIG_ISDNLOG_POSTGRESDIR:-""}
|
||||
CONFIG_ISDNLOG_MYSQLDIR=${CONFIG_ISDNLOG_MYSQLDIR:-""}
|
||||
CONFIG_KERNELDIR=${CONFIG_KERNELDIR:-"/usr/src/linux"}
|
||||
LIBISDNDIR="../lib"
|
||||
bindir=${CONFIG_BINDIR:-"/usr/bin"}
|
||||
|
@ -51,6 +52,7 @@ AREACODE=`eval echo $AREACODE`
|
|||
AREAPREFIX=`eval echo $AREAPREFIX`
|
||||
CONFIG_LIB_AREACODE=`eval echo $CONFIG_LIB_AREACODE`
|
||||
CONFIG_ISDNLOG_POSTGRESDIR=`eval echo $CONFIG_ISDNLOG_POSTGRESDIR`
|
||||
CONFIG_ISDNLOG_MYSQLDIR=`eval echo $CONFIG_ISDNLOG_MYSQLDIR`
|
||||
CONFIG_KERNELDIR=`eval echo $CONFIG_KERNELDIR`
|
||||
bindir=`eval echo $bindir`
|
||||
sbindir=`eval echo $sbindir`
|
||||
|
@ -89,6 +91,7 @@ dnl Checks for libraries.
|
|||
AC_CHECK_LIB(dbm, dbm_open, DBMLIB=-ldbm; AC_DEFINE(HAVE_LIBDBM),
|
||||
AC_CHECK_LIB(gdbm, gdbm_open, DBMLIB=-lgdbm; AC_DEFINE(HAVE_LIBGDBM)))
|
||||
AC_CHECK_POSTGRES
|
||||
AC_CHECK_MYSQLDB
|
||||
|
||||
dnl TODO: replace main by a funcion within libdbmalloc
|
||||
#AC_CHECK_LIB(dbmalloc, main)
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.9 1998/03/08 11:42:48 luethje
|
||||
* I4L-Meeting Wuerzburg final Edition, golden code - Service Pack number One
|
||||
*
|
||||
* Revision 1.8 1997/05/29 17:07:19 akool
|
||||
* 1TR6 fix
|
||||
* suppress some noisy messages (Bearer, Channel, Progress) - can be reenabled with log-level 0x1000
|
||||
|
@ -46,7 +49,9 @@
|
|||
#ifdef POSTGRES
|
||||
#include "postgres.h"
|
||||
#endif
|
||||
|
||||
#ifdef MYSQLDB
|
||||
#include "mysqldb.h"
|
||||
#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
@ -103,6 +108,9 @@ void _Exit(char *File, int Line, int RetCode) /* WARNING: RetCode==-9 does _not_
|
|||
#ifdef POSTGRES
|
||||
dbClose();
|
||||
#endif
|
||||
#ifdef MYSQLDB
|
||||
mysql_dbClose();
|
||||
#endif
|
||||
|
||||
if (!replay) {
|
||||
saveCharge();
|
||||
|
@ -165,6 +173,9 @@ void logger(int chan)
|
|||
#ifdef POSTGRES
|
||||
auto DbStrIn db_set;
|
||||
#endif
|
||||
#ifdef MYSQLDB
|
||||
auto mysql_DbStrIn mysql_db_set;
|
||||
#endif
|
||||
|
||||
|
||||
strcpy(s, ctime(&call[chan].connect));
|
||||
|
@ -239,11 +250,32 @@ void logger(int chan)
|
|||
db_set.currency_factor = currency_factor;
|
||||
strcpy(db_set.currency, currency);
|
||||
db_set.pay = call[chan].pay;
|
||||
|
||||
dbAdd(&db_set);
|
||||
#endif
|
||||
#ifdef MYSQLDB
|
||||
mysql_db_set.connect = call[chan].connect;
|
||||
strcpy(mysql_db_set.calling, call[chan].num[CALLING]);
|
||||
strcpy(mysql_db_set.called, call[chan].num[CALLED]);
|
||||
mysql_db_set.duration = (int)(call[chan].disconnect - call[chan].connect);
|
||||
mysql_db_set.hduration = (int)call[chan].duration;
|
||||
mysql_db_set.aoce = call[chan].aoce;
|
||||
mysql_db_set.dialin = call[chan].dialin ? 'I' : 'O';
|
||||
mysql_db_set.cause = call[chan].cause;
|
||||
mysql_db_set.ibytes = call[chan].ibytes;
|
||||
mysql_db_set.obytes = call[chan].obytes;
|
||||
mysql_db_set.version = atoi(LOG_VERSION);
|
||||
mysql_db_set.si1 = call[chan].si1;
|
||||
mysql_db_set.si11 = call[chan].si11;
|
||||
mysql_db_set.currency_factor = currency_factor;
|
||||
strcpy(mysql_db_set.currency, currency);
|
||||
mysql_db_set.pay = call[chan].pay;
|
||||
strcpy(mysql_db_set.provider, call[chan].provider);
|
||||
mysql_dbAdd(&mysql_db_set);
|
||||
#endif
|
||||
} /* logger */
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
int print_msg(int Level, const char *fmt, ...)
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.16 1998/03/08 12:13:38 luethje
|
||||
* Patches by Paul Slootman
|
||||
*
|
||||
* Revision 1.15 1998/03/08 11:42:50 luethje
|
||||
* I4L-Meeting Wuerzburg final Edition, golden code - Service Pack number One
|
||||
*
|
||||
|
@ -74,6 +77,9 @@
|
|||
#ifdef POSTGRES
|
||||
#include "postgres.h"
|
||||
#endif
|
||||
#ifdef MYSQLDB
|
||||
#include "mysqldb.h"
|
||||
#endif
|
||||
|
||||
#define FD_SET_MAX(desc, set, max) { if (desc > max) max=desc; FD_SET(desc,set); }
|
||||
|
||||
|
@ -927,6 +933,9 @@ int main(int argc, char *argv[], char *envp[])
|
|||
|
||||
#ifdef POSTGRES
|
||||
dbOpen();
|
||||
#endif
|
||||
#ifdef MYSQLDB
|
||||
mysql_dbOpen();
|
||||
#endif
|
||||
loop();
|
||||
|
||||
|
|
|
@ -102,6 +102,9 @@
|
|||
/* Define if postgres should be used */
|
||||
#undef POSTGRES
|
||||
|
||||
/* Define if mysql should be used */
|
||||
#undef MYSQLDB
|
||||
|
||||
/* Define if server port */
|
||||
#undef SERV_PORT
|
||||
|
||||
|
|
|
@ -71,8 +71,10 @@ CONFIG_ISDNLOG_STOPCMD='stop'
|
|||
CONFIG_ISDNLOG_REBOOTCMD='/sbin/reboot'
|
||||
CONFIG_ISDNLOG_OLDI4LCONFDIR='/etc/isdnlog'
|
||||
CONFIG_ISDNLOG_OLDI4LCONFFILE='isdnlog.conf'
|
||||
CONFIG_ISDNLOG_POSTGRES=y
|
||||
CONFIG_ISDNLOG_POSTGRES=n
|
||||
CONFIG_ISDNLOG_POSTGRESDIR='/usr/local/postgres95'
|
||||
CONFIG_ISDNLOG_MYSQLDB=n
|
||||
CONFIG_ISDNLOG_MYSQLDIR='/usr/local/mysql'
|
||||
CONFIG_ISDNLOG_DE=y
|
||||
CONFIG_IPPPSTATS=y
|
||||
CONFIG_XISDNLOAD=y
|
||||
|
|
Loading…
Reference in New Issue