                         CoSTa Manual
                         Version 2.20
                 (c)1995,96,97 Gary A. Priest

Contents
	Introduction		                2
	Getting Started	                        2
	Setting Up CoSTa	                2
	Paths			                3
	Preferences		                3
	Duration Offsets	                4
	Costs			                5
	Main Window	                        7
		Include Paid Calls	        7
		Show Costs Including VAT	7	
		Show Phone Number Description	7	
		Deleting a Call	                7	
	Filter Calls		                7	
	Extracting Call Information	        8
		Bank Holidays etc. 		9
	Editing/Deleting a Call	               10
	Paying Bills		               11
	Pie Chart		               11
	Output		                       12
	Export		                       12
	Recost Unpaid Calls	               12
	Purging Old Call/Bill Details	       12
	Support for STiK	               13
	The About Window	               14
	Registering		               15
	Disclaimer	                       15
	Credits		                       15





                         Introduction
		         ------------
CoSTa  was written almost as soon as I got myself a modem and got 
on-line to the internet.
I immediately realised that there was no way of knowing how much 
time I spend on line and hence have no idea of what my telephone
bill is going to be.
Using CoSTa this problem is solved.
Each time you connect to the internet using the supported 
programs a log file is created/appended with the current start date 
and time, plus an awful lot of other information. This file quickly 
becomes very large, with no apparent use. Until now!! CoSTa runs over 
this log file and extracts all the information it requires about each 
call made, it then calculates the length of the call and the cost. 
Each call can easily be seen in the main window, along with a current 
phone bill total.
When the phone bill arrives, you can tell CoSTa to flag all calls up
to the date of the bill as paid, the current total is reset and ready
for your next month's/quarter's phone calls.

CoSTa currently works in conjunction with Atari NOS, ICE, MiNTnet, 
CoNnect, CixComm, STiK (via STiKtime and the new STiK dialer), STiNG,
Semper, and TeddyTERM.

Hardware required
----------------- 
This program should run on all TOS based computers 
from an ST to a Falcon.  It was developed on a Falcon and hence looks 
best running on this machine.

                         Getting Started
                         ---------------
Installing CoSTa
----------------
CoSTa is installed and run like any other normal Gem Application.  It 
does not run as an accessory.

On-Line Help
------------
CoSTa comes complete with it's own on-line help system.
Position the mouse cursor over whichever window help is required on
and press Help.

                         Setting Up CoSTa
                         ----------------
After installing CoSTa, it is necessary to set up certain information 
for CoSTa to function correctly. BEFORE performing an extract, the 
costs, paths and preferences must be configured in order that the 
program knows where to find the log files, and how much a call is 
going to cost. See the relevant sections in this manual on how to do 
this.

                         Paths
                         -----
CoSTa currently works with the log files created by NOS,  ICE, 
MiNTnet, CoNnect, CixComm, STiK, STiNG, Semper, and TeddyTERM.
The NOS log is also used by STiKtime to support STiK.
 
It is important to tell CoSTa where to find the log files. Click on 
either the text or on the path beside it. Use the file selector to 
locate the relevant log files, that you use.
Click on the check box beside the path to tell CoSTa that this file 
is to be used during extraction.

The log files are normally named as follows:
NOS	-	NOS.LOG
ICE     -       ICE.LOG
MiNTnet	-	messages
Connect	-	CONNECT.LOG
CixComm -       CIXCOMM.LOG

                         Preferences
                         -----------

Backup NOS Log File To History
------------------------------
After CoSTa has extracted call details from the NOS.LOG file, this 
file is renamed to NOS.HST to prevent further processing. N.B. this 
only applies to NOS because the log file contains vast amounts of 
information and quickly becomes very large.  All other log files are 
processed using a timestamp (see Timestamp in the Extracting Calls 
section).

This can happen in two ways (which option you choose depends on 
whether you feel the need to keep a history or not):

Append
------
The contents of the current .LOG file are appended on to the end of 
any existing .HST, hence it can get very large but does contain ALL 
details.
This file should be deleted/archived on a regular basis.

