Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need script to hangup modem after 30 sec every time 1

Status
Not open for further replies.

chief39

Technical User
Aug 4, 2002
14
US
I am running the following script and I now need procomm to hang up modem after 30 sec of connect time. Does not matter what the connecting caller is doing. I recieve data
from the same place everytime but they are setup to stay connected for 57 sec. I need to disconneced in 30 sec or less. It only take 15 sec to recieve the data from them.

Thanks for your help.

proc main
when $CARRIER call check_carrier
while 1
yield
endwhile
endproc
proc check_carrier
set capture overwrite on
capture on
if $CARRIER == 0
capture off
endif
StartProcess ( )
endproc

Proc StartProcess
string sLine

fopen 0 "C:\Program files\Symantec\Procomm Plus\Capture\wbfc.txt.cap" Read Text ; Source File
set capture overwrite on
fopen 1 "C:\Program files\Symantec\Procomm Plus\Capture\wbfc.txt" Create Text ; Destination File
while not feof 0
fgets 0 sLine
if strfind sLine "Final Type:"
fputs 1 sLine
endif
if strfind sLine "Fire Box:"
fputs 1 sLine
endif
if strfind sLine "Loc:"
fputs 1 sLine
endif
if strfind sLine "AKA:"
fputs 1 sLine
endif
endwhile
fclose 0
fclose 1
pause 57
runxl ()
endproc

proc runxl
run "c:\amlxl.exe
end proc

Even with the pause command in there the amlxl program starts at 40 sec every time and this is to fast the capture has not saved the file yet becouse there has not been a disconnect. So if Procomm hangs up in 30 sec all would be fine.

Thanks Again
Glenn

 
Place this line:

when elapsed 0 30 call quit

somewhere in your script right after where the connection has been established (I'm assuming the beginning of the StartProcess procedure would be a good place). Then add a procedure that reads:

proc quit
disconnect
endproc

The when command will fire 30 seconds after you have initialized it, which will then cause the quit procedure to be called and a disconnect command will be executed.
aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top