From 615f93525511b8a6f3bce7fa50c13310bddb3598 Mon Sep 17 00:00:00 2001 From: Andreas Kool Date: Thu, 25 Nov 1999 22:58:41 +0000 Subject: [PATCH] isdnlog-3.68 - new utility "isdnbill" added - patch from Jochen Erwied (j.erwied@gmx.de) - new rates - small fixes --- isdnlog/Makefile.in | 20 +- isdnlog/country-de.dat | 16 +- isdnlog/isdnlog/functions.c | 17 +- isdnlog/isdnrep/isdnbill.c | 617 ++++++++++++++++++++++++++++++++ isdnlog/rate-de.dat | 147 +++++--- isdnlog/rate-de.dat.src | 147 +++++--- isdnlog/tools/dest.c | 54 +-- isdnlog/tools/rate.c | 7 + isdnlog/tools/rate.h | 5 + isdnlog/tools/telrate/info.html | 2 +- 10 files changed, 904 insertions(+), 128 deletions(-) create mode 100644 isdnlog/isdnrep/isdnbill.c diff --git a/isdnlog/Makefile.in b/isdnlog/Makefile.in index fc619562..3a760ea9 100644 --- a/isdnlog/Makefile.in +++ b/isdnlog/Makefile.in @@ -19,6 +19,12 @@ ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ## ## $Log$ +## Revision 1.122 1999/11/16 18:09:36 akool +## isdnlog-3.67 +## isdnlog-3.66 writes wrong provider number into it's logfile isdn.log +## there is a patch and a repair program available at +## http://www.toetsch.at/linux/i4l/i4l-3_66.htm +## ## Revision 1.121 1999/11/12 20:50:48 akool ## isdnlog-3.66 ## - Patch from Jochen Erwied @@ -844,7 +850,7 @@ SERVICEFILE = /etc/services # DON'T EDIT BELOW THIS LINE ###################################################################### -VERSION = 3.67 +VERSION = 3.68 MANPAGES = isdnlog/callerid.conf.5 isdnlog/isdn.conf.5 \ isdnlog/isdnformat.5 isdnlog/isdnlog.5 isdnlog/isdnlog.8 \ @@ -908,6 +914,12 @@ ISDNREP_OBJS = isdnrep/rep_main.o tools/tools.o tools/isdnconf.o \ tools/telnum.o \ $(LIBISDNDIR)/libisdn.a +ISDNBILL_OBJS = isdnrep/isdnbill.o tools/tools.o tools/isdnconf.o \ + isdnlog/messages.o \ + tools/rate.o tools/zone.o tools/holiday.o tools/dest.o \ + tools/telnum.o \ + $(LIBISDNDIR)/libisdn.a + ISDNCONF_OBJS= isdnconf/isdnconf.o tools/tools.o tools/isdnconf.o \ tools/rate.o tools/zone.o tools/holiday.o \ tools/telnum.o tools/dest.o \ @@ -923,11 +935,12 @@ ISDNRATE_OBJS= tools/isdnrate.o tools/isdnconf.o tools/tools.o \ ISDNLOG = bin/isdnlog ISDNCONF = bin/isdnconf ISDNREP = bin/isdnrep +ISDNBILL = bin/isdnbill ISDNRATE = bin/isdnrate MODS = *.o */*.o -PROGS = $(ISDNLOG) $(ISDNREP) $(ISDNCONF) $(ISDNRATE) +PROGS = $(ISDNLOG) $(ISDNREP) $(ISDNBILL) $(ISDNCONF) $(ISDNRATE) all: depend libs mybin progs $(MANPAGES) @@ -1070,6 +1083,9 @@ $(ISDNLOG): $(ISDNLOG_OBJS) $(ISDNREP): $(ISDNREP_OBJS) $(CC) -o $(ISDNREP) $(LFLAGS) $(ISDNREP_OBJS) $(LIB) +$(ISDNBILL): $(ISDNBILL_OBJS) + $(CC) -o $(ISDNBILL) $(LFLAGS) $(ISDNBILL_OBJS) $(LIB) + $(ISDNCONF): $(ISDNCONF_OBJS) $(CC) -o $(ISDNCONF) $(LFLAGS) $(ISDNCONF_OBJS) $(LIB) diff --git a/isdnlog/country-de.dat b/isdnlog/country-de.dat index 0da64781..16afcae4 100644 --- a/isdnlog/country-de.dat +++ b/isdnlog/country-de.dat @@ -848,37 +848,37 @@ T:_DEMF N:Deutschland Mobilfunk C-Tel Voice Mail A:C-Tel Voice Mail C:+491618 -R:DE +R:_DEMF T:_DEMCM N:Deutschland Mobilfunk C-Netz A:C-Netz C:+491610,+491611,+491612,+491613,+491614,+491615,+491616,+491617,+491619 -R:DE +R:_DEMF T:_DEMC N:Deutschland Mobilfunk D1 A:D1 C:+49170,+49171,+49175 -R:DE +R:_DEMF T:_DEMD1 N:Deutschland Mobilfunk D2 A:D2 -C:+49172,+49173,+49174 # D2 -R:DE +C:+49172,+49173,+49174 +R:_DEMF T:_DEMD2 N:Deutschland Mobilfunk E1 A:E1, Eplus C:+49177,+49178 -R:DE +R:_DEMF T:_DEME1 -N:Deutschland Mobilfunk +N:Deutschland Mobilfunk E2 A:E2 C:+49176,+49179 -R:DE +R:_DEMF T:_DEME2 N:Deutschland Cityruf diff --git a/isdnlog/isdnlog/functions.c b/isdnlog/isdnlog/functions.c index 918d5ad3..d4e415ad 100644 --- a/isdnlog/isdnlog/functions.c +++ b/isdnlog/isdnlog/functions.c @@ -19,6 +19,12 @@ * along with this program; if not, write to the Free Software * * $Log$ + * Revision 1.27 1999/11/16 18:09:39 akool + * isdnlog-3.67 + * isdnlog-3.66 writes wrong provider number into it's logfile isdn.log + * there is a patch and a repair program available at + * http://www.toetsch.at/linux/i4l/i4l-3_66.htm + * * Revision 1.26 1999/11/12 20:50:49 akool * isdnlog-3.66 * - Patch from Jochen Erwied @@ -487,17 +493,20 @@ int print_msg(int Level, const char *fmt, ...) if (Level & message) { - if (!fout && (fcons == NULL)) { + /* no console, no outfile -> log to stderr */ + if ((fout==NULL) && (fcons == NULL)) { fputs(width ? s : String, stderr); fflush(stderr); } - else - if (fcons){ + + /* log to console */ + if (fcons != NULL) { fputs(width ? s : String, fcons); fflush(fcons); } /* else */ - if (fout) + /* log to file */ + if (fout != NULL) { fputs(width ? s : String, fout); fflush(fout); diff --git a/isdnlog/isdnrep/isdnbill.c b/isdnlog/isdnrep/isdnbill.c new file mode 100644 index 00000000..9fdca680 --- /dev/null +++ b/isdnlog/isdnrep/isdnbill.c @@ -0,0 +1,617 @@ +/* $Id$ + * + * ISDN accounting for isdn4linux. (Billing-module) + * + * Copyright 1995, 1999 by Andreas Kool (akool@isdn4linux.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 + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Revision 1.1 1995/09/23 16:44:19 akool + * Initial revision + * + */ + +#include "isdnlog.h" +#include "tools/zone.h" +#include +#include +#include +#include "dest.h" + +#include +#include +#include + + +#define CALLING 0 +#define CALLED 1 + +#define MAXMYMSN 10 + +#define FreeCall 0 +#define Ortszone 1 +#define CityCall 2 +#define RegioCall 3 +#define GermanCall 4 +#define SONDERRUFNUMMERN 5 +#define AUSLAND 6 +#define ELSEWHERE 7 +#define MAXZONE 8 + +#define SUBTOTAL 0 +#define TOTAL 1 + +#define COUNTRYLEN 20 +#define PROVLEN 20 + +typedef struct { + char num[2][64]; + double duration; + time_t connect; + int units; + int dialout; + int cause; + int ibytes; + int obytes; + char version[64]; + int si1; + int si2; + double currency_factor; + char currency[64]; + double pay; + int provider; + int zone; + + double compute; + double aktiv; +} CALLER; + +typedef struct { + char msn[10]; + int ncalls; + double pay; + double duration; + double compute; + double aktiv; +} MSNSUM; + +typedef struct { + int ncalls; + double pay; + double duration; + int failed; + double compute; + double aktiv; +} PROVSUM; + +typedef struct { + int ncalls; + double pay; + double duration; + double compute; + double aktiv; +} ZONESUM; + +static CALLER curcall; +static MSNSUM msnsum[2][MAXMYMSN]; +static PROVSUM provsum[2][MAXPROVIDER]; +static ZONESUM zonesum[2][MAXZONE]; +static char rstr[BUFSIZ]; + +static int nhome = 0; + +int verbose = 0; + + +int print_msg(int Level, const char *fmt, ...) +{ + auto va_list ap; + auto char String[BUFSIZ * 3]; + + + if ((Level > 1 && !verbose) || ((Level > 2) && (verbose < 2))) + return(1); + + va_start(ap, fmt); + (void)vsnprintf(String, BUFSIZ * 3, fmt, ap); + va_end(ap); + + fprintf((Level == PRT_NORMAL) ? stdout : stderr, "%s", String); + + return(0); +} /* print_msg */ + + +static int when(time_t connect, char *s) +{ + auto struct tm *tm = localtime(&connect); + + + sprintf(s, "%02d.%02d.%04d %02d:%02d:%02d", + tm->tm_mday, tm->tm_mon + 1, tm->tm_year + 1900, + tm->tm_hour, tm->tm_min, tm->tm_sec); + + return(tm->tm_mon + 1); +} /* when */ + + +static void deb(char *s) +{ + register char *p = strchr(s, 0); + + + while (*--p == ' ') + *p = 0; +} /* deb */ + + +char *timestr(double n) +{ + auto int x, h, m, s; +#if 0 + auto int d = 0; +#endif + + + if (n <= 0.0) + sprintf(rstr, " "); + else { + x = (int)n; + + h = (int)(x / 60 / 60); + x %= 60 * 60; + m = (int)(x / 60); + s = (int)(x % 60); + +#if 0 + if (h > 99) { + while (h > 99) { + h -= 24; + d++; + } /* while */ + + sprintf(rstr, "%d day(s), %2d:%02d:%02d", d, h, m, s); + } + else +#endif + sprintf(rstr, "%3d:%02d:%02d", h, m, s); + } /* else */ + + return(rstr); +} /* timestr */ + + +static void total(int w) +{ + register int i; + + + printf("------------------------------------------------------------------------------\n"); + + printf("\nMSN calls Duration Charge\n"); + printf("-----------------------------------\n"); + + for (i = 0; i < nhome; i++) { + if (msnsum[w][i].ncalls) + printf("%6s %5d %s DM %8.3f DM %8.3f\n", + msnsum[w][i].msn, + msnsum[w][i].ncalls, + timestr(msnsum[w][i].duration), + msnsum[w][i].pay, + msnsum[w][i].compute); + + if (w == SUBTOTAL) { + strcpy(msnsum[TOTAL][i].msn, msnsum[SUBTOTAL][i].msn); + msnsum[TOTAL][i].ncalls += msnsum[SUBTOTAL][i].ncalls; + msnsum[TOTAL][i].duration += msnsum[SUBTOTAL][i].duration; + msnsum[TOTAL][i].pay += msnsum[SUBTOTAL][i].pay; + msnsum[TOTAL][i].compute += msnsum[SUBTOTAL][i].compute; + + msnsum[SUBTOTAL][i].ncalls = 0; + msnsum[SUBTOTAL][i].duration = 0; + msnsum[SUBTOTAL][i].pay = 0; + msnsum[SUBTOTAL][i].compute = 0; + } /* if */ + } /* for */ + + + printf("\nProvider calls Duration Charge failures avail\n"); + printf("---------------------------------------------------------------------------\n"); + + for (i = 0; i < MAXPROVIDER; i++) { + if (provsum[w][i].ncalls) { + if (i < 100) + printf(" %s%02d", vbn, i); + else + printf("%s%03d", vbn, i - 100); + + printf(":%-24s", getProvider(pnum2prefix(i, 0))); + + printf("%5d %s DM %8.3f %8d %5.1f%% DM %8.3f\n", + provsum[w][i].ncalls, + timestr(provsum[w][i].duration), + provsum[w][i].pay, + provsum[w][i].failed, + 100.0 * (provsum[w][i].ncalls - provsum[w][i].failed) / provsum[w][i].ncalls, + provsum[w][i].compute); + + + if (w == SUBTOTAL) { + provsum[TOTAL][i].ncalls += provsum[SUBTOTAL][i].ncalls; + provsum[TOTAL][i].duration += provsum[SUBTOTAL][i].duration; + provsum[TOTAL][i].pay += provsum[SUBTOTAL][i].pay; + provsum[TOTAL][i].failed += provsum[SUBTOTAL][i].failed; + provsum[TOTAL][i].compute += provsum[SUBTOTAL][i].compute; + + provsum[SUBTOTAL][i].ncalls = 0; + provsum[SUBTOTAL][i].duration = 0; + provsum[SUBTOTAL][i].pay = 0; + provsum[SUBTOTAL][i].failed = 0; + provsum[SUBTOTAL][i].compute = 0; + } /* if */ + } /* if */ + } /* for */ + + + printf("\nZone calls Duration Charge\n"); + printf("-------------------------------------------\n"); + + for (i = 0; i < MAXZONE; i++) { + if (zonesum[w][i].ncalls) { + switch (i) { + case 0 : printf("FreeCall "); break; + case 1 : printf("Ortszone "); break; + case 2 : printf("CityCall (R20) "); break; + case 3 : printf("RegioCall (R50) "); break; + case 4 : printf("GermanCall "); break; + case 5 : printf("Sonderrufnummern"); break; + case 6 : printf("Ausland "); break; + case 7 : printf("elsewhere "); break; + } /* switch */ + + printf("%5d %s DM %8.3f DM %8.3f DM %8.3f DM %8.3f\n", + zonesum[w][i].ncalls, + timestr(zonesum[w][i].duration), + zonesum[w][i].pay, + zonesum[w][i].compute, + zonesum[w][i].aktiv, + zonesum[w][i].compute - zonesum[w][i].aktiv); + } /* if */ + + if (w == SUBTOTAL) { + zonesum[TOTAL][i].ncalls += zonesum[SUBTOTAL][i].ncalls; + zonesum[TOTAL][i].duration += zonesum[SUBTOTAL][i].duration; + zonesum[TOTAL][i].pay += zonesum[SUBTOTAL][i].pay; + zonesum[TOTAL][i].compute += zonesum[SUBTOTAL][i].compute; + zonesum[TOTAL][i].aktiv += zonesum[SUBTOTAL][i].aktiv; + + zonesum[SUBTOTAL][i].ncalls = 0; + zonesum[SUBTOTAL][i].duration = 0; + zonesum[SUBTOTAL][i].pay = 0; + zonesum[SUBTOTAL][i].compute = 0; + zonesum[SUBTOTAL][i].aktiv = 0; + } /* if */ + } /* for */ + + printf("\n\n"); +} /* total */ + + +static void justify(char *fromnum, int dialout, TELNUM number) +{ + auto char s[BUFSIZ], sx[BUFSIZ]; + + + if (*number.msn) + sprintf(sx, "%s/%s", number.area, number.msn); + else + strcpy(sx, number.area); + + if (*number.country && strcmp(number.country, mycountry)) + sprintf(s, "%s %s", number.country, sx); + else + sprintf(s, "%s%s", (*number.country ? "0" : ""), sx); + + printf("%6s %s %-14s", fromnum, (dialout ? "->" : "<-"), s); + + *s = 0; + + if (getSpecial(curcall.num[CALLED])) + sprintf(s, "%s", getSpecialName(curcall.num[CALLED])); + else { + if (*number.country && strcmp(number.country, mycountry)) + sprintf(s, "%s", number.scountry); + + if (*number.sarea) { + if (*s) + strcat(s, ", "); + + strcat(s, number.sarea); + } /* if */ + + if (!*s) + sprintf(s, "??? UNKNOWN AREA"); + } /* else */ + + s[COUNTRYLEN] = 0; /* clipping */ + + printf("%-*s", COUNTRYLEN, s); +} /* justify */ + + +int main(int argc, char *argv[], char *envp[]) +{ + register char *pl, *pr, *p; + auto FILE *f = fopen("/tmp/i", "r"); + auto char s[BUFSIZ], sx[BUFSIZ], home[BUFSIZ]; + auto int z, i, l, col, homei, month = -1; + auto TELNUM number[2]; + auto double dur; + auto RATE Rate; + auto char *version; + + + if (f != (FILE *)NULL) { + + *home = 0; + + vbn = strdup("010"); + vbnlen = strdup("2:3"); + + mymsns = 3; + mycountry = "+49"; + myarea = "6171"; + preselect = 33; + + initHoliday("/usr/lib/isdn/holiday-de.dat", &version); + + initDest("/usr/lib/isdn/dest.gdbm", &version); + + initRate("/etc/isdn/rate.conf", "/usr/lib/isdn/rate-de.dat", "/usr/lib/isdn/zone-de-%s.gdbm", &version); + + memset(&msnsum, 0, sizeof(msnsum)); + memset(&provsum, 0, sizeof(provsum)); + memset(&zonesum, 0, sizeof(zonesum)); + + while (fgets(s, BUFSIZ, f)) { + pl = s; + col = 0; + + memset(&curcall, 0, sizeof(curcall)); + + while ((pr = strchr(pl, '|'))) { + memcpy(sx, pl, (l = (pr - pl))); + sx[l] = 0; + pl = pr + 1; + + switch (col++) { + case 0 : break; + + case 1 : deb(sx); + strcpy(curcall.num[CALLING], sx); + break; + + case 2 : deb(sx); + strcpy(curcall.num[CALLED], sx); + break; + + case 3 : dur = atoi(sx); break; + + case 4 : curcall.duration = atol(sx) / HZ; + + if (abs((int)dur - (int)curcall.duration) > 1) + curcall.duration = dur; + break; + + case 5 : curcall.connect = atol(sx); break; + case 6 : curcall.units = atoi(sx); break; + case 7 : curcall.dialout = *sx == 'O'; break; + case 8 : curcall.cause = atoi(sx); break; + case 9 : curcall.ibytes = atoi(sx); break; + case 10 : curcall.obytes = atoi(sx); break; + case 11 : strcpy(curcall.version, sx); break; + case 12 : curcall.si1 = atoi(sx); break; + case 13 : curcall.si2 = atoi(sx); break; + case 14 : curcall.currency_factor = atof(sx); break; + case 15 : strcpy(curcall.currency, sx); break; + case 16 : curcall.pay = atof(sx); break; + case 17 : curcall.provider = atoi(sx); break; + case 18 : break; + } /* switch */ + + } /* while */ + + /* Repair wrong entries from older isdnlog-versions ... */ + + if (!curcall.provider || (curcall.provider == UNKNOWN)) + curcall.provider = preselect; + + if (curcall.dialout && !getSpecial(curcall.num[CALLED])) { + sprintf(s, "0%s", curcall.num[CALLED] + 3); + + if (getSpecial(s)) + strcpy(curcall.num[CALLED], s); + } /* if */ + + if (!curcall.dialout && !getSpecial(curcall.num[CALLING])) { + sprintf(s, "0%s", curcall.num[CALLING] + 3); + + if (getSpecial(s)) + strcpy(curcall.num[CALLING], s); + } /* if */ + + /* if (curcall.dialout) */ + /* if (curcall.duration) */ + /* if (curcall.provider != UNKNOWN) */ + + if (*curcall.num[CALLING] && *curcall.num[CALLED]) { + + i = when(curcall.connect, s); + + if (month == -1) + month = i; + else if (i != month) { + total(SUBTOTAL); + month = i; + } /* if */ + + printf("%s%s ", s, timestr(curcall.duration)); + + normalizeNumber(curcall.num[CALLING], &number[CALLING], TN_ALL); + normalizeNumber(curcall.num[CALLED], &number[CALLED], TN_ALL); + + if (curcall.dialout) { + justify(number[CALLING].msn, curcall.dialout, number[CALLED]); + + p = strstr(home, number[CALLING].msn); + + if (p == NULL) { + strcat(home, number[CALLING].msn); + strcat(home, "|"); + + p = strstr(home, number[CALLING].msn); + homei = (int)(p - home) / 7; + + strcpy(msnsum[SUBTOTAL][homei].msn, number[CALLING].msn); + nhome++; + } /* if */ + + homei = (int)(p - home) / 7; + msnsum[SUBTOTAL][homei].ncalls++; + provsum[SUBTOTAL][curcall.provider].ncalls++; + + if (curcall.provider < 100) + printf(" %s%02d", vbn, curcall.provider); + else + printf("%s%03d", vbn, curcall.provider - 100); + + strcpy(s, getProvider(pnum2prefix(curcall.provider, 0))); + s[PROVLEN] = 0; + printf(":%-*s ", PROVLEN, s); + + + if (!curcall.duration) { + printf(" %s\n", qmsg(TYPE_CAUSE, VERSION_EDSS1, curcall.cause)); + + if ((curcall.cause == 0x22) || /* No circuit/channel available */ + (curcall.cause == 0x2a) || /* Switching equipment congestion */ + (curcall.cause == 0x2f)) /* Resource unavailable, unspecified */ + provsum[SUBTOTAL][curcall.provider].failed++; + + continue; + } /* if */ + + printf("%8.3f ", curcall.pay); + + + clearRate(&Rate); + Rate.start = curcall.connect; + Rate.now = curcall.connect + curcall.duration; + Rate.prefix = pnum2prefix(curcall.provider, 0); + + Rate.src[0] = number[CALLING].country; + Rate.src[1] = number[CALLING].area; + Rate.src[2] = number[CALLING].msn; + + Rate.dst[0] = number[CALLED].country; + Rate.dst[1] = number[CALLED].area; + Rate.dst[2] = number[CALLED].msn; + + if (getRate(&Rate, &version) != UNKNOWN) { + z = Rate.z; + + if (!z && (*number[CALLED].country && strcmp(number[CALLED].country, mycountry))) + z = AUSLAND; + else if (getSpecial(curcall.num[CALLED])) + z = SONDERRUFNUMMERN; + else if (z == UNKNOWN) { + printf(" ??? UNKNOWN ZONE!"); + z = ELSEWHERE; + } /* if */ + + zonesum[SUBTOTAL][z].ncalls++; + + if (fabs(curcall.pay - Rate.Charge) > 0.01) { + printf("%8.3f DIFF=%8.3f", Rate.Charge, Rate.Charge - curcall.pay); + ; + } /* if */ + + curcall.compute = Rate.Charge; + } + else { + z = MAXZONE - 1; + curcall.compute = curcall.pay; + printf(" ??? %s", version); + } /* else */ + + if (!z) + printf(" !!!z=0"); + + if ((z == 1) || (z == 2)) { + auto struct tm *tm = localtime(&curcall.connect); + auto int takte; + + + if ((tm->tm_wday > 0) && (tm->tm_wday < 5)) { /* Wochentag */ + if ((tm->tm_hour > 8) && (tm->tm_hour < 18)) { /* Hauptzeit */ + takte = (curcall.duration + 59) / 60; + curcall.aktiv = takte * 0.06; + } + else { + takte = (curcall.duration + 59) / 60; + curcall.aktiv = takte * 0.03; + } /* else */ + } + else { /* Wochenende */ + takte = (curcall.duration + 59) / 60; + curcall.aktiv = takte * 0.03; + } /* else */ + + printf("AKTIVPLUS:%8.3f, gespart: %8.3f", curcall.aktiv, curcall.pay - curcall.aktiv); + + msnsum[SUBTOTAL][homei].aktiv += curcall.aktiv; + provsum[SUBTOTAL][curcall.provider].aktiv += curcall.aktiv; + zonesum[SUBTOTAL][z].aktiv += curcall.aktiv; + } /* if */ + + msnsum[SUBTOTAL][homei].pay += curcall.pay; + msnsum[SUBTOTAL][homei].duration += curcall.duration; + msnsum[SUBTOTAL][homei].compute += curcall.compute; + + provsum[SUBTOTAL][curcall.provider].pay += curcall.pay; + provsum[SUBTOTAL][curcall.provider].duration += curcall.duration; + provsum[SUBTOTAL][curcall.provider].compute += curcall.compute; + + zonesum[SUBTOTAL][z].pay += curcall.pay; + zonesum[SUBTOTAL][z].duration += curcall.duration; + zonesum[SUBTOTAL][z].compute += curcall.compute; + } + else { /* Dialin: */ + justify(number[CALLED].msn, curcall.dialout, number[CALLING]); + } /* else */ + + printf("\n"); + + } /* if */ + } /* while */ + + fclose(f); + total(SUBTOTAL); + total(TOTAL); + + } /* if */ + + return(0); +} /* isdnbill */ diff --git a/isdnlog/rate-de.dat b/isdnlog/rate-de.dat index f9c2f2ae..865b22b9 100644 --- a/isdnlog/rate-de.dat +++ b/isdnlog/rate-de.dat @@ -1,4 +1,4 @@ -V:1.10-Germany [15-Nov-1999 20:29:56] +V:1.10-Germany [25-Nov-1999 23:50:28] # Währungsformat U:%.3f DM @@ -173,16 +173,22 @@ U:%.3f DM # # # Sonderrufnummern: -S:Internet zzgl. Grundgebuehr -N:0191999 # UUnet classic -N:01910 # T-Online SLIP -N:0191011 # T-Online PPP -N:01914 # AOL -N:019161 # AOL +S:Auftrags- und Ansagedienst +N:01141 + +# Internetzugaenge zzgl. Grundgebuehr +S:UUnet classic +N:0191999 +S:T-Online SLIP +N:01910 +S:T-Online +N:0191011 +S:AOL +N:01914, 019161 S:Internet by call N:0191501, 01929, 01924924, 0192340, 0192343, 0192070, 0192340, 0191501, 01924924 -N:019251 +N:019251, 01928120 S:T-VoteCall N:01371, 01372, 01373, 01374, 0138 @@ -205,56 +211,74 @@ N:01680, 01681, 01696, 01699 S:Skyper N:01692, 01693, 016953 +S:C-Netz +N:01610*, 01611*, 01612*, 01613*, 01614*, 01615*, 01616*, 01617*, 01619* + +S:T-C-Tel Voice Mail +N:01618* + +S:D1 +N:0170*, 0171*, 0175* + +S:D2 +N:0172*, 0173*, 0174* + +S:Eplus +N:0177*, 0178* + +S:E2 +N:0176*, 0179* + S:Shared Cost Service 01801 -N:01801 +N:01801* S:Shared Cost Service 01802 -N:01802 +N:01802* S:Shared Cost Service 01803 -N:01803 +N:01803* S:Shared Cost Service 01804 -N:01804 +N:01804* S:Shared Cost Service 01805 -N:01805 +N:01805* S:Service 01901 -N:01901 +N:01901* S:Service 01902 -N:01902 +N:01902* S:Service 01903 -N:01903 +N:01903* S:Service 01904 -N:01904 +N:01904* S:Service 01905 -N:01905 +N:01905* S:Service 01906 -N:01906 +N:01906* S:Service 01907 -N:01907 +N:01907* S:Service 01908 -N:01908 +N:01908* S:Service 01909 -N:01909 +N:01909* S:Expo 2000 Hotline N:02000 S:Persönliche Rufnummer -N:0700 +N:0700* S:freecall -N:0130, 0800 +N:0130*, 0800* S:Polizei / Notruf N:110 @@ -273,6 +297,8 @@ N:11871 # Mannesmann Arcor N:11880 # Telegate N:11890 # Telegate +S:Weckruf +N:0190600000 # Virtual Interactive Phone GmbH, VIP Wecker (0,81 Pf/min) ##################################################################### # # @@ -285,6 +311,7 @@ C:GmbH, Gutleutstra P:11 o.tel.o CbC B:01011 # G:01-Aug-1999 +D:dtag C:Mannesmann Zwölfte Verwaltungsgesellschaft mbH, Mannesmannufer 2, 40213 Düsseldorf C:Homepage: http://www.o-tel-o.de C:Hotline: 01803/1998 oder 0800/7370 (Geschaeftskunden) @@ -1504,7 +1531,7 @@ C:Internetz GmbH, S ##################################################################### # # -P:13,1 Tele 2 Privatkunden +P:13 Tele 2 Privatkunden B:01013 C:Telecommunications Services GmbH, Düsseldorf C:Homepage: http://www.tele2.de @@ -1579,7 +1606,7 @@ A:QA,BT,MN,NP,IR,TM,AZ A:GE,KG,UZ T:*/*=2.44/60 ##################################################################### -P:13,2 Tele 2 Geschaeftskunden +P:13,1 Tele 2 Geschaeftskunden B:01013 C:Telecommunications Services GmbH, Düsseldorf C:Homepage: http://www.tele2.de @@ -12440,7 +12467,7 @@ T:*/*=2.3084(60)/1 P:51 01051 B:01051 C:ID-Switch GmbH, Graf-Adolf-Straße, 40210 Düsseldorf 01051 -# G:14-Oct-1999 +# G:18-Nov-1999 C:Homepage: http://www.01051.com C:Adresse: Koenigsallee 60f C: 40210 Duesseldorf @@ -12449,7 +12476,13 @@ Z:2-4 Ferngespr A:DE T:*/*=0.09/60 Z:10 Mobilfunk -A:_DEMCM,_DEMC,_DEMD1,_DEMD2,_DEME1,_DEME2 +# A:C-Tel Voice Mail, C-Netz, D1, D2, E1, E2 +A:+491610,+491611,+491612,+491613,+491614,+491615,+491616,+491617,+491619 +A:+491618 +A:+49170,+49171,+49175 +A:+49172,+49173,+49174 +A:+49177,+49178 +A:+49176,+49179 T:*/*=0.40/60 Z:40 Telefonauskunft Inland (Austria, dial 01051004366211811) A:+4366211811 @@ -12459,7 +12492,7 @@ A:+4366211812 T:*/*=0.18/60 Z:200 Albanien A:AL -T:*/*=0.55/60 +T:*/*=0.53/60 Z:201 Argentinien A:AR T:*/*=0.67/60 @@ -12471,7 +12504,7 @@ A:BE T:*/*=0.16/60 Z:204 Bosnien A:BA -T:*/*=0.62/60 +T:*/*=0.58/60 Z:205 Brasilien A:BR T:*/*=0.47/60 @@ -12498,10 +12531,10 @@ A:HK T:*/*=0.19/60 Z:213 Italien A:IT -T:*/*=0.23/60 +T:*/*=0.21/60 Z:214 Irland A:IE -T:*/*=0.21/60 +T:*/*=0.19/60 Z:215 Island A:IS T:*/*=0.27/60 @@ -12513,13 +12546,13 @@ A:JP T:*/*=0.24/60 Z:218 Jugoslawien A:YU -T:*/*=0.62/60 +T:*/*=0.57/60 Z:219 Kanada A:CA T:*/*=0.15/60 Z:220 Kroatien A:HR -T:*/*=0.57/60 +T:*/*=0.55/60 Z:222 Liechtenstein A:LI T:*/*=0.28/60 @@ -12555,7 +12588,7 @@ A:PT T:*/*=0.37/60 Z:233 Rumänien A:RO -T:*/*=0.65/60 +T:*/*=0.63/60 Z:234 Schweden A:SE T:*/*=0.17/60 @@ -12592,7 +12625,10 @@ T:*/*=0.66/60 Z:245 St. Petersburg A:LED T:*/*=0.35/60 -Z:246 impossible +Z:246 Polen +A:PL +T:*/*=0.38/60 +Z:247 impossible A:_ARMF A:_AUMF A:_BEMF @@ -13204,7 +13240,7 @@ C:Telecommunications Ltd. 01069 # P:70,1 Arcor CbC B:01070 -# G:01-Oct-1999 +# G:01-Dec-1999 C:Mannesmann Arcor C:Mannesmann AG & Co., Kölner Str. 12, 65760 Eschborn 01070 D:dtag @@ -13605,7 +13641,7 @@ C:Telecom GmbH, Beethovenstra # P:75 Callino B:01075 -# G:18-Oct-99 +# G:15-Nov-99 C:ARCIS Media Com Management GmbH, Maximilianstr. 14, 80539 München 01075 D:dtag Z:1-4 Fern @@ -14913,9 +14949,8 @@ B:01080 # G:01-Aug-1999 D:dtag C:Aktiengesellschaft für telefonische Informationsdienste, Bahnhofstraße 26, 82211 Herrsching 01080 -# Bislang kann dieses Angebot nur in den folgenden Städten genutzt werden: -# Hamburg, Berlin, Hannover, Düsseldorf, Frankfurt/Main, Nürnberg, -# Stuttgart, München +# Bislang kann dieses Angebot nicht im Vorwahlgebiet 02 (NRW) +# genutzt werden. Z:1-4 Inlandsverbindungen A:+49 T:W/09-17=0.089/60 @@ -15905,9 +15940,12 @@ C:AG, Milit ##################################################################### # # -P:150 Drillisch +P:150 Drillisch Superregionen +# Dieser Tarif gilt nur in den City-Zonen der Städte +# Essen, Frankfurt/Main, Hamburg, Hannover, Köln, Leipzig, Mannheim, +# Nürnberg, Stuttgart! B:010050 -# G:01-Oct-1999 +# G:05-Nov-1999 D:dtag C:AG, Horbeller Straße 33, 50858 Köln 010050 Z:1-4 Deutschland @@ -15928,6 +15966,29 @@ A:+49176,+49179 T:W/08-21=0.69/60 T:W/21-08=0.59/60 ##################################################################### +P:150,1 Drillisch +B:010050 +# G:05-Nov-1999 +D:dtag +C:AG, Horbeller Straße 33, 50858 Köln 010050 +Z:1-4 Deutschland +A:+49 +T:W/08-21=0.119/60 +T:W/21-22=0.0695/60 +T:W/22-06=0.0595/60 +T:W/06-08=0.0695/60 +T:E/06-22=0.119/60 +T:E/22-06=0.0595/60 +Z:10 Mobilfunk +A:+491618 +A:+491610,+491611,+491612,+491613,+491614,+491615,+491616,+491617,+491619 +A:+49170,+49171,+49175 +A:+49172,+49173,+49174 +A:+49177,+49178 +A:+49176,+49179 +T:W/08-21=0.69/60 +T:W/21-08=0.59/60 +##################################################################### P:154 Osnatel B:010054 C:Osnatel GmbH, Luisenstraße 16, 49074 Osnabrück diff --git a/isdnlog/rate-de.dat.src b/isdnlog/rate-de.dat.src index ddd450f8..d9c5784b 100644 --- a/isdnlog/rate-de.dat.src +++ b/isdnlog/rate-de.dat.src @@ -1,4 +1,4 @@ -V:1.10-Germany [15-Nov-1999 20:29:56] +V:1.10-Germany [25-Nov-1999 23:50:28] # Währungsformat U:%.3f DM @@ -173,16 +173,22 @@ U:%.3f DM # # # Sonderrufnummern: -S:Internet zzgl. Grundgebuehr -N:0191999 # UUnet classic -N:01910 # T-Online SLIP -N:0191011 # T-Online PPP -N:01914 # AOL -N:019161 # AOL +S:Auftrags- und Ansagedienst +N:01141 + +# Internetzugaenge zzgl. Grundgebuehr +S:UUnet classic +N:0191999 +S:T-Online SLIP +N:01910 +S:T-Online +N:0191011 +S:AOL +N:01914, 019161 S:Internet by call N:0191501, 01929, 01924924, 0192340, 0192343, 0192070, 0192340, 0191501, 01924924 -N:019251 +N:019251, 01928120 S:T-VoteCall N:01371, 01372, 01373, 01374, 0138 @@ -205,56 +211,74 @@ N:01680, 01681, 01696, 01699 S:Skyper N:01692, 01693, 016953 +S:C-Netz +N:01610*, 01611*, 01612*, 01613*, 01614*, 01615*, 01616*, 01617*, 01619* + +S:T-C-Tel Voice Mail +N:01618* + +S:D1 +N:0170*, 0171*, 0175* + +S:D2 +N:0172*, 0173*, 0174* + +S:Eplus +N:0177*, 0178* + +S:E2 +N:0176*, 0179* + S:Shared Cost Service 01801 -N:01801 +N:01801* S:Shared Cost Service 01802 -N:01802 +N:01802* S:Shared Cost Service 01803 -N:01803 +N:01803* S:Shared Cost Service 01804 -N:01804 +N:01804* S:Shared Cost Service 01805 -N:01805 +N:01805* S:Service 01901 -N:01901 +N:01901* S:Service 01902 -N:01902 +N:01902* S:Service 01903 -N:01903 +N:01903* S:Service 01904 -N:01904 +N:01904* S:Service 01905 -N:01905 +N:01905* S:Service 01906 -N:01906 +N:01906* S:Service 01907 -N:01907 +N:01907* S:Service 01908 -N:01908 +N:01908* S:Service 01909 -N:01909 +N:01909* S:Expo 2000 Hotline N:02000 S:Persönliche Rufnummer -N:0700 +N:0700* S:freecall -N:0130, 0800 +N:0130*, 0800* S:Polizei / Notruf N:110 @@ -273,6 +297,8 @@ N:11871 # Mannesmann Arcor N:11880 # Telegate N:11890 # Telegate +S:Weckruf +N:0190600000 # Virtual Interactive Phone GmbH, VIP Wecker (0,81 Pf/min) ##################################################################### # # @@ -285,6 +311,7 @@ C:GmbH, Gutleutstra P:11 o.tel.o CbC B:01011 # G:01-Aug-1999 +D:dtag C:Mannesmann Zwölfte Verwaltungsgesellschaft mbH, Mannesmannufer 2, 40213 Düsseldorf C:Homepage: http://www.o-tel-o.de C:Hotline: 01803/1998 oder 0800/7370 (Geschaeftskunden) @@ -1504,7 +1531,7 @@ C:Internetz GmbH, S ##################################################################### # # -P:13,1 Tele 2 Privatkunden +P:13 Tele 2 Privatkunden B:01013 C:Telecommunications Services GmbH, Düsseldorf C:Homepage: http://www.tele2.de @@ -1579,7 +1606,7 @@ A:Katar, Bhutan, Mongolei, Nepal, Iran, Turkmenistan, Aserbaidschan A:Georgien, Kirgisistan, Usbekistan T:*/*=2.44/60 ##################################################################### -P:13,2 Tele 2 Geschaeftskunden +P:13,1 Tele 2 Geschaeftskunden B:01013 C:Telecommunications Services GmbH, Düsseldorf C:Homepage: http://www.tele2.de @@ -12440,7 +12467,7 @@ T:*/*=2.3084(60)/1 P:51 01051 B:01051 C:ID-Switch GmbH, Graf-Adolf-Straße, 40210 Düsseldorf 01051 -# G:14-Oct-1999 +# G:18-Nov-1999 C:Homepage: http://www.01051.com C:Adresse: Koenigsallee 60f C: 40210 Duesseldorf @@ -12449,7 +12476,13 @@ Z:2-4 Ferngespr A:Deutschland T:*/*=0.09/60 Z:10 Mobilfunk -A:C-Tel Voice Mail, C-Netz, D1, D2, E1, E2 +# A:C-Tel Voice Mail, C-Netz, D1, D2, E1, E2 +A:+491610,+491611,+491612,+491613,+491614,+491615,+491616,+491617,+491619 # C +A:+491618 # T-C-Tel Voice Mail +A:+49170,+49171,+49175 # D1 +A:+49172,+49173,+49174 # D2 +A:+49177,+49178 # Eplus +A:+49176,+49179 # E2 T:*/*=0.40/60 Z:40 Telefonauskunft Inland (Austria, dial 01051004366211811) A:+4366211811 @@ -12459,7 +12492,7 @@ A:+4366211812 T:*/*=0.18/60 Z:200 Albanien A:Albanien -T:*/*=0.55/60 +T:*/*=0.53/60 Z:201 Argentinien A:Argentinien T:*/*=0.67/60 @@ -12471,7 +12504,7 @@ A:Belgien T:*/*=0.16/60 Z:204 Bosnien A:Bosnien -T:*/*=0.62/60 +T:*/*=0.58/60 Z:205 Brasilien A:Brasilien T:*/*=0.47/60 @@ -12498,10 +12531,10 @@ A:Hongkong T:*/*=0.19/60 Z:213 Italien A:Italien -T:*/*=0.23/60 +T:*/*=0.21/60 Z:214 Irland A:Irland -T:*/*=0.21/60 +T:*/*=0.19/60 Z:215 Island A:Island T:*/*=0.27/60 @@ -12513,13 +12546,13 @@ A:Japan T:*/*=0.24/60 Z:218 Jugoslawien A:Jugoslawien -T:*/*=0.62/60 +T:*/*=0.57/60 Z:219 Kanada A:Kanada T:*/*=0.15/60 Z:220 Kroatien A:Kroatien -T:*/*=0.57/60 +T:*/*=0.55/60 Z:222 Liechtenstein A:Liechtenstein T:*/*=0.28/60 @@ -12555,7 +12588,7 @@ A:Portugal T:*/*=0.37/60 Z:233 Rumänien A:Rumänien -T:*/*=0.65/60 +T:*/*=0.63/60 Z:234 Schweden A:Schweden T:*/*=0.17/60 @@ -12592,7 +12625,10 @@ T:*/*=0.66/60 Z:245 St. Petersburg A:St. Petersburg T:*/*=0.35/60 -Z:246 impossible +Z:246 Polen +A:Polen +T:*/*=0.38/60 +Z:247 impossible A:Argentinien Mobilfunk A:Australien Mobilfunk A:Belgien Mobilfunk @@ -13204,7 +13240,7 @@ C:Telecommunications Ltd. 01069 # P:70,1 Arcor CbC B:01070 -# G:01-Oct-1999 +# G:01-Dec-1999 C:Mannesmann Arcor C:Mannesmann AG & Co., Kölner Str. 12, 65760 Eschborn 01070 D:dtag @@ -13605,7 +13641,7 @@ C:Telecom GmbH, Beethovenstra # P:75 Callino B:01075 -# G:18-Oct-99 +# G:15-Nov-99 C:ARCIS Media Com Management GmbH, Maximilianstr. 14, 80539 München 01075 D:dtag Z:1-4 Fern @@ -14913,9 +14949,8 @@ B:01080 # G:01-Aug-1999 D:dtag C:Aktiengesellschaft für telefonische Informationsdienste, Bahnhofstraße 26, 82211 Herrsching 01080 -# Bislang kann dieses Angebot nur in den folgenden Städten genutzt werden: -# Hamburg, Berlin, Hannover, Düsseldorf, Frankfurt/Main, Nürnberg, -# Stuttgart, München +# Bislang kann dieses Angebot nicht im Vorwahlgebiet 02 (NRW) +# genutzt werden. Z:1-4 Inlandsverbindungen A:+49 T:W/09-17=0.089/60 @@ -15905,9 +15940,12 @@ C:AG, Milit ##################################################################### # # -P:150 Drillisch +P:150 Drillisch Superregionen +# Dieser Tarif gilt nur in den City-Zonen der Städte +# Essen, Frankfurt/Main, Hamburg, Hannover, Köln, Leipzig, Mannheim, +# Nürnberg, Stuttgart! B:010050 -# G:01-Oct-1999 +# G:05-Nov-1999 D:dtag C:AG, Horbeller Straße 33, 50858 Köln 010050 Z:1-4 Deutschland @@ -15928,6 +15966,29 @@ A:+49176,+49179 # E2 T:W/08-21=0.69/60 T:W/21-08=0.59/60 ##################################################################### +P:150,1 Drillisch +B:010050 +# G:05-Nov-1999 +D:dtag +C:AG, Horbeller Straße 33, 50858 Köln 010050 +Z:1-4 Deutschland +A:+49 +T:W/08-21=0.119/60 +T:W/21-22=0.0695/60 +T:W/22-06=0.0595/60 +T:W/06-08=0.0695/60 +T:E/06-22=0.119/60 +T:E/22-06=0.0595/60 +Z:10 Mobilfunk +A:+491618 # T-C-Tel Voice Mail +A:+491610,+491611,+491612,+491613,+491614,+491615,+491616,+491617,+491619 # C +A:+49170,+49171,+49175 # D1 +A:+49172,+49173,+49174 # D2 +A:+49177,+49178 # Eplus +A:+49176,+49179 # E2 +T:W/08-21=0.69/60 +T:W/21-08=0.59/60 +##################################################################### P:154 Osnatel B:010054 C:Osnatel GmbH, Luisenstraße 16, 49074 Osnabrück diff --git a/isdnlog/tools/dest.c b/isdnlog/tools/dest.c index 81f8ba98..1c8e961e 100644 --- a/isdnlog/tools/dest.c +++ b/isdnlog/tools/dest.c @@ -73,7 +73,7 @@ static _DB db; /* our dest.db */ static int init_ok=0; typedef struct { - char number[TN_MAX_NUM_LEN]; + char number[TN_MAX_NUM_LEN]; TELNUM num; int lru; } num_cache_t; @@ -96,11 +96,11 @@ static void add_cache(char *number, TELNUM *num) { mlru=num_cache[i].lru; } } - if(i==CACHE_SIZE) { + if(i==CACHE_SIZE) { Strncpy(num_cache[m].number, number, TN_MAX_NUM_LEN); memcpy(&num_cache[m].num, num, sizeof(TELNUM)); num_cache[m].lru=1; - } + } } static int get_cache(char *number, TELNUM *num) { @@ -113,13 +113,13 @@ static int get_cache(char *number, TELNUM *num) { num_cache[i].lru++; memcpy((char*)num+offsetof(TELNUM,scountry), (char*)&num_cache[i].num+offsetof(TELNUM,scountry), - sizeof(TELNUM)-offsetof(TELNUM,scountry)); + sizeof(TELNUM)-offsetof(TELNUM,scountry)); return true; } - } + } return false; -} - +} + static void warning(char *fmt,...) { va_list ap; @@ -152,7 +152,7 @@ int initDest(char *path, char **msg) if (init_ok == 1) return 0; else if(init_ok == -1) - return -1; + return -1; if (!path || !*path) { if (msg) snprintf(message, LENGTH, @@ -183,7 +183,7 @@ int initDest(char *path, char **msg) if (*dbv == 'G') free(value.dptr); - init_ok = 1; + init_ok = 1; return 0; } @@ -195,7 +195,7 @@ static void append(char *dest, char *what) if(*dest) Strncat(dest, "/", TN_MAX_SAREA_LEN); Strncat(dest, what, TN_MAX_SAREA_LEN); - } + } } static bool isKey(const char *p) @@ -222,7 +222,7 @@ int getDest(char *onumber, TELNUM * num) char dummy[100]; /* V2.7.2.3 kills stack */ char tld[4]; char dummy2[100]; /* V2.7.2.3 kills stack */ - + #ifdef DEBUG printf("getD. %s\n", number); #endif @@ -233,7 +233,7 @@ int getDest(char *onumber, TELNUM * num) printf("getD (cache). %s %s\n", number, formatNumber("%f",num)); #endif free(number); - return 0; + return 0; } len = strlen(number); if (len==2 && isalpha(*number) && isupper(*number)) @@ -241,9 +241,9 @@ int getDest(char *onumber, TELNUM * num) if (isdigit(*number)) { warning("getDest called with local number '%s'", number); - add_cache(number, num); + add_cache(number, num); return UNKNOWN; - } + } countrylen = arealen = prefixlen = 0; num->ncountry = 0; num->narea = 0; @@ -261,13 +261,13 @@ again: value = FETCH(db, key); again2: if (value.dptr != 0) { -/* we have a value: - * it could be - * :RKEY ... pointer to a KEY +/* we have a value: + * it could be + * :RKEY ... pointer to a KEY * :city ... pointer to a city - * name;code ... top level entry i.e country - * name;codes[;:KEY] ... region - * [#len];code;:KEY ... city + * name;code ... top level entry i.e country + * name;codes[;:KEY] ... region + * [#len];code;:KEY ... city */ while (value.dptr && *value.dptr == ':') { /* check for city, i.e. lowercase chars */ @@ -280,7 +280,7 @@ again2: else { append(num->keys, value.dptr + 1); Strncpy(tld,value.dptr+1,3); - } + } key.dptr = value.dptr + 1; key.dsize = value.dsize - 2; /* w/o : and \x0 */ nvalue = FETCH(db, key); @@ -327,12 +327,12 @@ again2: Strncpy(num->area, q, TN_MAX_AREA_LEN); } } - else { + else { if (arealen == 0) { /* we take the orig number */ arealen = strlen(number); Strncpy(num->area, number, TN_MAX_AREA_LEN); } - } + } if (strstr(num->area, q)) /* only if new number has same prefix */ countrylen = strlen(q); /* last one must be country */ } @@ -357,7 +357,7 @@ again2: num->narea = atoi(num->area); if (*onumber == '+' && strlen(onumber) > arealen + countrylen) Strncpy(num->msn, onumber + arealen + countrylen, TN_MAX_MSN_LEN); - add_cache(onumber, num); + add_cache(onumber, num); } } else if (p && *p == ':') { @@ -384,8 +384,8 @@ again2: number[--len] = '\0'; goto again; /* I like it */ } - free(number); - free(tld); + if (number) + free(number); if (city) free(city); return UNKNOWN; @@ -432,7 +432,7 @@ int main(int argc, char *argv[]) while (--argc) { res = getDest(argv[i++], &num); printf("%s %s(%d)=%s %s(%s) %s - %s\n", - res == 0 ? "Ok." : "Err", num.country, num.ncountry, num.scountry, + res == 0 ? "Ok." : "Err", num.country, num.ncountry, num.scountry, num.sarea, num.area, num.msn, num.keys); } diff --git a/isdnlog/tools/rate.c b/isdnlog/tools/rate.c index 21076a81..778bf9f7 100644 --- a/isdnlog/tools/rate.c +++ b/isdnlog/tools/rate.c @@ -19,6 +19,12 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log$ + * Revision 1.61 1999/11/16 18:09:39 akool + * isdnlog-3.67 + * isdnlog-3.66 writes wrong provider number into it's logfile isdn.log + * there is a patch and a repair program available at + * http://www.toetsch.at/linux/i4l/i4l-3_66.htm + * * Revision 1.60 1999/11/12 20:50:50 akool * isdnlog-3.66 * - Patch from Jochen Erwied @@ -1665,6 +1671,7 @@ int getRate(RATE *Rate, char **msg) Rate->_zone=Provider[prefix].Area[Rate->_area].Zone; if (Rate->domestic && *(Rate->dst[0])) { int z=getZone(prefix, Rate->src[1], Rate->dst[1]); + Rate->z = z; if (z!=UNKNOWN) { for (i=0; i

Niederlande