diff --git a/isdnlog/isdnlog/processor.c b/isdnlog/isdnlog/processor.c index d576835f..b1ff72aa 100644 --- a/isdnlog/isdnlog/processor.c +++ b/isdnlog/isdnlog/processor.c @@ -1,4 +1,4 @@ -/* $Id: processor.c,v 1.17 1998/03/25 20:58:34 luethje Exp $ +/* $Id: processor.c,v 1.18 1998/04/09 19:15:07 akool Exp $ * * ISDN accounting for isdn4linux. (log-module) * @@ -19,6 +19,11 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: processor.c,v $ + * Revision 1.18 1998/04/09 19:15:07 akool + * - CityPlus Implementation from Oliver Lauer + * - dont change huptimeout, if disabled (via isdnctrl huptimeout isdnX 0) + * - Support for more Providers (TelePassport, Tele 2, TelDaFax) + * * Revision 1.17 1998/03/25 20:58:34 luethje * isdnrep: added html feature (verbose on/off) * processor.c: Patch of Oliver Lauer @@ -3030,17 +3035,39 @@ static void huptime(int chan, int bchan) #endif call[chan].huptimeout = oldhuptimeout = cfg.onhtime; + if (!oldhuptimeout) { + sprintf(sx, "HUPTIMEOUT %s is *disabled* - unchanged", known[c]->interface, oldhuptimeout); + info(chan, PRT_SHOWNUMBERS, STATE_HUPTIMEOUT, sx); + return; + } /* if */ + newchargeint = (int)cheap96(cur_time, known[c]->zone, &zeit); sprintf(why, "%s, %s", z2s(known[c]->zone), t2tz(zeit)); - if (!memcmp(call[chan].provider, "01019", 5)) { /* Mobilcom 60/60 Takt */ + if (!memcmp(call[chan].provider + 3, "19", 2)) { /* Mobilcom 60/60 Takt */ newchargeint = 60; - sprintf(why, "via Mobilcom"); + sprintf(why, "via %s", Providername(call[chan].provider)); } - else if (!memcmp(call[chan].provider, "01070", 5)) { /* Arcor 1/1 Takt */ + else if (!memcmp(call[chan].provider + 3, "24", 2)) { /* TelePasswort 1s Takt */ newchargeint = 1; - sprintf(why, "via Arcor"); + sprintf(why, "via %s", Providername(call[chan].provider)); + } + else if (!memcmp(call[chan].provider + 3, "70", 2)) { /* Arcor 1s Takt */ + newchargeint = 1; + sprintf(why, "via %s", Providername(call[chan].provider)); + } + else if (!memcmp(call[chan].provider + 3, "30", 2)) { /* TelDaFax 1s Takt */ + newchargeint = 1; + sprintf(why, "via %s", Providername(call[chan].provider)); + } + else if (!memcmp(call[chan].provider + 3, "13", 2)) { /* Tele 2 1s Takt */ + newchargeint = 1; + sprintf(why, "via %s", Providername(call[chan].provider)); + } + else if (!memcmp(call[chan].provider + 3, "24", 2)) { /* TelePassport 1/1 Takt */ + newchargeint = 1; + sprintf(why, "via %s", Providername(call[chan].provider)); } /* else */ #if NET_DV >= NETDV_CHARGEINT diff --git a/isdnlog/isdnrep/cheap.c b/isdnlog/isdnrep/cheap.c index 03991a9f..43216841 100644 --- a/isdnlog/isdnrep/cheap.c +++ b/isdnlog/isdnrep/cheap.c @@ -1,4 +1,4 @@ -/* $Id: cheap.c,v 1.3 1997/04/03 22:29:59 luethje Exp $ +/* $Id: cheap.c,v 1.4 1998/04/09 19:15:21 akool Exp $ * * ISDN accounting for isdn4linux. (Feiertagsberechnung) * @@ -19,6 +19,11 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: cheap.c,v $ + * Revision 1.4 1998/04/09 19:15:21 akool + * - CityPlus Implementation from Oliver Lauer + * - dont change huptimeout, if disabled (via isdnctrl huptimeout isdnX 0) + * - Support for more Providers (TelePassport, Tele 2, TelDaFax) + * * Revision 1.3 1997/04/03 22:29:59 luethje * improved performance * @@ -339,7 +344,7 @@ double cheap96(time_t when, int zone, int *zeit) *zeit = 0; return(cheap(when, zone)); #else - register int i, takt = 0; + register int i, takt = 0, CityPlus = 0; auto struct tm *tm; /* neue Tarife aus: iX 10/95, Pg 32 */ @@ -379,6 +384,10 @@ double cheap96(time_t when, int zone, int *zeit) 4 = Mondschein 21:00 .. 5:00 */ + if (zone == 21) { + CityPlus = 1; + zone = 1; + } tm = localtime(&when); @@ -425,7 +434,7 @@ double cheap96(time_t when, int zone, int *zeit) if ((takt == 6) && (zone < 5)) { /* Feiertage */ if ((tm->tm_hour > 4) && (tm->tm_hour < 21)) { if (CityWeekend && (zone == 1)) { - *zeit = 8; + *zeit = 7; return(gebuehr[2][zone - 1][3]); } else @@ -438,8 +447,33 @@ double cheap96(time_t when, int zone, int *zeit) (tm->tm_mday > 26) && (zone < 5)) { return(gebuehr[2][zone - 1][*zeit = --takt]); } - else /* Werktage bzw. Wochenenden */ - return(gebuehr[1][zone - 1][*zeit = --takt]); + else { /* Werktage bzw. Wochenenden */ + if (((tm->tm_hour > 4) && (tm->tm_hour < 21)) && + ((tm->tm_wday == 6) || (tm->tm_wday == 0))) { /* Wochenende Freizeit */ + if (CityWeekend && (zone == 1)) { + *zeit=7; + return(gebuehr[1][zone - 1][3]); + } + else if (((zone == 3) || (zone == 4)) && + (((tm->tm_year > 97) && (tm->tm_mon > 2)) || + (tm->tm_year > 98))) { /* GermanCall Freizeit Wochenende ab 01.03.98 30 s */ + *zeit=4; + return(30); /* zusätzliche Tarifart, Matrix müßte erweitert werden */ + } + else if (CityPlus) { + *zeit=8; + return(gebuehr[1][0][1]); + } + else + return(gebuehr[1][zone - 1][*zeit = --takt]); + } + else if (((tm->tm_hour > 4) && (tm->tm_hour < 21)) && CityPlus) { + *zeit=8; + return(gebuehr[1][0][1]); + } + else + return(gebuehr[1][zone - 1][*zeit = --takt]); + } } else { if (zone == 5) { /* Angrenzende Laender */ @@ -449,7 +483,7 @@ double cheap96(time_t when, int zone, int *zeit) else { if (takt == 6) { /* Feiertage */ if ((tm->tm_hour > 4) && (tm->tm_hour < 21)) { - *zeit = 10; + *zeit = 9; return(gebuehr[0][zone - 1][2]); } else diff --git a/isdnlog/tools/tools.c b/isdnlog/tools/tools.c index 0e38d99e..e93b8a22 100644 --- a/isdnlog/tools/tools.c +++ b/isdnlog/tools/tools.c @@ -1,4 +1,4 @@ -/* $Id: tools.c,v 1.9 1998/03/08 11:43:16 luethje Exp $ +/* $Id: tools.c,v 1.10 1998/04/09 19:15:45 akool Exp $ * * ISDN accounting for isdn4linux. (Utilities) * @@ -19,6 +19,11 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: tools.c,v $ + * Revision 1.10 1998/04/09 19:15:45 akool + * - CityPlus Implementation from Oliver Lauer + * - dont change huptimeout, if disabled (via isdnctrl huptimeout isdnX 0) + * - Support for more Providers (TelePassport, Tele 2, TelDaFax) + * * Revision 1.9 1998/03/08 11:43:16 luethje * I4L-Meeting Wuerzburg final Edition, golden code - Service Pack number One * @@ -600,6 +605,20 @@ char *Providername(char *number) return("WorldCom"); else if (!memcmp(number + 3, "25", 2)) return("Citykom Muenster"); + else if (!memcmp(number + 3, "13", 2)) + return("Tele 2"); + else if (!memcmp(number + 3, "49", 2)) + return("ACC"); + else if (!memcmp(number + 3, "18", 2)) + return("Debitel"); + else if (!memcmp(number + 3, "55", 2)) + return("Esprit"); + else if (!memcmp(number + 3, "14", 2)) + return("EWE"); + else if (!memcmp(number + 3, "41", 2)) + return("HanseNet"); + else if (!memcmp(number + 3, "36", 2)) + return("Hutchison Telekom"); else return("UNKNOWN PROVIDER"); } /* Providername */ @@ -888,6 +907,7 @@ char *z2s(int zone) case 14 : return("Inmar"); break; case 15 : return("C-Box"); break; case 16 : return("T-Box"); break; + case 21 : return("City"); break; /* City Plus */ default : return(""); break; } /* switch */ } /* z2s */