isdnlog Version 3.18

- countries-at.dat added
- spelling corrections in "countries-de.dat" and "countries-us.dat"
- LCR-function of isdnconf now accepts a duration (isdnconf -c .,duration)
- "rate-at.dat" and "rate-de.dat" extended/fixed
- holiday.c and rate.c fixed (many thanks to reinelt@eunet.at)
This commit is contained in:
Andreas Kool 1999-04-19 19:25:36 +00:00
parent 19a0d04235
commit 4ce76f394f
14 changed files with 4018 additions and 1484 deletions

View File

@ -19,6 +19,13 @@
## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
##
## $Log$
## Revision 1.70 1999/04/17 14:10:36 akool
## isdnlog Version 3.17
##
## - LCR functions of "isdnconf" fixed
## - HINT's fixed
## - rate-de.dat: replaced "1-5" with "W" and "6-7" with "E"
##
## Revision 1.69 1999/04/16 14:39:07 akool
## isdnlog Version 3.16
##
@ -558,7 +565,7 @@ SERVICEFILE = /etc/services
# DON'T EDIT BELOW THIS LINE
######################################################################
VERSION = 3.17
VERSION = 3.18
MANPAGES = isdnlog/callerid.conf.5 isdnlog/isdn.conf.5 \
isdnlog/isdnformat.5 isdnlog/isdnlog.5 isdnlog/isdnlog.8 \

View File