Overwrite
---------
Any existing .HST file is deleted, and the current .LOG file is 
renamed to .HST. This keeps the size of the .HST down, but of 
course, all details prior to the last extraction are lost.

Auto Extract on Startup
-----------------------
If this option is set to 'Yes', then CoSTa will automatically perform 
an extraction whenever it is called ie. on program startup. This makes 
the process of call extraction completely transparent to the user. 
Simply run CoSTa and  it will automatically know about all your calls.
This facility is only applicable to registered versions of CoSTa.

GMT Adjustment
--------------
This applies only for extractions from NOS.

All times written to NOS.LOG are in Greenwich Mean Time.  
This obviously causes a problem if your local time zone is not GMT, as 
your telephone company costs calls based on your local time.
CoSTa needs to know how to convert the GMT times into local ones.
The Time Adjustment field can contain a number of hours between 0 and 
23. The sign is set by selecting the relevant box beside it. Hence, if 
your local time zone is 1 hour ahead of GMT (British Summer Time or 
France, for example) set this field to 1 + . Now CoSTa will convert 
the GMT date/time into local and your call will be costed correctly.

Show Costs Including VAT
------------------------
This sets the default display of costs to either include VAT or 
exclude it. This can be overriden from the menu option.

                         Duration Offsets
                         ----------------
Most log files do not accurately record a call duration. They miss out 
the modem negotiation time which means the call tends to be 10-20 
seconds shorter in CoSTa than appears on the bill.

This window allows you to define a number of seconds that will be 
added or subtracted to the length of each call when recorded in CoSTa, 
thus making CoSTa more accurate.

The actual number of seconds can be determined by comparing several 
telephone bill entries with the corresponding entries logged in CoSTa 
and using the average difference, so that subsequent calls will be 
logged more accurately.

All of the supported communications software has differing degrees of 
accuracy hence it may be necessary to 'adjust' NOS calls by a 
different number of seconds from ICE calls etc.

                         Costs
                         -----
When CoSTa extracts call details, it costs the call.  To achieve this 
it must know how much a telephone call costs.  British Telecom 
currently have different costs for local, regional and national calls. 
 Earlier versions of CoSTa did not support this. Until Now. CoSTa will 
cost a call by using the telephone number, thus calls to different 
costing regions are fully supported, as are calls to 0891 numbers etc.

CoSTa currently costs calls in the same manner as British Telecom. ie. 
it calculates using the cost per minute, to the nearest second. 
Therefore if the call is 2minutes 30seconds, the call is NOT rounded 
up to 3minutes.
Costs are held in pence and to 3 decimal places.

Peak Hours
----------
Most telephone companies charge at a higher rate during 'their' peak 
hours.  British Telecom's peak hours are 08:00:00 to 18:00:00.  Other 
telephone companies' hours may differ.  Enter the hours applicable 
here.

VAT Rate
--------
If costs are set up as excluding VAT, then the current VAT rate should 
be set up here. It is recommended that this facility is used and all 
costs are keyed in excluding VAT.

Minimum Cost
------------
Although British Telecom now charge by the second, the still impose a 
minimum cost to each call. ie. if the cost of your call is below this 
minimum then it is rounded up to the minimum. This is currently 
approximately 5 pence.  Therefore every call you make will cost at 
least 5 pence.
This is the minimum cost of a telephone call.

Base Cost
---------
This is the base cost of a call which should only be used for 
countries that use such a costing method.
ie. call cost = base cost + (duration * cost)

List of Telephone Numbers
-------------------------
A list of telephone numbers and associated costs can be maintained 
here.
It is NOT necessary to define every number used, as CoSTa uses a 
default which will be used if the telephone number is not found in the 
list. The default supplied with CoSTa is for a local BT call exc. VAT.

The default is indicated by having a telephone number of '*'.
Limited wildcards can now be used to reduce the amount of numbers
needed to be defined. ie. 01703* will do for any Southampton number.
Question marks cannot be used as wildcards.

