isdnlog now handles chargeint/non-chargeint Kernels automatically.
Manually setting of CONFIG_ISDNLOG_OLD_I4L no more needed.
This commit is contained in:
parent
85e5039616
commit
91f40452c2
|
@ -13,7 +13,6 @@ bool 'Support postgres95 SQL-Database' CONFIG_ISDNLOG_POSTGRES
|
|||
if [ "$CONFIG_ISDNLOG_POSTGRES" = "y" ]; then
|
||||
string 'directory of postgres95' CONFIG_ISDNLOG_POSTGRESDIR
|
||||
fi
|
||||
bool 'Support for old isdn4linux' CONFIG_ISDNLOG_OLD_I4L
|
||||
choice 'Country specific chargeinfo support' \
|
||||
"DE CONFIG_ISDNLOG_DE \
|
||||
NL CONFIG_ISDNLOG_NL \
|
||||
|
|
|
@ -80,9 +80,6 @@ fi
|
|||
if test "$CONFIG_ISDNLOG_NL" = "y" ; then
|
||||
AC_DEFINE(ISDN_NL,1)
|
||||
fi
|
||||
if test "$CONFIG_ISDNLOG_OLD_I4L" = "y" ; then
|
||||
AC_DEFINE(OLD_I4L,1)
|
||||
fi
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
|
|
|
@ -19,6 +19,11 @@
|
|||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.9 1997/06/22 23:03:25 luethje
|
||||
* In subsection FLAGS it will be checked if the section name FLAG is korrect
|
||||
* isdnlog recognize calls abroad
|
||||
* bugfix for program starts
|
||||
*
|
||||
* Revision 1.8 1997/05/29 17:07:22 akool
|
||||
* 1TR6 fix
|
||||
* suppress some noisy messages (Bearer, Channel, Progress) - can be reenabled with log-level 0x1000
|
||||
|
@ -2901,6 +2906,9 @@ static int b2c(register int b)
|
|||
} /* b2c */
|
||||
|
||||
|
||||
/* NET_DV since 'chargeint' field exists */
|
||||
#define NETDV_CHARGEINT 0x02
|
||||
|
||||
static void huptime(int chan, int bchan)
|
||||
{
|
||||
register int c = call[chan].confentry[OTHER];
|
||||
|
@ -2915,20 +2923,35 @@ static void huptime(int chan, int bchan)
|
|||
strcpy(cfg.name, known[c]->interface);
|
||||
|
||||
if (ioctl(sockets[ISDNCTRL].descriptor, IIOCNETGCF, &cfg) >= 0) {
|
||||
#ifndef OLD_I4L
|
||||
#if NET_DV >= NETDV_CHARGEINT
|
||||
if (net_dv >= NETDV_CHARGEINT)
|
||||
call[chan].chargeint = oldchargeint = cfg.chargeint;
|
||||
#endif
|
||||
call[chan].huptimeout = oldhuptimeout = cfg.onhtime;
|
||||
|
||||
newchargeint = (int)cheap96(cur_time, known[c]->zone, &zeit);
|
||||
|
||||
#if NET_DV >= NETDV_CHARGEINT
|
||||
if (net_dv >= NETDV_CHARGEINT) {
|
||||
if (hup1 && hup2)
|
||||
newhuptimeout = (newchargeint < 20) ? hup1 : hup2;
|
||||
else
|
||||
newhuptimeout = oldhuptimeout;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
/* for old kernels/kernel headers use old behaviour: hangup is charge
|
||||
* time minus -h param */
|
||||
if (hup1) {
|
||||
newhuptimeout = newchargeint - hup1;
|
||||
oldchargeint = newchargeint;
|
||||
}
|
||||
else
|
||||
newhuptimeout = oldhuptimeout;
|
||||
|
||||
if (oldchargeint != newchargeint) {
|
||||
#ifndef OLD_I4L
|
||||
if (oldchargeint != newchargeint || oldhuptimeout != newhuptimeout) {
|
||||
#if NET_DV >= NETDV_CHARGEINT
|
||||
if (net_dv >= NETDV_CHARGEINT)
|
||||
call[chan].chargeint = cfg.chargeint = newchargeint;
|
||||
#endif
|
||||
call[chan].huptimeout = cfg.onhtime = newhuptimeout;
|
||||
|
@ -3162,6 +3185,11 @@ static void processinfo(char *s)
|
|||
|
||||
if (!replay)
|
||||
if ((version = ioctl(sockets[ISDNINFO].descriptor, IIOCGETDVR)) != -EINVAL) {
|
||||
#ifdef NET_DV
|
||||
int my_net_dv = NET_DV;
|
||||
#else
|
||||
int my_net_dv = 0;
|
||||
#endif
|
||||
|
||||
tty_dv = version & 0xff;
|
||||
version = version >> 8;
|
||||
|
@ -3170,6 +3198,17 @@ static void processinfo(char *s)
|
|||
inf_dv = version & 0xff;
|
||||
|
||||
print_msg(PRT_NORMAL, "(Data versions: iprofd=0x%02x net_cfg=0x%02x /dev/isdninfo=0x%02x)\n", tty_dv, net_dv, inf_dv);
|
||||
if (/* Abort if kernel version is greater, since struct has probably
|
||||
* become larger and would overwrite our stack */
|
||||
net_dv > my_net_dv ||
|
||||
/* version 0x03 is special, because it changed a field in the
|
||||
* middle of the struct and thus is compatible only to itself */
|
||||
((my_net_dv == 0x03 || net_dv == 0x03) && my_net_dv != net_dv)) {
|
||||
print_msg(PRT_ERR, "isdn_net_ioctl_cfg version mismatch "
|
||||
"(kernel 0x%02x, isdnlog 0x%02x)\n",
|
||||
net_dv, my_net_dv);
|
||||
Exit(99);
|
||||
}
|
||||
} /* if */
|
||||
|
||||
if (chans > 2) /* coming soon ;-) */
|
||||
|
|
|
@ -71,7 +71,6 @@ CONFIG_ISDNLOG_OLDI4LCONFDIR='/etc/isdnlog'
|
|||
CONFIG_ISDNLOG_OLDI4LCONFFILE='isdnlog.conf'
|
||||
CONFIG_ISDNLOG_POSTGRES=y
|
||||
CONFIG_ISDNLOG_POSTGRESDIR='/usr/local/postgres95'
|
||||
# CONFIG_ISDNLOG_OLD_I4L is not set
|
||||
CONFIG_ISDNLOG_DE=y
|
||||
CONFIG_IPPPSTATS=y
|
||||
CONFIG_XISDNLOAD=y
|
||||
|
|
Loading…
Reference in New Issue