diff --git a/isdnlog/tools/isdnrate.c b/isdnlog/tools/isdnrate.c index e9600d66..fc8b0225 100644 --- a/isdnlog/tools/isdnrate.c +++ b/isdnlog/tools/isdnrate.c @@ -1,4 +1,4 @@ -/* $Id: isdnrate.c,v 1.40 2003/09/04 19:45:07 tobiasb Exp $ +/* $Id: isdnrate.c,v 1.41 2004/01/10 16:43:24 tobiasb Exp $ * ISDN accounting for isdn4linux. (rate evaluation) * @@ -19,6 +19,10 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: isdnrate.c,v $ + * Revision 1.41 2004/01/10 16:43:24 tobiasb + * New options -c and -i for overriding the RATECONF and RATEFILE setting + * in isdn.conf. May be useful for rate-file testing. + * * Revision 1.40 2003/09/04 19:45:07 tobiasb * New option for isdnrate: `-rvNN' requires a vbn starting with NN. * Suggested by Thomas Richter on isdn4linux mailinglist, for reference see @@ -315,7 +319,7 @@ static void print_header(void); static char *myname, *myshortname; -static char options[] = "ab:d:f:h:l:op:r:st:v::x:CD::G:HLNP:O:S:TUVX::Z"; +static char options[] = "ab:c:d:f:h:i:l:op:r:st:v::x:CD::G:HLNP:O:S:TUVX::Z"; static char usage[] = "%s: usage: %s [ -%s ] Destination ...\n"; static int header = 0, best = MAXPROVIDER, table = 0, explain = 0; @@ -339,6 +343,8 @@ static int all = 0; static int booked = 0; static int service = 0; static char *require_vbn = NULL; +static char *opt_rateconf = 0; +static char *opt_ratefile = 0; #define SOCKNAME "/tmp/isdnrate" static int is_daemon = 0; @@ -413,7 +419,8 @@ static void init() if (verbose && *version) print_msg(PRT_V, "%s\n", version); - initRate(rateconf, ratefile, zonefile, message); + initRate(opt_rateconf?opt_rateconf:rateconf, + opt_ratefile?opt_ratefile:ratefile, zonefile, message); if (verbose && *version) print_msg(PRT_V, "%s\n", version); @@ -500,7 +507,8 @@ static int opts(int argc, char *argv[]) best = strtol(optarg, NIL, 0); break; -/* case 'c': country */ + case 'c': + opt_rateconf = optarg; break; case 'd': @@ -544,6 +552,10 @@ static int opts(int argc, char *argv[]) min = 0; break; + case 'i': + opt_ratefile = optarg; + break; + case 'l': duration = strtol(optarg, NIL, 0); /* l wie lt */ break; @@ -697,6 +709,12 @@ static int opts(int argc, char *argv[]) is_daemon = 0; print_msg(PRT_V, "Conflicting options, -D disabled\n"); } + if (is_client && opt_rateconf) { + print_msg(PRT_V, "Conflicting options, -c ignored in client mode (-C)\n"); + } + if (is_client && opt_ratefile) { + print_msg(PRT_V, "Conflicting options, -i ignored in client mode (-C)\n"); + } if (list && table) { table = 0; print_msg(PRT_V, "Conflicting options, -T disabled\n"); @@ -1788,9 +1806,11 @@ int main(int argc, char *argv[], char *envp[]) print_msg(PRT_A, "\n"); print_msg(PRT_A, "\t-a \tall=show old and newer rates (default actual only)\n", MAXPROVIDER); print_msg(PRT_A, "\t-b best\tshow only the first provider(s) (default %d)\n", MAXPROVIDER); + print_msg(PRT_A, "\t-c file\tuse as rate.conf\n"); print_msg(PRT_A, "\t-d d[.m[.y]] | {W|N|E}\tstart date of call (default now)\n"); print_msg(PRT_A, "\t-f areacode\tyou are calling from \n"); print_msg(PRT_A, "\t-h h[:m[:s]]\tstart time of call (default now)\n"); + print_msg(PRT_A, "\t-i file\tuse as ratefile (rate-CC.dat)\n"); print_msg(PRT_A, "\t-l duration\tduration of call in seconds (default %d seconds)\n", LCR_DURATION); print_msg(PRT_A, "\t-o \t show only booked providers\n"); print_msg(PRT_A, "\t-p prov|B[,prov...]\t show only these providers\n"); diff --git a/isdnlog/tools/isdnrate.man b/isdnlog/tools/isdnrate.man index 6c0399bb..07796373 100644 --- a/isdnlog/tools/isdnrate.man +++ b/isdnlog/tools/isdnrate.man @@ -1,4 +1,4 @@ -.\" CHECKIN $Date: 2003/10/29 17:41:35 $ +.\" CHECKIN $Date: 2004/01/10 16:43:24 $ .TH ISDNRATE 1 "@MANDATE@" -lt- .SH NAME isdnrate \- Print telefon rates and various info from rate\-files(5). @@ -60,6 +60,10 @@ Note also, spaces in country- or service names may be given as underscores. .BI \-b best Print only \fIbest\fP providers. Default is all. .P +.BI \-c rateconf +Use \fIrateconf\fP as provider selection file and ignore setting in +.IR isdn.conf . +.P .BI \-d day Calc rates for \fIday\fP. \fIday\fP can be one of .IP @@ -92,6 +96,11 @@ Time .IR hh [ :mm [ :ss ]] of call. Default is now. .P +.BI \-i ratefile +Use \fIratefile\fP (usually rate-CC.dat) as source for telephone fees and +ignore setting in +.IR isdn.conf . +.P .BI \-l len Length of call in second. Default value is 153 secs. .P