Other telephone numbers can be maintained, such as BBS's etc.

CoSTa only uses the default it the actual telephone number cannot be
found.

Entries can be added, deleted and edited by double clicking or 
clicking on Edit.

The default '*' cannot be deleted.

MiNTnet
Extraction of MiNTnet calls will always use the default cost. This is 
because MiNTnet does not make the telephone number available in it's 
log file, so CoSTa doesn't know the number.

CixComm
The CixComm log does not include any Mercury or ACC access codes in 
the log. Only the Cix telephone number is recorded. Thus ensure that 
you exclude these access codes from the telephone number defined to 
CoSTa.

Adding/Editing an Entry
-----------------------
Each entry has the following fields:

Telephone Number
----------------
This should be '*' for the default costs, but can be any telephone 
number for specific costs. Blanks do not matter as CoSTa strips them 
out during use. Thus 01234 5678 is the same as 012345678.

Wildcards can now be used in phone numbers in the form of '01703*' 
etc. The use of '?' is not supported ie. '01?03' is not allowed. No 
validation is performed ie. both '01703*' and '0170*' can both be 
added. The first one encountered is used.

Description
-----------
The description of the phone number. ie. Fred's BBS. This description 
can be displayed in place of the phone number in the main window as 
long as the associated telephone number has no wildcards.

Peak Cost
---------
This is the cost per minute of a telephone call during the above peak 
hours.

Offpeak Cost
------------
This is the cost per minute of a telephone call outside of the peak 
hours.

Weekend Cost
------------
Peak/Offpeak hours normally only apply Monday to Friday. Weekend rates 
then apply from midnight Friday to midnight Sunday.  This is the cost 
per minute of a telephone call at the weekend.

Copy/Paste
----------
This allows easier maintenance of costs!
An existing telephone number and details can be 'copied' and then 
'pasted' to form the basis for a new number. Just makes life a bit 
easier!

                         Main Window
                         -----------
The main window display lists all calls known to CoSTa.
The day, date, time, duration, cost, telephone number and origin of 
each call is displayed, along with a flag to indicate if the call has 
been paid for.
At the bottom of the window are totals. These are the total number of 
calls, total length of time and the total cost in pounds.

Include Paid Calls
------------------
The display will either list all calls known to CoSTa, or will just 
display current unpaid calls. This can be changed by use of the 
'Include Paid Calls' menu option.
The default is to only show current unpaid calls.

Show Costs Including VAT
------------------------
The display will show all costs with or without VAT applied. This only 
makes a difference if a VAT rate is defined within the COSTS window. 
The default is set in the Preferences window.

Show Phone Number Description
-----------------------------
The display will show either the actual telephone number or it's 
associated description (assuming that the number is not defined to 
CoSTa using wildcards, in which case the telephone number is always 
shown). This can be toggled by use of the 'Show Phone Number 
Description' menu option.

Deleting a Call
---------------
To delete a call from within the main display, simply select the call 
by single clicking it with the mouse and then press the Delete key.

                         Filter Calls
                         ------------
The filter allows you to only display calls that match specific 
criteria. ie. you can see just the calls made via CoNnect, or just 
calls over 10p made with ICE etc, etc.

The filter works in conjunction with the 'Include Paid Calls' menu 
setting and the 'Show VAT' setting.

The filter also determines which calls are output via the 'Output' and 
'Export' menu options.  It does NOT affect which calls are flagged as 
paid via the 'Pay Bill' function.

If the filter is active then a check mark appears against the 'Filter 
Calls' menu option.

                         Extracting Calls
                         ----------------
For CoSTa to be able to display call details, it is necessary to tell 
it to extract the information from the relevant log files.  This 
should only be performed after preferences and cost details have been 
maintained and is achieved by selecting 'Extract' from the menu.

CoSTa processes the log files, extracts call details and costs them, 
and stores each call in CALLS.DTA. The log file is then backed up in 
the manner chosen in Preferences or a timestamp file created.

