mailbox125
Technical User
This script will only run for about 5 min.?? I can't see anything in the script that would be causeing this is this something in Procomm? and if so what??
;DIAL-REPORTS1.WAS v1.0
;*****************************************************************************
;* DIAL-REPORTS1.WAS *
;* Copyright (C) 2003 IVAN SOLKEY *
;* All rights reserved. *
;* *
;* Written by: IVAN SOLKEY *
;* 04/29/03 *
;* *
;* This script file calls multiple Octel 100/200/300 locations. Logs onto *
;* with the maint password sets the capture file to a client folder and runs *
;* a hard coded set of reports. *
;*****************************************************************************
;*****************************************************************************
;* MACRO DEFINITIONS *
;*****************************************************************************
#DEFINE NUMBEROFCALLS 4
;*****************************************************************************
;* GLOBAL VARIABLES *
;*****************************************************************************
string NumberToDial ;holds number to dial
string Passw,Pos,CapLog
integer Row=0,Col=1
Long SystemVar,LinkVar
;*****************************************************************************
;* *
;* MAIN *
;* The Main procedure call to CapLog to move data to report files, *
;* calls GetNumber to get the phone number to dial, calls *
;* PlaceCall to dial the number, calls Setmodem to set modem to 7,e,1, Calls *
;* Getpass to get the password from a Excel DB, calls RunReports to collect *
;* data from each system, *
;* *
;* Calls: CAPLOG, GETNUMBER, PLACECALL, SETMODEM, GETPASS, & RUNREPORTS *
;* Modifies globals: NONE *
;* *
;*****************************************************************************
proc main
Integer CurCall
For CurCall = 1 upto NumberOfCalls ;will loop until NumberOfCalls is reached
Row ++
Waitquiet 1
CapLogFile() ;Moves collected data the reports file
GetNumber() ;gets the current number to dial from Excel
SetModem() ;SETS THE MODEM TO 7,E,1
PlaceCall() ;calls procedure to make calls
GetPass() ;Gets password from Excel DB
RunReports() ;Collects the reports infromation
Endfor
DISCONNECT
endproc
;*****************************************************************************
;* *
;* CapLogFile() *
;* This procedure will make a call to the Excell DB sheet3 to get the name *
;* for the capture file, and write all report information into the clients *
;* own file. *
;* *
;* Calls: Excel Sheet 3 *
;* Called by:MAIN *
;* Modifies globals: NONE *
;* *
;*****************************************************************************
Proc CapLogFile
Set Capture Path "C:\ReportFiles"
Set Capture Overwrite ON ;* Don't Overwrite
Set Capture Query OFF ;* Don't Prompt for Capture Query
if not ddeinit LinkVar "excel" "sheet3" ; Set up link to spreadsheet.
errormsg "Couldn't establish DDE link to spreadsheet sheet3"
else
strfmt Pos "R%iC%i" Row Col ; Request cell to read
dderequest LinkVar Pos CapLog ; Extract cell to CapLog
ddeterminate LinkVar
ddeterminate SystemVar
strreplace CapLog "`r`n" "" ; Remove C/R from CapLog
Waitquiet 1
Set Capture File CapLog
Capture On
endif
Endproc
;*****************************************************************************
;* *
;* GETNUMBER(CURCALL) *
;* The procedure GetNumber determines the phone number to call. *
;* *
;* NOTE: This procedure will retrieve the numbers to call from sheet1 of an *
;* Excell DB. This is Excell spreadsheet will need to be updated for *
;* any new system numbers added. *
;* *
;* *
;* Calls: Excel Sheet 1 *
;* Called by: MAIN *
;* Modifies globals: NUMBERTODIAL *
;* *
;*****************************************************************************
proc GetNumber
Clear
if ddeinit SystemVar "excel" "system" ; Initialize link to Excel
ddeexecute SystemVar "[FULL(TRUE)]" ; Maximize the spreadsheet.
if not ddeinit LinkVar "excel" "sheet1"; Set up link to spreadsheet.
errormsg "Couldn't establish DDE link to spreadsheet sheet1"
else
strfmt Pos "R%iC%i" Row Col ; Request cell to read
dderequest LinkVar Pos NumberToDial ; Extract cell to NumberToDial
strreplace NumberToDial "`r`n" "" ; Remove C/R from NumberToDial
ddeterminate LinkVar
endif
else
errormsg "Couldn't establish DDE link to Excel!"
halt
endif
endproc
;*****************************************************************************
;* *
;* PLACECALL() *
;* The procedure PlaceCall dials remote system and loops while dialing. *
;* *
;* Calls: NONE *
;* Called by: MAIN *
;* Modifies globals: NUMBERTODIAL *
;* *
;*****************************************************************************
proc PlaceCall
dialnumber DATA NumberToDial ;dials the number
while $DIALING ;loops while dialing
endwhile
if $CARRIER == 0
Set Capture Path "C:\ReportFialures"
Set Capture Overwrite OFF ;* Don't Overwrite
Set Capture Query OFF ;* Don't Prompt for Capture Query
if not ddeinit LinkVar "excel" "sheet3" ; Set up link to spreadsheet.
errormsg "Couldn't establish DDE link to spreadsheet sheet3"
strfmt Pos "R%iC%i" Row Col ; Request cell to read
dderequest LinkVar Pos CapLog ; Extract cell to CapLog
ddeterminate LinkVar
ddeterminate SystemVar
strreplace CapLog "`r`n" "" ; Remove C/R from CapLog
Waitquiet 1
Set Capture File CapLog
Capture On
Capture off
endif
endif
endproc
;****************************************************************************
;* *
;* SetModem *
;* The procedure to set the modem to 7,e,1 *
;* Set terminal to VT100 *
;* Calls: None *
;* Called by: MAIN *
;* Modifies: Modem Settings *
;* *
;*****************************************************************************
proc SetModem
set quickselect ON ; turn on Quickselect display
set statusline ON ; turn on Stusline display
set terminal type VT100
statmsg "VT100"
pause 1
set terminal type VT100
statmsg "VT100"
set port baudrate 2400 ; 2400
set port databits 7 ; 7
SET port hardflow OFF ;
set port parity EVEN ; e
SET port softflow OFF ;
set port stopbits 1 ; 1
set duplex full
pause 1
endproc
;*****************************************************************************
;* *
;* Getpass() *
;* The procedure Getpass performs a call to an Excel db sheet2 for the *
;* password to loggon to the remote system. *
;* *
;* Calls: Excel Sheet 2 *
;* Called by: MAIN *
;* Modifies globals: NONE *
;* *
;*****************************************************************************
proc Getpass
Waitfor "@PASSWORD:"
if ddeinit SystemVar "excel" "system" ; Initialize link to Excel
ddeexecute SystemVar "[FULL(TRUE)]" ; Maximize the spreadsheet.
if not ddeinit LinkVar "excel" "sheet2" ; Set up link to spreadsheet.
errormsg "Couldn't establish DDE link to spreadsheet sheet2"
else
Waitquiet 1
strfmt Pos "R%iC%i" Row Col ; Request cell to read
dderequest LinkVar Pos Passw ; Extract cell to Passw
strreplace Passw "`r`n" "" ; Remove C/R from Passw
Waitquiet 1
Transmit Passw
Transmit "^M"
Ddeterminate LinkVar
endif
else
errormsg "Couldn't establish DDE link to Excel!"
halt
endif
Endproc
;*****************************************************************************
;* *
;* RunReports() *
;* This procedure will run all the requested reports like but limited to *
;* List Features, Disk Report, Ports report Ect... *
;* *
;* Calls: NONE *
;* Called by: MAIN *
;* Modifies globals: NONE *
;* *
;*****************************************************************************
Proc RunReports
Transmit "l h^M"
Waitfor "@"
Transmit "l r 5^M"
Waitfor "READY PRINTER, THEN PRESS RETURN..." Forever
Transmit "^M"
Waitfor "@"
Transmit "V^M"
Waitfor ">"
Transmit "L DMAP^M"
Waitfor ">"
Transmit "E^M"
Waitfor "@"
Transmit "U^M"
Waitfor "."
Waitquiet 1
Transmit "L all^M"
Waitfor "." Forever
Transmit "l app^M^M"
Waitfor "." Forever
Transmit "E^M^M"
Waitfor "@"
Transmit "PAT STA^M"
Waitquiet 1
Waitfor "@"
Transmit "^M^M^M"
Capture off
Endproc
;DIAL-REPORTS1.WAS v1.0
;*****************************************************************************
;* DIAL-REPORTS1.WAS *
;* Copyright (C) 2003 IVAN SOLKEY *
;* All rights reserved. *
;* *
;* Written by: IVAN SOLKEY *
;* 04/29/03 *
;* *
;* This script file calls multiple Octel 100/200/300 locations. Logs onto *
;* with the maint password sets the capture file to a client folder and runs *
;* a hard coded set of reports. *
;*****************************************************************************
;*****************************************************************************
;* MACRO DEFINITIONS *
;*****************************************************************************
#DEFINE NUMBEROFCALLS 4
;*****************************************************************************
;* GLOBAL VARIABLES *
;*****************************************************************************
string NumberToDial ;holds number to dial
string Passw,Pos,CapLog
integer Row=0,Col=1
Long SystemVar,LinkVar
;*****************************************************************************
;* *
;* MAIN *
;* The Main procedure call to CapLog to move data to report files, *
;* calls GetNumber to get the phone number to dial, calls *
;* PlaceCall to dial the number, calls Setmodem to set modem to 7,e,1, Calls *
;* Getpass to get the password from a Excel DB, calls RunReports to collect *
;* data from each system, *
;* *
;* Calls: CAPLOG, GETNUMBER, PLACECALL, SETMODEM, GETPASS, & RUNREPORTS *
;* Modifies globals: NONE *
;* *
;*****************************************************************************
proc main
Integer CurCall
For CurCall = 1 upto NumberOfCalls ;will loop until NumberOfCalls is reached
Row ++
Waitquiet 1
CapLogFile() ;Moves collected data the reports file
GetNumber() ;gets the current number to dial from Excel
SetModem() ;SETS THE MODEM TO 7,E,1
PlaceCall() ;calls procedure to make calls
GetPass() ;Gets password from Excel DB
RunReports() ;Collects the reports infromation
Endfor
DISCONNECT
endproc
;*****************************************************************************
;* *
;* CapLogFile() *
;* This procedure will make a call to the Excell DB sheet3 to get the name *
;* for the capture file, and write all report information into the clients *
;* own file. *
;* *
;* Calls: Excel Sheet 3 *
;* Called by:MAIN *
;* Modifies globals: NONE *
;* *
;*****************************************************************************
Proc CapLogFile
Set Capture Path "C:\ReportFiles"
Set Capture Overwrite ON ;* Don't Overwrite
Set Capture Query OFF ;* Don't Prompt for Capture Query
if not ddeinit LinkVar "excel" "sheet3" ; Set up link to spreadsheet.
errormsg "Couldn't establish DDE link to spreadsheet sheet3"
else
strfmt Pos "R%iC%i" Row Col ; Request cell to read
dderequest LinkVar Pos CapLog ; Extract cell to CapLog
ddeterminate LinkVar
ddeterminate SystemVar
strreplace CapLog "`r`n" "" ; Remove C/R from CapLog
Waitquiet 1
Set Capture File CapLog
Capture On
endif
Endproc
;*****************************************************************************
;* *
;* GETNUMBER(CURCALL) *
;* The procedure GetNumber determines the phone number to call. *
;* *
;* NOTE: This procedure will retrieve the numbers to call from sheet1 of an *
;* Excell DB. This is Excell spreadsheet will need to be updated for *
;* any new system numbers added. *
;* *
;* *
;* Calls: Excel Sheet 1 *
;* Called by: MAIN *
;* Modifies globals: NUMBERTODIAL *
;* *
;*****************************************************************************
proc GetNumber
Clear
if ddeinit SystemVar "excel" "system" ; Initialize link to Excel
ddeexecute SystemVar "[FULL(TRUE)]" ; Maximize the spreadsheet.
if not ddeinit LinkVar "excel" "sheet1"; Set up link to spreadsheet.
errormsg "Couldn't establish DDE link to spreadsheet sheet1"
else
strfmt Pos "R%iC%i" Row Col ; Request cell to read
dderequest LinkVar Pos NumberToDial ; Extract cell to NumberToDial
strreplace NumberToDial "`r`n" "" ; Remove C/R from NumberToDial
ddeterminate LinkVar
endif
else
errormsg "Couldn't establish DDE link to Excel!"
halt
endif
endproc
;*****************************************************************************
;* *
;* PLACECALL() *
;* The procedure PlaceCall dials remote system and loops while dialing. *
;* *
;* Calls: NONE *
;* Called by: MAIN *
;* Modifies globals: NUMBERTODIAL *
;* *
;*****************************************************************************
proc PlaceCall
dialnumber DATA NumberToDial ;dials the number
while $DIALING ;loops while dialing
endwhile
if $CARRIER == 0
Set Capture Path "C:\ReportFialures"
Set Capture Overwrite OFF ;* Don't Overwrite
Set Capture Query OFF ;* Don't Prompt for Capture Query
if not ddeinit LinkVar "excel" "sheet3" ; Set up link to spreadsheet.
errormsg "Couldn't establish DDE link to spreadsheet sheet3"
strfmt Pos "R%iC%i" Row Col ; Request cell to read
dderequest LinkVar Pos CapLog ; Extract cell to CapLog
ddeterminate LinkVar
ddeterminate SystemVar
strreplace CapLog "`r`n" "" ; Remove C/R from CapLog
Waitquiet 1
Set Capture File CapLog
Capture On
Capture off
endif
endif
endproc
;****************************************************************************
;* *
;* SetModem *
;* The procedure to set the modem to 7,e,1 *
;* Set terminal to VT100 *
;* Calls: None *
;* Called by: MAIN *
;* Modifies: Modem Settings *
;* *
;*****************************************************************************
proc SetModem
set quickselect ON ; turn on Quickselect display
set statusline ON ; turn on Stusline display
set terminal type VT100
statmsg "VT100"
pause 1
set terminal type VT100
statmsg "VT100"
set port baudrate 2400 ; 2400
set port databits 7 ; 7
SET port hardflow OFF ;
set port parity EVEN ; e
SET port softflow OFF ;
set port stopbits 1 ; 1
set duplex full
pause 1
endproc
;*****************************************************************************
;* *
;* Getpass() *
;* The procedure Getpass performs a call to an Excel db sheet2 for the *
;* password to loggon to the remote system. *
;* *
;* Calls: Excel Sheet 2 *
;* Called by: MAIN *
;* Modifies globals: NONE *
;* *
;*****************************************************************************
proc Getpass
Waitfor "@PASSWORD:"
if ddeinit SystemVar "excel" "system" ; Initialize link to Excel
ddeexecute SystemVar "[FULL(TRUE)]" ; Maximize the spreadsheet.
if not ddeinit LinkVar "excel" "sheet2" ; Set up link to spreadsheet.
errormsg "Couldn't establish DDE link to spreadsheet sheet2"
else
Waitquiet 1
strfmt Pos "R%iC%i" Row Col ; Request cell to read
dderequest LinkVar Pos Passw ; Extract cell to Passw
strreplace Passw "`r`n" "" ; Remove C/R from Passw
Waitquiet 1
Transmit Passw
Transmit "^M"
Ddeterminate LinkVar
endif
else
errormsg "Couldn't establish DDE link to Excel!"
halt
endif
Endproc
;*****************************************************************************
;* *
;* RunReports() *
;* This procedure will run all the requested reports like but limited to *
;* List Features, Disk Report, Ports report Ect... *
;* *
;* Calls: NONE *
;* Called by: MAIN *
;* Modifies globals: NONE *
;* *
;*****************************************************************************
Proc RunReports
Transmit "l h^M"
Waitfor "@"
Transmit "l r 5^M"
Waitfor "READY PRINTER, THEN PRESS RETURN..." Forever
Transmit "^M"
Waitfor "@"
Transmit "V^M"
Waitfor ">"
Transmit "L DMAP^M"
Waitfor ">"
Transmit "E^M"
Waitfor "@"
Transmit "U^M"
Waitfor "."
Waitquiet 1
Transmit "L all^M"
Waitfor "." Forever
Transmit "l app^M^M"
Waitfor "." Forever
Transmit "E^M^M"
Waitfor "@"
Transmit "PAT STA^M"
Waitquiet 1
Waitfor "@"
Transmit "^M^M^M"
Capture off
Endproc