@ -14,6 +14,8 @@ Vorschlaege von ak realisieren
- ACHTUNG: die glibc definiert BUFSIZ mit 8192 !! (an welchen Stellen
bin ich unbewuát von 512 Byte ausgegangen?
- OVERLOAD reaktivieren
- bekannte Probleme mit der Tarif-Datenbank:
- die erste Minute kostenlos, wenn Gespraechsdauer < 1 Minute

64
isdnlog/countries-at.dat Normal file
View File

@ -0,0 +1,64 @@
002697 Mayotte
00373 Moldau
00508 St. Pierre und Miquelon
00670 Saipan
007 Russische Föderation
007 Rußland
0073 Kasachstan
0074 Tadschikistan
0044 Großbritannien
0044 Nordirland
00381 Jugoslawien
00381 Serbien
00381 Montenegro
00298 Färöer-Inseln
00672 Antarktis
006724 Kokosinseln
006724 Weihnachtsinseln
0086 China
00267 Botsuana
00225 Cote d'Ivoire
0082 Südkorea
00850 Nordkorea
006723 Norfolk-Inseln
0095 Myanmar
00886 Taiwan
00967 Jemen
00248 Seychellen
001 Kanada
001 Alaska
0035191 Madeira
0034928 Kanarische Inseln
001808 Hawaii
00396 Vatikan
0035192 Azoren
0035195 Azoren
0035196 Azoren
00225 Elfenbeinküste
006998 Midway-Inseln
006993 Wake-Inseln
00690 Tokelau
00681 Wallis- und Futuna-Inseln
00246 Diego Garcia
00375 Weißrußland
001 Canada
001 United States of America
0067210 Davis
0067211 Mawson
0067212 Casey
0067213 Macquarrie Island
006722 Cocos Island
006723 Norfolk Island
006724 Christmas Island
0082 South Korea
0085 North Korea
0073 Kazakhstan
00996 Kyrgyzstan
007 Tajikistan
00998 Uzbekistan
00993 Turkmenistan
0064 New Zealand
00235 Chad
005399 Guantanamo
00808 Wake Island
00649 Pitcairn Islands

View File

@ -16,7 +16,7 @@
001787 Puerto Rico
001809 Dominikanische Republik # Turks und Caicos Turks- und Caicos-Inseln
001868 Trinidad und Tobago
001869 Saint Kitts and Nevis
001869 Saint Kitts und Nevis
001876 Jamaika
0020 Ägypten
00212 Marokko

View File

@ -4,6 +4,7 @@
001264 Anguilla
001268 Antigua & Barbuda
001284 British Virgin Isles
001340 American Virgin Isles
001345 Cayman Islands
001441 Bermuda
001473 Grenada
@ -18,7 +19,7 @@
001869 St. Kitts & Nevis
001876 Jamaica
0020 Egypt
00212 Morocco
00212 Marocco
00213 Algeria
00216 Tunesia
00218 Libya
@ -53,7 +54,7 @@
00248 Seychelles Islands
00249 Sudan
00250 Rwanda
00251 Ethopia
00251 Ethiopia
00252 Somalia
00253 Djibouti
00254 Kenya
@ -85,7 +86,7 @@
0034 Spain
00350 Gibraltar
00351 Portugal
00352 Luxemburg
00352 Luxembourg
00353 Ireland
00354 Iceland
00355 Albania
@ -108,7 +109,7 @@
00381 Yugoslavia (Servia & Montenegro)
00385 Croatia
00386 Slovenia
00387 Bosnia and Herzegovina
00387 Bosnia and Hercegovina
00389 Macedonia
0039 Italy
00396 Vatican City
@ -144,7 +145,7 @@
0057 Colombia
0058 Venezuela
00590 Guadaloupe
00591 Boliva
00591 Bolivia
00592 Guyana
00593 Ecuador
00594 French Guyana

View File

@ -20,6 +20,13 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log$
* Revision 1.21 1999/04/17 14:10:56 akool
* isdnlog Version 3.17
*
* - LCR functions of "isdnconf" fixed
* - HINT's fixed
* - rate-de.dat: replaced "1-5" with "W" and "6-7" with "E"
*
* Revision 1.20 1999/04/15 19:14:29 akool
* isdnlog Version 3.15
*
@ -631,13 +638,12 @@ static int compare(const SORT *s1, const SORT *s2)
} /* compare */
static void showLCR()
static void showLCR(int duration)
{
auto int tz, hour, provider, lastprovider = UNKNOWN, lasthour = UNKNOWN, *p;
auto int useds = 0, maxhour, leastprovider = UNKNOWN;
auto int ignoreprovider = UNKNOWN;
auto RATE Rate;
auto int duration = 181;
auto int probe[] = { REGIOCALL, GERMANCALL, D2_NETZ, 0 };
auto int used[MAXPROVIDER];
auto int hours[MAXPROVIDER];
@ -645,7 +651,7 @@ static void showLCR()
auto time_t werktag, wochenende;
print_msg(PRT_NORMAL, "Least-Cost-Routing-Table:\n\n");
print_msg(PRT_NORMAL, "Least-Cost-Routing-Table [Verbindungsdauer:%d Sekunden]:\n\n", duration);
time(&werktag);
tm = localtime(&werktag);
@ -947,7 +953,7 @@ int main(int argc, char *argv[], char *envp[])
initRate("/etc/isdn/rate.conf", "/usr/lib/isdn/rate-de.dat", NULL);
currency = strdup("DEM");
if ((strlen(areacode) < 3) || (ptr = get_areacode(areacode,&len,quiet?C_NO_ERROR|C_NO_WARN:0)) != NULL)
if ((*areacode == '.') || (ptr = get_areacode(areacode,&len,quiet?C_NO_ERROR|C_NO_WARN:0)) != NULL)
{
if (!isdnmon)
{
@ -963,10 +969,10 @@ int main(int argc, char *argv[], char *envp[])
if (strlen(areacode) > 1) {
zone = atoi(areacode + 1);
ptr = "";
}
}
else {
showLCR();
exit(0);
showLCR(duration);
exit(0);
} /* else */
}
else {

View File

@ -19,6 +19,30 @@
* along with this program; if not, write to the Free Software
*
* $Log$
* Revision 1.21 1999/04/10 16:35:22 akool
* isdnlog Version 3.13
*
* WARNING: This is pre-ALPHA-dont-ever-use-Code!
* "tarif.dat" (aka "rate-xx.dat"): the next generation!
*
* You have to do the following to test this version:
* cp /usr/src/isdn4k-utils/isdnlog/holiday-de.dat /etc/isdn
* cp /usr/src/isdn4k-utils/isdnlog/rate-de.dat /usr/lib/isdn
* cp /usr/src/isdn4k-utils/isdnlog/samples/rate.conf.de /etc/isdn/rate.conf
*
* After that, add the following entries to your "/etc/isdn/isdn.conf" or
* "/etc/isdn/callerid.conf" file:
*
* [ISDNLOG]
* SPECIALNUMBERS = /usr/lib/isdn/sonderrufnummern.dat
* HOLIDAYS = /usr/lib/isdn/holiday-de.dat
* RATEFILE = /usr/lib/isdn/rate-de.dat
* RATECONF = /etc/isdn/rate.conf
*
* Please replace any "de" with your country code ("at", "ch", "nl")
*
* Good luck (Andreas Kool and Michael Reinelt)
*
* Revision 1.20 1999/03/25 19:39:48 akool
* - isdnlog Version 3.11
* - make isdnlog compile with egcs 1.1.7 (Bug report from Christophe Zwecker <doc@zwecker.com>)
@ -461,6 +485,7 @@ void info(int chan, int reason, int state, char *msg)
static int lstate = 0, lchan = -1;
#if 0
if (!newline) {
if (state == STATE_BYTE) {
@ -486,6 +511,22 @@ void info(int chan, int reason, int state, char *msg)
lstate = state;
lchan = chan;
} /* if */
#else
if (!newline) {
left = "";
right = "\r";
if ((lchan != chan) || (lstate != state) || (state != STATE_BYTE))
left = "\n";
lstate = state;
lchan = chan;
}
else {
left = "";
right = "\n";
} /* else */
#endif
if (allflags & PRT_DEBUG_GENERAL)
if (allflags & PRT_DEBUG_INFO)

View File

@ -19,6 +19,13 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log$
* Revision 1.54 1999/04/17 14:11:08 akool
* isdnlog Version 3.17
*
* - LCR functions of "isdnconf" fixed
* - HINT's fixed
* - rate-de.dat: replaced "1-5" with "W" and "6-7" with "E"
*
* Revision 1.53 1999/04/15 19:14:38 akool
* isdnlog Version 3.15
*
@ -4928,8 +4935,10 @@ doppelt:break;
auto char s[BUFSIZ];
memset(&Rate, 0, sizeof(Rate));
Rate.zone = call[chan].zone;
Rate.start = Rate.now = cur_time;
Rate.now = Rate.start + 181;
Rate.Charge = 1e9; /* should be enough */
if (getLeastCost(&Rate, call[chan].provider) != UNKNOWN) {
@ -5256,7 +5265,7 @@ static void teardown(int chan)
addlist(chan, SETUP, 2);
sprintf(sx, "HANGUP (%s)", qmsg(TYPE_CAUSE, VERSION_EDSS1, call[chan].cause));
sprintf(sx, "HANGUP (Timeout)" /*, qmsg(TYPE_CAUSE, VERSION_EDSS1, call[chan].cause) */);
info(chan, PRT_SHOWHANGUP, STATE_HANGUP, sx);
if (sound)

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,10 @@
V:1.0-Germany [17-Apr-1999]
V:1.0-Germany [19-Apr-1999]
# Diese Tariftabelle ist ein Service der I4L-Tarifdatenbank-Crew.
# Alle Angaben erfolgen ohne Gewähr
#
# (C) Copyright 1999 by Andreas Kool (akool@isdn4linux.de)
#
# Zonenvergabe:
#
# 0 : Verbindungen an der eigenen Tk-Anlage (zwangsläufig kostenlos)
@ -232,8 +237,8 @@ A:+297 # Aruba
A:+299 # Grönland
A:+374 # Armenien
A:+396 # Vatikanstadt
A:+44 # Insel Man (Großbritannien)
A:+44 # Kanalinseln (Großbritannien)
# FIXME A:+44 # Insel Man (Großbritannien)
# FIXME A:+44 # Kanalinseln (Großbritannien)
A:+500 # Falklandinseln
A:+501 # Belize
A:+502 # Guatemala
@ -286,7 +291,7 @@ A:+689 # Franz
A:+691 # Mikronesien
A:+692 # Marshallinseln
A:+7 # Kasachstan
A:+7 # Tadschikistan
# FIXME A:+7 # Tadschikistan
A:+84 # Vietnam
A:+850 # Korea (Demokratische Republik)
A:+853 # Macao
@ -335,6 +340,11 @@ T:W/21-08=0.07/60
T:E,H/08-21=0.14/60
T:E,H/21-08=0.07/60
Z:5-10 Mobilnetze
A:01610,01617,01619,01618 # C
A:0170,0171 # D1
A:0172,0173 # D2
A:0177,0178 # Eplus
A:0176,0179 # E2
T:W/08-21=0.69/60
T:W/21-08=0.49/60
T:E,H/*=0.49/60
@ -394,8 +404,42 @@ Z:20 Internet
A:01929 # (Benutzername: mobilcom; Passwort: mobilcom)
T:*/*=0.05/60 FreeNet
#####################################################################
P:20 ISIS
C:Multimedia Net GmbH, Kaistraße 6, 40221 Düsseldorf 01020
P:20 ISIS isiFON classic
C:ISIS Multimedia Net GmbH, Kaistraße 6, 40221 Düsseldorf 01020
G:01.04.1999
C:Homepage: http://www.isis.de
C:Telefon: 0800/809 0100
C:Telefax: 0211/85 27 610
C:Faxabruf: 0800/809 0111
Z:1 isiFON-zu-isiFON
T:W/09-18=0.1044/300
T:W/18-09=0.1044/600
T:E,H/*=0.1044/600
Z:2 lokal
T:W/09-18=0.1044/120
T:W/18-09=0.1044/240
T:E,H/*=0.1044/240
Z:3 Regio
T:W/09-18=0.1044/30
T:W/18-09=0.1044/60
T:E,H/*=0.1044/60
Z:4 Distanz
T:W/09-18=0.1044/15
T:W/18-09=0.1044/30
T:E,H/*=0.1044/15
Z:5-10 Mobilfunk
A:01610,01617,01619,01618 # C
A:0170,0171 # D1
A:0172,0173 # D2
A:0177,0178 # Eplus
A:0176,0179 # E2
T:W/09-18=0.1044/8
T:W/18-09=0.1044/12
T:E,H/*=0.1044/12
Z:20 isiFONLINE
T:W/09-18=0.1044/300
T:W/18-09=0.1044/600
T:E,H/*=0.1044/300
#####################################################################
P:21 QS
C:Communication Service GmbH, Oberländer Ufer 180-182, 50968 Köln 01021
@ -440,6 +484,11 @@ T:W/18-21=0.09(60)/1
T:W/21-07=0.06(60)/1
T:E,H/*=0.09(60)/1
Z:5-10 C/D/E-Netz
A:01610,01617,01619,01618 # C
A:0170,0171 # D1
A:0172,0173 # D2
A:0177,0178 # Eplus
A:0176,0179 # E2
T:*/*=0.48(60)/1
#####################################################################
P:31 HEAG
@ -644,14 +693,9 @@ T:W/21-06=0.06/60
T:E,H/06-21=0.095/60
T:E,H/21-06=0.06/60
Z:5-7,10 D1,C,E2-Netz
A:0170
A:0171
A:01610
A:01617
A:01619
A:01618
A:0176
A:0179
A:0170,0171 # D1
A:01610,01617,01619,01618 # C
A:0176,0179 # E2
T:W/09-18=0.96/60 Hauptzeit
T:W/18-09=0.48/60 Nebenzeit
T:E,H/*=0.48/60 Freizeit
@ -661,8 +705,7 @@ T:W/09-18=0.94/60 Hauptzeit
T:W/18-09=0.46/60 Nebenzeit
T:E,H/*=0.46/60 Freizeit
Z:9 E-Plus
A:0177
A:0178
A:0177,0178
T:W/09-18=1.25/60 Hauptzeit
T:W/18-09=0.56/60 Nebenzeit
T:E,H/*=0.56/60 Freizeit
@ -681,7 +724,7 @@ T:*/*=0.46/60
Z:12 Euro Plus
A:+298 # Färöer
A:+30 # Griechenland
A:+353 # Irland
# FIXME A:+353 # Irland
A:+354 # Island
A:+36 # Ungarn
A:+376 # Andorra
@ -693,8 +736,8 @@ A:+4175 # Liechtenstein
A:+420 # Tschechien
A:+421 # Slowakei
A:+44 # Großbritannien und Nordirland
A:+44 # Insel Man (Großbritannien)
A:+44 # Kanalinseln (Großbritannien)
# FIXME A:+44 # Insel Man (Großbritannien)
# FIXME A:+44 # Kanalinseln (Großbritannien)
A:+45 # Dänemark
A:+46 # Schweden
A:+47 # Norwegen
@ -728,7 +771,7 @@ A:+972 # Israel
T:*/*=0.96/60
Z:14 Nordamerika
A:+1 # Kanada
A:+1 # Vereinigte Staaten (USA)
# FIXME A:+1 # Vereinigte Staaten (USA)
T:*/*=0.48/60
Z:15 Asien / Pazifik
A:+61 # Australien
@ -748,7 +791,7 @@ A:+56 # Chile
A:+57 # Kolumbien
A:+599 # Niederländische Antillen
A:+63 # Philippinen
A:+7 # Kasachstan
# FIXME A:+7 # Kasachstan
A:+886 # China (Taiwan)
A:+961 # Libanon
A:+962 # Jordanien
@ -765,7 +808,6 @@ A:+1268 # Antigua und Barbuda
A:+1284 # Britische Jungferninseln
A:+1340 # Amerikanische Jungferninseln
A:+1345 # Caymaninseln
A:+1345 # Kaimaninseln
A:+1441 # Bermuda
A:+1473 # Grenada
A:+1649 # Turks- und Caicos-Inseln
@ -783,7 +825,6 @@ A:+222 # Mauretanien
A:+223 # Mali
A:+224 # Guinea
A:+225 # Cote d'Ivoire (Elfenbeinküste)
A:+225 # Elfenbeinküste (Cote d'Ivoire)
A:+226 # Burkina Faso (Obervolta)
A:+227 # Niger
A:+228 # Togo
@ -820,20 +861,19 @@ A:+260 # Sambia
A:+261 # Madagaskar
A:+262 # Reunion
A:+263 # Simbabwe
A:+263 # Zimbabwe
A:+264 # Namibia
A:+265 # Malawi
A:+266 # Lesotho
A:+267 # Botsuana (Botswana)
A:+268 # Swasiland
A:+269 # Komoren
A:+269 # Mayotte
# FIXME A:+269 # Mayotte
A:+290 # Saint Helena
A:+291 # Eritrea
A:+297 # Aruba
A:+299 # Grönland
A:+374 # Armenien
A:+375 # Weißrußland (Belarus)
# FIXME A:+375 # Weißrußland (Belarus)
A:+500 # Falklandinseln
A:+501 # Belize
A:+502 # Guatemala
@ -886,7 +926,7 @@ A:+688 # Tuvalu
A:+689 # Französisch-Polynesien
A:+691 # Mikronesien
A:+692 # Marshallinseln
A:+7 # Tadschikistan
# FIXME A:+7 # Tadschikistan
A:+84 # Vietnam
A:+850 # Korea (Demokratische Republik)
A:+853 # Macao
@ -898,8 +938,8 @@ A:+872 # Pazifischer Ozean
A:+873 # Indischer Ozean
A:+874 # Atlantischer Ozean (West)
A:+880 # Bangladesch
A:+886 # Taiwan
A:+90 # Zypern (Nordzypern)
# FIXME A:+886 # Taiwan
# FIXME A:+90 # Zypern (Nordzypern)
A:+91 # Indien
A:+92 # Pakistan
A:+93 # Afghanistan
@ -1042,7 +1082,7 @@ A:+41 # Schweiz
T:*/08-20=0.279(60)/1
T:*/20-08=0.259(60)/1
Z:15
A:+1 # Kanada
# FIXME A:+1 # Kanada
A:+47 # Norwegen
T:*/08-20=0.289(60)/1
T:*/20-08=0.269(60)/1
@ -1225,8 +1265,7 @@ T:*/08-20=0.649(60)/1
T:*/20-08=0.629(60)/1
Z:44
A:+298 # Färöer
A:+670 # Marianen
A:+670 # Saipan
A:+670 # Marianen and Saipan
T:*/08-20=0.659(60)/1
T:*/20-08=0.639(60)/1
Z:45
@ -1391,8 +1430,7 @@ A:+2696 # Mayotte
T:*/08-20=0.949(60)/1
T:*/20-08=0.929(60)/1
Z:73
A:+1869 # Nevis Islands
A:+1869 # St Kitts
A:+1869 # Nevis Islands and St Kitts
T:*/08-20=0.959(60)/1
T:*/20-08=0.939(60)/1
Z:74
@ -1751,7 +1789,12 @@ Z:2-4 Fern
T:W/09-18=0.08/30,0.16(60)/1 Standard
T:W/18-09=0.045/30,0.09(60)/1 Spar
T:E/*=0.045/30,0.09(60)/1 Nacht
Z:6-10 Deutschland GSM
Z:5-10 Deutschland GSM
A:01610,01617,01619,01618 # C
A:0170,0171 # D1
A:0172,0173 # D2
A:0177,0178 # Eplus
A:0176,0179 # E2
T:W/09-18=0.365/30,0.73(60)/1 Standard
T:W/18-09=0.18/30,0.36(60)/1 Spar
T:E/*=0.18/30,0.36(60)/1 Spar

View File

@ -19,6 +19,12 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log$
* Revision 1.6 1999/04/16 14:39:58 akool
* isdnlog Version 3.16
*
* - more syntax checks for "rate-xx.dat"
* - isdnrep fixed
*
* Revision 1.5 1999/04/14 13:17:15 akool
* isdnlog Version 3.14
*
@ -103,6 +109,7 @@
#include <stdarg.h>
#include <time.h>
#include <unistd.h>
#include <errno.h>
extern const char *basename (const char *name);
#else
#include "isdnlog.h"
@ -111,7 +118,7 @@ extern const char *basename (const char *name);
#include "holiday.h"
#define SOMEDAY (1<<MONDAY | 1<<THUESDAY | 1<<WEDNESDAY | 1<<THURSDAY | 1<<FRIDAY | 1<<SATURDAY | 1<<SUNDAY)
#define SOMEDAY (1<<MONDAY | 1<<TUESDAY | 1<<WEDNESDAY | 1<<THURSDAY | 1<<FRIDAY | 1<<SATURDAY | 1<<SUNDAY)
#define LENGTH 120 /* max length of lines in data file */
#define COUNT(array) sizeof(array)/sizeof(array[0])
@ -390,7 +397,11 @@ int isDay(struct tm *tm, bitfield mask, char **name)
return WORKDAY;
}
if (mask & SOMEDAY) {
if (mask & (1<<EVERYDAY)) {
return day;
}
if (mask & (1<<day)) {
sprintf (buffer, "%s", Weekday[day]);
return day;
}

View File

@ -19,6 +19,13 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log$
* Revision 1.4 1999/04/14 13:17:21 akool
* isdnlog Version 3.14
*
* - "make install" now install's "rate-xx.dat", "rate.conf" and "ausland.dat"
* - "holiday-xx.dat" Version 1.1
* - many rate fixes (Thanks again to Michael Reinelt <reinelt@eunet.at>)
*
* Revision 1.3 1999/04/10 16:36:35 akool
* isdnlog Version 3.13
*
@ -68,7 +75,7 @@
#define _HOLIDAY_H_
#define MONDAY 1
#define THUESDAY 2
#define TUESDAY 2
#define WEDNESDAY 3
#define THURSDAY 4
#define FRIDAY 5

File diff suppressed because it is too large Load Diff

View File

@ -19,6 +19,12 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log$
* Revision 1.7 1999/04/16 14:40:03 akool
* isdnlog Version 3.16
*
* - more syntax checks for "rate-xx.dat"
* - isdnrep fixed
*
* Revision 1.6 1999/04/15 19:15:17 akool
* isdnlog Version 3.15
*
@ -242,7 +248,7 @@ static int strmatch (const char *pattern, const char *string)
{
int length=0;
while (*pattern) {
if (*pattern!=*string || !*string)
if ((*pattern!=*string && *pattern!='?') || !*string)
return 0;
pattern++;
string++;
@ -336,13 +342,13 @@ int initRate(char *conf, char *dat, char **msg)
variant[i]=UNKNOWN;
}
line=0;
if (conf && *conf) {
if ((stream=fopen(conf,"r"))==NULL) {
if (msg) snprintf (message, LENGTH, "Error: could not load rate configuration from %s: %s",
conf, strerror(errno));
return -1;
} else {
}
line=0;
while ((s=fgets(buffer,LENGTH,stream))!=NULL) {
line++;
if (*(s=strip(s))=='\0')
@ -391,7 +397,6 @@ int initRate(char *conf, char *dat, char **msg)
}
fclose (stream);
}
}
if (!dat || !*dat) {
if (msg) snprintf (message, LENGTH, "Warning: no rate database specified!",
@ -419,8 +424,8 @@ int initRate(char *conf, char *dat, char **msg)
switch (*s) {
case 'P': /* P:nn[,v] Bezeichnung */
ignore = 0;
v = UNKNOWN;
ignore = 1;
empty(&zones);
s+=2; while (isblank(*s)) s++;
@ -440,18 +445,14 @@ int initRate(char *conf, char *dat, char **msg)
warning (dat, "Invalid variant '%c'", *s);
continue;
}
if ((v=strtol(s, &s ,10))<1) {
warning (dat, "Invalid variant %d", v);
continue;
v=strtol(s, &s, 10);
}
}
#if 0 /* Fixme: is this correct? */
if ((variant[prefix]!=UNKNOWN) && (v!=UNKNOWN) && (variant[prefix]!=v)) {
#else
if (variant[prefix]!=v) {
#endif
/* Fixme: is this correct? */
/* if ((variant[prefix]!=UNKNOWN) && (v!=UNKNOWN) && (variant[prefix]!=v)) { */
if (variant[prefix]==v) {
ignore = 0;
} else {
v = UNKNOWN;
ignore = 1;
continue;
}
if (prefix>=nProvider) {