NOS Specific Problems
---------------------
Unfortunately NOS does not output actual 'connection made'/'connection 
stopped' messages and as such this causes the following problems in 
calculating the length of a call:
a) CoSTa has to approximate the connection start time, by scanning the 
log file for a specific string that will only occur after a connection 
has been made. Start times may be a second or two out, but at least it 
does handle number busy and redials correctly.
b) CoSTa also has to approximate the end time. It looks for the 'NOS 
stopped' message in the log file. Thus it is essential that after you 
have ended the connection with 'ppp sl0 lcp close', you immediately 
exit NOS by typing 'exit'.

MiNTnet Specific Problems
-------------------------
MiNTnet does not put the telephone number into the log file. Thus 
CoSTa puts blanks into it's database and uses the 'default' costs 
entry to cost the call.

TeddyTERM Specific Problems
-------------------------
The TeddyTERM log is quite a complicated one.
CoSTa will cope with most situations in it.
One area that CoSTa will *not* attempt to record the call,
is where the log says 'Connected to unknown system, maybe dialed
direct from terminal'.
This is because CoSTa can't know the phone number, start time etc.

Timestamps
----------
All log files except the one created by NOS are either relatively 
small containing only basic information or in the case of CoNnect and 
CixComm they are actually used for later analysis and thus should not 
be renamed/deleted.

The way CoSTa gets around this problem is by keeping a note of the 
date/time of the last call it has extracted. Then when extraction is 
performed again, only calls after the stored date are processed. These 
date/time's are stored in files called COSTA.??? (where ??? is MNT for 
MiNTnet, ICE for ICE etc.)  and should not be deleted.

The log files should be cleared down/backed up manually on a regular 
basis, to keep the size down. It is important to note that CixComm 
uses it's log file to calculate Cix charges, thus any archiving should 
be done with careful consideration.

Bank Holidays etc.
------------------
Most telephone providers in the UK charge weekend rates for all public
holidays ie. Bank Holidays, Christmas etc.
It is now possible for CoSTa to recognise a date as being a holiday and
cost the calls made on that day accordingly.
This can be achieved by creating a file called 'HOLIDAY.TXT' in the same
folder as COSTA.PRG.
This file can be created with a normal text editor such as Everest and
must be of the format:

19971225<CRLF>
19971226<CRLF>

This will cause CoSTa to cost any calls made on the 25th and 26th
December 1997 as Weekend calls.

If it is necessary to cost them as Offpeak calls (or Peak calls),
a 'O' or 'P' can be placed immediately after the date ie. 
19971225P<CRLF>. This feature simply allows flexibility for other
countries/providers that may not charge at Weekend rate, but may
charge Offpeak rates, maybe.

                         Editing/Deleting a Call
                         -----------------------
Occasionally it might be necessary to edit or delete details of a 
particular call.  One reason for this is that your Atari's clock was 
wrong when you logged onto the internet, and hence the date or time of 
the call once extracted into CoSTa is wrong, which could in turn lead 
to the call being costed incorrectly.

To edit a call, simply double click on it from the main window with 
the left mouse button, and the edit window will be displayed.

You can amend the date, time, duration, cost, and telephone number. 
The only item you cannot amend is the origin of the call ie. NOS or 
ICE.

You can also override a particular day/time to be Peak, Offpeak, or 
Weekend. The cost is automatically recalculated for you.

Re-cost
-------
If you change the date or time of the call, it could well fall into a 
different cost category ie. if you change the time peak to off-peak, 
or the date from midweek to weekend. You can either manually alter the 
cost or you can have CoSTa re-cost the call for you using the new date 
time, and duration.
If you would like CoSTa to re-cost the call, it is important to click 
on 'Recost' BEFORE clicking on 'Ok' to update the call details.
Note: The cost here is excluding VAT (regardless of the display 
setting).

Delete
------
To actually delete this call, click on 'Delete'.

                         Paying The Bill
                         ---------------
When the telephone bill arrives, you need to flag all the calls up to 
the date of the bill as paid. In this way they will then be excluded 
from the current unpaid totals.

