Dont know much about Procomm or Aspect scripting.
Need to write a script that will test 600 modem connections. These modems are used for out of band access to various routers.
assuming i have a text file with the phone numbers in this format:
8175555555
2145555555
9725555555
etc
The following sample script from aspectscripting.com is very helpful, but I need to tweek it a little:
proc main
string sNum
if fopen 0 "numbers.txt" READ TEXT ;Open text file containing list of connections
while not feof 0 ;While data remains in the file
fgets 0 sNum ;Get entry from file
if not nullstr sNum ;If entry is not blank
dial DATA sNum ;Then dial it
while $DIALING ;Pause while dialing
yield
endwhile
if $CARRIER ;If connected...
;perform operations here once connected...
endif
endif
endwhile
endif
fclose 0 ;Close data file
endproc
What I need is a method to notate success or failure of the dial in attempt and write it back to the text file so that the completed text file may look like this:
8175555555 P
2145555555 F
9725555555 P
Where 'P' or 'F' indicates pass or fail of the dial in test. I think there is a line or two that I need to add here:
if $CARRIER ;If connected...
;perform operations here once connected...
endif
But I do not know how to write to the text file. '
Anyhelp would be greatly appreciated.
Thanks,
Need to write a script that will test 600 modem connections. These modems are used for out of band access to various routers.
assuming i have a text file with the phone numbers in this format:
8175555555
2145555555
9725555555
etc
The following sample script from aspectscripting.com is very helpful, but I need to tweek it a little:
proc main
string sNum
if fopen 0 "numbers.txt" READ TEXT ;Open text file containing list of connections
while not feof 0 ;While data remains in the file
fgets 0 sNum ;Get entry from file
if not nullstr sNum ;If entry is not blank
dial DATA sNum ;Then dial it
while $DIALING ;Pause while dialing
yield
endwhile
if $CARRIER ;If connected...
;perform operations here once connected...
endif
endif
endwhile
endif
fclose 0 ;Close data file
endproc
What I need is a method to notate success or failure of the dial in attempt and write it back to the text file so that the completed text file may look like this:
8175555555 P
2145555555 F
9725555555 P
Where 'P' or 'F' indicates pass or fail of the dial in test. I think there is a line or two that I need to add here:
if $CARRIER ;If connected...
;perform operations here once connected...
endif
But I do not know how to write to the text file. '
Anyhelp would be greatly appreciated.
Thanks,