Do not ignore last provider in ratefile if it contains only redirs (R:)

and no real zones (Z:).
Check whether the resulting zone from getZone is covered by a redir.
Describe current limitations of redirs in rate-files manpage.
This commit is contained in:
Tobias Becker 2004-01-11 15:16:11 +00:00
parent 94477b1b05
commit 717696fd94
2 changed files with 49 additions and 6 deletions

View File

@ -210,7 +210,16 @@ may be missing then all zones from the start zone are used.
e.g.
.br
R:1,1 ; 1-4,6, 10-
.P
There some limitations:
.br
The reference cannot be more exact than the referenced providerzones.
R:42,0;1 will not work as desired if P:42,0 defines Z:1-4.
.br
It is not possible to reference a providerzone without areas when the
default domestic zone (with your countrycode as area) is not included
in the same range of referenced zones. This applies mainly to zones for
different distances in the national fixed network, e.g. Z:1-3 in Germany.
.P
.B r:prov, sub ; start_zone-
.P

View File

@ -21,6 +21,37 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log$
* Revision 1.86 2003/10/29 17:41:35 tobiasb
* isdnlog-4.67:
* - Enhancements for isdnrep:
* - New option -r for recomputing the connection fees with the rates
* from the current (and for a different or the cheapest provider).
* - Revised output format of summaries at end of report.
* - New format parameters %j, %v, and %V.
* - 2 new input formats for -t option.
* - Fix for dualmode workaround 0x100 to ensure that incoming calls
* will not become outgoing calls if a CALL_PROCEEDING message with
* an B channel confirmation is sent by a terminal prior to CONNECT.
* - Fixed and enhanced t: Tag handling in pp_rate.
* - Fixed typo in interface description of tools/rate.c
* - Fixed typo in tools/isdnrate.man, found by Paul Slootman.
* - Minor update to sample isdn.conf files:
* - Default isdnrep format shows numbers with 16 chars (+ & 15 digits).
* - New isdnrep format (-FNIO) without display of transfered bytes.
* - EUR as currency in Austria, may clash with outdated rate-at.dat.
* The number left of the currency symbol is nowadays insignificant.
* - Changes checked in earlier but after step to isdnlog-4.66:
* - New option for isdnrate: `-rvNN' requires a vbn starting with NN.
* - Do not compute the zone with empty strings (areacodes) as input.
* - New ratefile tags r: und t: which need an enhanced pp_rate.
* For a tag description see rate-files(5).
* - Some new and a few updated international cellphone destinations.
*
* NOTE: If there any questions, problems, or problems regarding isdnlog,
* feel free to join the isdn4linux mailinglist, see
* https://www.isdn4linux.de/mailman/listinfo/isdn4linux for details,
* or send a mail in English or German to <tobiasb@isdn4linux.de>.
*
* Revision 1.85 2002/07/25 18:16:06 akool
* isdnlog-2.60:
* - new provider "01081" (1,5 EuroCent/minute)
@ -1561,6 +1592,7 @@ again:
break;
case 'P': /* P:\[daterange\]nn[,v] Bezeichnung */
/* the "end of provider" code below also occurs after the input loop */
if (zone!=UNKNOWN) {
Provider[prefix].Zone[zone].Domestic = (where & DOMESTIC) == DOMESTIC;
line--;
@ -2138,13 +2170,9 @@ again:
if (Provider[prefix].Zone[zone].nHour==0)
if (zone) /* AK:17Dec99 Zone=0 is per definition free of charge */
whimper (dat, "Zone %d has no 'T:' Entries", zone);
#if 0 /* AK:31Dec1999 - Sorry, Leo ... Millenium-Release! Michi: Hier wird _Bloedsinn_ gemeldet!! */
if (!(where & FEDERAL))
whimper (dat, "Provider %s has no default domestic zone #2 (missing 'A:%s')", epnum(prefix), mycountry);
#endif
line++;
}
else if(nProvider) { /* silently ignore empty providers */
else if(nProvider && !Provider[prefix].nRedir) { /* silently ignore empty providers */
free_provider(prefix);
nProvider--;
}
@ -2295,6 +2323,10 @@ static int get_area1(int prefix, RATE *Rate, char *number, TELNUM *num,
for (a=0; a<Provider[prefix].nArea; a++) {
if (Provider[prefix].Area[a].Zone < rz->start_zone)
continue;
/* The next condition causes an error when the redir contains only
* zone numbers as returned by getZone but not the default domestic
* zone number with the area A:+CC, e.g. R:58,0;1 will not work
* with P:58,0 /../ Z:1 /../ Z:2-4 // A:+49 */
if (Provider[prefix].Area[a].Zone > rz->end_zone)
break;
if (isdigit(*Provider[prefix].Area[a].Code) ||
@ -2335,6 +2367,7 @@ static int get_area1(int prefix, RATE *Rate, char *number, TELNUM *num,
}
}
/* Provider[prefix].Area[Rate->_area] is valid or get_area1 was left above */
if (Rate->_zone==UNKNOWN) {
Rate->_zone=Provider[prefix].Area[Rate->_area].Zone;
if (Rate->domestic && *(Rate->dst[0])) {
@ -2343,7 +2376,8 @@ static int get_area1(int prefix, RATE *Rate, char *number, TELNUM *num,
if (z!=UNKNOWN) {
for (i=0; i<Provider[prefix].nZone; i++) {
for (j=0; j<Provider[prefix].Zone[i].nNumber; j++) {
if (Provider[prefix].Zone[i].Number[j]==z) {
if (Provider[prefix].Zone[i].Number[j]==z &&
i >= rz->start_zone && i <= rz->end_zone) {
Rate->_zone=i;
goto done;
}