Select 'Pay Bill' from the main menu and you will be presented with 
the 'Pay Bill' window. This window displays a history of all previous 
paid bills and their totals, as well as allowing you to pay a new 
bill.

Enter the date of the bill, and all calls up to and including that 
date will be flagged as paid.

The totals paid will then be added to a list of previous paid bills.
This list is displayed in this window and shows date of bill, total
number of calls, total time, and total cost. 

The list allows a history of paid bills to be examined at a glance.

Double Clicking on a bill will bring up a window showing further 
details of that particular bill, ie. how many calls were STiK, how 
many were NOS etc.
This feature only applies to bills that were created using version 2 
of CoSTa and above.
The total does not always match the sum of the individual sources
displayed. This is because VAT is calculated on the TOTAL of calls
and NOT each individual call. I'm not sure of a way around this :(

                         Pie Chart
                         ---------
This window shows a breakdown of calls in a pie chart format, to allow 
you to easily compare on-line time, costs etc. for all of your various 
comms software.

The format of the pie chart can be changed by a single left click 
anywhere in the pie chart window.

Configuring the Pie Chart
-------------------------
Having left clicked on the Pie Chart window, you are presented with 
this window. This allows the pie chart details to be changed.

The pie chart can show number of calls, cost of calls, or duration of 
costs.

This information can be shown by either Origin or Time period ie. 
Offpeak, Weekend, or Peak.

Telephone number is not currently supported.

                         Output
                         ------
From this window it is possible to output a list of calls and the 
totals to either a printer or the clipboard. The calls that are output 
are conditioned by the 'Include Paid Calls' and 'Filter' options.

                         Export
                         ------
From this window it is possible to export call data in standard comma 
or tab delimited ASCII format. This could be useful for importing into 
a database or spreadsheet program. The calls that are exported are 
conditioned by the 'Include Paid Calls' and 'Filter' options.

                         Recost Unpaid Calls
                         -------------------
