LineWatcherCLI =============================================================================== -------- CONTENTS -------- 1. Installation 2. Using LineWatcherCLI 3. De-installation 4. Debug mode 5. Call Interface A. INI file settings ------------------------------------------------------------------------------- 1 INSTALLATION ------------------------------------------------------------------------------- 1.1 PRE-REQUISITES --- -------------- 1.1.1 LineWatcherCLI requires a PACE 56voice external modem, connected to a physical COM port on your computer. 1.1.2 LineWatcherCLI requires Windows 95, Windows 98, Windows ME, Windows NT, Windows 2000 or Windows XP to operate. It has been tested only on Windows 2000 and Windows XP, however. 1.1.3 LineWatcherCLI requires a telephone line with BT-standard Caller ID (CLID) enabled to operate. 1.2 HARDWARE INSTALLATION --- --------------------- 1.2.1 Connect the serial cable between the modem and your chosen COM port. 1.2.2 Connect the modem to the telephone line, using a line splitter if required (do NOT plug the answerphone into the modem!) 1.2.3 Plug the modem power lead in, and connect to the modem. 1.2.4 Switch on the modem, and verify that the POWER light is lit. You may see a very brief flash on the Receive light as you switch the modem on. 1.3 SOFTWARE INSTALLATION --- --------------------- 1.3.1 Create a subdirectory on your C drive under Program Files called LineWatcherCLI. If you change the drive or path, you will need to modify some of the other installation files accordingly. 1.3.2 Create a subdirectory under LineWatcherCLI called OutputFiles 1.3.3 Copy the files LineWatcherCLI.exe, srvany.exe, instsvr.exe, mscomm32.ocx and LineWatcherCLI.ini to C:\Program Files\LineWatcherCLI 1.3.4 Double-click the "InstallService.bat" file. 1.3.5 Double-click the "InstallService.reg" file, and respond "Yes" when prompted. 1.3.6 Verify that the contents of the INI file match your setup. Details of the settings, their expected values and meanings can be found in Appendix A. ------------------------------------------------------------------------------- 2 USING LINEWATCHERCLI ------------------------------------------------------------------------------- 2.1 STARTING LINEWATCHERCLI --- ----------------------- 2.1.1 LineWatcherCLI can be started in 2 ways - as a service, or as an interactive application. 2.1.2 To start the application in INTERACTIVE mode, double-click on the executable file. The program will initialise the modem, then wait for incoming calls. 2.1.3 To start the application as a service, go to the Services applet, which can be found under Control Panel --> Administrative Tools. Find the LineWatcherCLI service, and check the Status column. If the word "Started" appears there, then the service is already running. Otherwise, right-click the service name and choose Start from the menu. When the "starting" dialog disappears, the service is running. NOTE! Do not attempt to run the application both as a service AND interactively! The second instance of the application will NOT be able to connect to the modem, and will report that failure as an error! 2.1.4 After installation, the service will start automatically whenever you re-start your PC. It will also run in the background, even if you are logged off. If you need to change this, find the service entry as described in 2.1.3 above, but choose Properties from the menu, and change the Startup Type entry to Manual or Disabled (Manual is preferred). 2.2 STOPPING LINEWATCHERCLI --- ----------------------- 2.2.1 To stop the LineWatcherCLI running in interactive mode, simply click the X button in the corner (red X if you're using Windows XP). 2.2.2 To stop the LineWatcherCLI service, open Control Panel, then Administrative Tools, then Services; find the LineWatcherCLI service, right-click it and choose STOP from the menu. 2.3 USING LINEWATCHERCLI --- -------------------- 2.3.1 When in use as a service (the default), the application will create a file in its output directory whenever a call is received on the line. Any errors encountered by the service are reported to the Windows Event Log (available in Control Panel --> Administrative Tools) 2.3.2 When in use interactively, the application will still create the call files, as above, but will also log all output from the modem, and will display the last received CLI details. 2.3.3 The output file create by the program is named as the date and time the call was logged, e.g. 20061112122515.txt would represent a call which was received on the 12th November 2006 at 12:25:15. 2.3.4 The output file contains two comma-separated fields: The date/time (again) The telephone number OR a text entry describing the reason the number could not be captured. Where no number is captured, the text will be either: WITHHELD - the caller withheld their number UNAVAILABLE - CLID information was not available from the caller INTERNATIONAL - The call originated from outside of the UK An example file is present on the installation CD for information. 2.3.5 Output files are placed in a directory defined in the INI file. See Appendix A. ------------------------------------------------------------------------------- 3 DE-INSTALLATION ------------------------------------------------------------------------------- 3.1 To uninstall the application, please take the following steps: 3.2 Ensure the service is stopped (see 2.2.2 above) 3.3 Run a command prompt (CMD), and CD to the LineWatcherCLI directory. 3.4 Type "INSTSRV LineWatcherCLI REMOVE", and press return (don't type the quotes) 3.5 Delete the LineWatcherCLI directory. ------------------------------------------------------------------------------- 4 DEBUG MODE ------------------------------------------------------------------------------- 4.1. The system now recognises an additonal command-line parameter: --debug_no_modem. If the system is run with this command, it will start without making any attempt to contact the modem. Additionally, a TEST button is added to the user interface to allow a simulated CLI event to occur. This mode can be used to test the command line execution (see below). Please note that this option has no effect if the "-s" option (i.e. run as a service) is active. ------------------------------------------------------------------------------- 5 CALL INTERFACE ------------------------------------------------------------------------------- 5.1. See section in the INI file: [Call Program] This section contains a single option: Call=program name Program Name should be the full path & name of the executable, e.g.: Call=C:\Windows\notepad.exe Call=C:\Program Files\Textpad 4\Textpad.exe The parameters will be passed unaltered to the program, with two exceptions: %f will be expanded out to contain the filename of the CLI file %p will be expanded out to contain the pathname of the CLI file For example, the following: Call=C:\windows\notepad.exe %p%f will start Notepad, and load the new file. Please note that the path name will always have a trailing backslash (e.g. c:\myoutputfiles\), so you do not need to add that to the command. The new section is optional - if missing, no command will be executed. If an error occurs when executing the command (e.g. the exe name is incorrect), then the error will either be logged to the event log (if the program is running as a service), or a messagebox will be displayed. The program called can do anything you like with the CLI file e.g. read it then immediately send you an email message or text message with details of the call. ------------------------------------------------------------------------------- A APPENDIX A - The INI FILE ------------------------------------------------------------------------------- A.1 The INI file contains configuration data for the application. There are two sections, described below. A.2 The [COM Parameters] section A.2.1 Port - this is a number which identifies the COM port the program should listen to. Default is 1 (for COM1); a typical alternative would be 2. A.2.2 Parameters - this should be left as 9600,n,8,1. Each item in turn means: 9600 - The baud rate the serial port is running at n - means no parity; alternatives are e(ven), o(dd) and s(pace) 8 - the number of databits; alternatives are 7. 1 - the number of stop bits; alternatives are 2. Normally, this setting will not need changing. A.2.3 DTREnable - 0 or 1; leave this set to 1. This may require changing if you have to change the modem. A.2.4 Handshaking - hardware; this should not require changing. Alternative values are: off - no handshaking XonXoff - software handshaking both - combination of XonXoff and hardware This will only need changing if you change modems, and the new one does not work with hardware handshaking. The purpose of handshaking is to ensure that all of the data sent to a device is received by it. A.2.5 RTSEnable - 0 or 1; leave this set to 0. This may require changing if you have to change the modem. A.3 The [Output Parameters] section A.3.1 Path - Set this to the desired output path; the output files will be created here. A.3.2 AddCRLF - 0 or 1; If set to 1, the files will have CR and LF characters added to the end of the telephone number. If set to 0, the file will end at the last character of the telephone number. Set this to 1 if you are using Visual Basic to read the file, and are using LINE INPUT to read the file, for example.