RAStimer Log the uptime and cost of a dialout port This version is free, it does what I want, but I am considering producing a slicker version if there is demand for it. It will probably be shareware. If you like this version send me a postcard (address at the end), or email me at jpsc@acm.org. I will add you to a mailing list and inform you of any developments. Let me know any bugs you find, and what what features you would like to see in the next version. Please report bugs to rastimer@jpsc.compulink.co.uk How to use RAStimer: Put the .EXE somewhere on your path. If you want to see how many outgoing connections you have, just type RASTIMER with no parameters. To debug a RAS connection type RASTIMER DEBUG, the program will wait for a connection and then show you the progress of all negociations. To start monitoring, type RASTIMER pkStart cpStart pkTelco cpTelco weTelco minTelco pkIP cpIP weIP currency where: pkStart is the hour of the day when peak charging starts cpStart is the hour of the day when cheap charging starts pkTelco is peak telephone charge rate in pence (or cents) per minute cpTelco is cheap telephone charge rate weTelco is weekend telephone charge rate minTelco is the mimimum telephone call charge (in pence) pkIP is the peak Internet service providers charge rate cpIP cheap ISP rate weIP weekend ISP rate currency is a string which is prepended to the costs ($, £ etc) When monitoring, RAStimer spits out a record every time a connection is closed, the record is: RAS dialling entry, start time, stop time, call duration, tel cost, ISP cost, total I run RAStimer as a service (do the following, lifted from SRVANY.WRI in the Resource Kit) -> Copy SRVANY.EXE to your system and install it as a Windows NT™ service, for example: INSTSRV RAStimer c:\tools\srvany.exe -> configure via the Services applet ("Startup..." dialog) of the Control Panel as manual or automatic, as appropriate. -> set via the Services applet ("Startup..." dialog) of the Control Panel the account for the service. Run the Registry Editor (REGEDT32.EXE): -> under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RAStimer: create a 'Parameters' key -> under the above key, create an 'Application' value of type REG_SZ and specify there the full path of your app executable (including the extension). For example: Application: REG_SZ: D:\TOOLS\RASTIMER.EXE -> Under the above key, create an 'AppParameters' value of type REG_SZ and specify the parameters for your app. For Example: AppParameters: REG_SZ: 8 18 3.021 0.851 0.723 3.404 1 1 1 $ c:\logs\rastimer.log Alternatively run RAStimer with a command file ccontaining the following line: start "RAStimer" /min rastimer 8 18 3.35 1.4 0.85 3 1 1 1 $ rastimer.log This starts a minimised window which you can push off to one side somewhere. Look in the log file regularly with NOTEPAD, PFE, or LIST. If you do this you can't log connections which occur when you are logged out, and you must remember to start RAStimer when you log in - put the name of the above command file in your startup group. If you have tasks which dial out when you aren't logged in then you'll have to run RAStimer as a service, or alternatively wait for version 2. Current features (such as they are) Writes one record for each call Latches on to the first connection, so doesn't support multiple connections A call in progress when RAStimer starts will be timed from then Transitions between charging bands occur on the hour (24 hour clock) Charging bands are the same for both telco and IP Input rates are pence per minute Peak rate is after pkStart and before cpStart (cheap before and after obviously) Weekend rate is all Saturday and Sunday Times are reported to the nearest second (polls at 1/10 of a second) Telco costs are rounded to the nearest 0.1p IP costs are rounded up to the nearest 1p Costs reported in pounds to the nearest 0.1p In the above read for pence and p, cents (or whatever one hundredth of your main currency unit is called) Known bugs If another connection starts while one is being timed, then timing will continue untill all connections are broken. Workaround - disconnect all modems bar one Timing starts as soon as the modems negociate a carrier, this is wrong on two counts, the telcosts are short by the time it takes the modems to lock on, and the IP costs are long by the time the PPP/SLIP link takes to set up. Workaround - There isn't one yet, but I will add a parameter to the next version for the average modem connect delay, also monitor the phases of the connect to obtain the true IP charging point. RAStimer doesn't know anything about public holidays, your telco or ISP may switch to cheap rates then, and RAStimer has no way to log it. At the moment RAStimer holds the logfile open all the time, preventing it being backed up by backup software which skips open files. Workaround - copy the logfile before backup. I use an AT job which runs once a day Future possibilities Split into two programs, one running as a service, the other sets parameters and formats a nice window showing current call cost when running. Keep running total of cost this month, last month, previous months. Different rates for different RAS dialling entries Allow multiple simultaneous connections. Pick up currency symbol from registry for those not in the UK Format dates according to control panel settings Flag for minimum (time/cost based), and rounding, both telco and ISP Charging granularity Provide alarm facility for over long calls Log incoming calls Anything else you'd like to see? John Cooper JPSC Ltd. Rochester Lodge Bridge Road Wallington Surrey SM6 8SQ England johnrst@jpsc.co.uk Modification History V1.04 (5 June 96) Fixed charging problem with call split over charge bands Added currency symbol V1.03 (13 May 96) Print current time when debug mode starts V1.02 (8 May 96) Added 10th optional parameter, logfile - can now be run as a service Fixed bug - connection details not being reported in snapshot run Added debug mode - waits for connection then logs every transition (^C to exit) Removed trailing blanks from log V1.01 (7 May 96) Fixed bug - cheap and peak rates reversed v1.00 (6 May 96) first release