This option processes 'Unpaid' calls and recalculates their costs. 
This could be useful if you need to change cost details (or if 
upgrading from a previous CoSTa version that didn't support VAT). 
Simply change the costs in the costs window and recost the calls via 
this window.

Either all unpaid calls can be recosted or only those within an 
inclusive date range.
Leaving the date range as 00/00/00 to 99/99/99 will recost all
unpaid calls.

If a call is selected from the main window before taking this menu 
option, then the From date will default to that of the selected call.

                         Purging Old Calls/Bills
                         -----------------------
After a while, the number of calls/bills will start to grow, and it 
may be a good idea to get rid of very old calls/bill details that are 
of no further use. This will help keep CoSTa performing at maximum 
speed also, because the more call details stored, the more work it has 
to do.

Only calls that have been flagged as 'Paid' are eligible for 
purging.

Select 'Purge Calls' from the 'File' menu, to display the 'Purge'
window.

A date must be entered, up to and including which all 'Paid' calls
will be deleted.

To delete old 'Bill' details (as shown in the Pay Bill window), it
is also necessary to click on the 'Bills Too' radio button.
Bill details will probably want to be purged much less frequently than 
Call details, as Bill details are a nice history log of your internet 
usage.

This facility is only applicable to registered versions of CoSTa.

It is IMPORTANT to note that once call or bill details have been 
Purged, they are gone for good. The only way to undo a Purge is to go 
back to a backup.

                      Support for STiK
                      ----------------
NOTE: STiKtime only works with versions of  STiK prior to 1.11. The 
STiK dialer by Peter Rottengatter should be used with STiK versions 
1.11 and above.

STiK does not produce a log file of it's own, but CoSTa supports calls 
made using STiK in two ways.

Versions of STiK prior to 1.11 are supported via a utility called
STiKtime (by Guy Harrison).

Versions of STiK from 1.11 and above are supported via the STiK Dialer
(by Peter Rottengatter).

Support via the STiK Dialer.
----------------------------
The STiK Dialer creates a log of each call made which is directly 
supported by CoSTa. The path to this log should be defined in the STiK 
path within CoSTa, and that is all that needs to be done. It behaves 
exactly as all the other supported applications.

Support via STiKtime
--------------------
STiKtime runs as either an accessory for non multitasking operating 
systems or as an application for multitasking operating systems such 
as Magic.  It detects whenever STiK is enabled/disabled and writes 
dummy call details to NOS.LOG.

CoSTa should have the nos.log path set and active in 'paths' (even if 
you don't use NOS) and will then extract these STiKtime calls just as 
if they were real NOS calls. CoSTa will log them with an origin of 
'STiK'.  The GMT adjustment is not applied, but the STiK duration 
offset is. STiKtime does not know the telephone number that STiK has 
dialled and therefore CoSTa will use the default '*' cost to cost the 
call.

IMPORTANT:  The call times logged by STiKtime are approximate (they 
are not actual connection times, but start as soon as STiK is enabled 
and end when disabled).  This is still a whole lot better than no 
record of the call at all.  The duration offset value can be used to 
adjust the accuracy.

                         The About Window
                         ----------------
This is a bit gimmicky but is going to be a standard in all of my 
programs from now on.

Both the email address and the URL can be selected and copied to the 
GEM clipboard via (CTRL C or CTRL Insrt). This allows them to be 
pasted into any programs that support 'pasting' into their fields such 
as CAB. Saves all that typing!

For people who are really lazy, try double clicking on them.
The browser will be launched and passed a mailto: or http:.
Hence if you are ONLINE at the time, the web browser will go straight 
to my web site. Or in the case of the email address, you'll be all 
ready to start typing an email to me!
Two environment variables (BROWSER= & EMAIL=) must be set up for this 
feature to work. These variables allow the program to know what 
programs to launch for web browsing and email.

Environment Variables
---------------------
The following environment variables must exist for the About Window to 
function correctly.

BROWSER=C:\CAB\CAB.APP or whatever path points to your browser
EMAIL=C:\CAB\CAB.APP or whatever path points to your email program (it 
must understand mailto: as a command line).

Single TOS users can either get hold of programs such as GEMENV and 
SETENV or can use the file VARS.ENV. This file must exist in the same 
path as COSTA.PRG to be effective.
Edit file VARS.ENV to point to whichever programs you wish to use.

Magic users should add the following lines to MAGX.INF
#_ENV BROWSER=C:\CAB\CAB.APP
#_ENV EMAIL=C:\CAB\CAB.APP

MultiTOS or Geneva users should add the following lines to GEM.CNF
setenv BROWSER=C:\CAB\CAB.APP
setenv EMAIL=C:\CAB\CAB.APP

                         Registering
                         -----------
CoSTa is a Shareware product. If you use it regularly you should do 
the right thing and register it.
Registration costs 6 UK Pounds and includes the following benefits:

a) A unique key to enter into CoSTa. Future versions will have 
   increased functionality which will be disabled unless you have
   the key.
b) The latest version on disk or by e-mail if you supply an e-mail 
   address.
c) e-mail support.

Gary Priest
32 Castle Street, Inner Avenue, Southampton SO14 6HF

gary@the-gap.demon.co.uk
http://www.the-gap.demon.co.uk/

                         Disclaimer
                         ----------
All costings calculated by CoSTa are approximate and no guarantee to 
their accuracy is given.
Any damage caused by use of this program, either directly or
indirectly is not my responsibility.
This software is used at your own risk.

                         Credits
                         -------
Atari NOS is the work of Demon and David Nash.
Oasis and ICE are the creation of Phil Yeadon and Dave Levi.
STiK is the creation of Steve Adam and Dan Ackerman.
STiKtime is the creation of Guy Harrison.
The STiK dialer and STiNG are the creation of Peter Rottengatter.

Thanks also to the following people who have helped me by testing and 
supplying their views and suggestions:

Phil Yeadon, Neil Martin, Simon Husbands, Guy Harrison, Gary Wagner, 
Daron Brewood.

