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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

script hangs when modem does not connect

Status
Not open for further replies.

gilone

IS-IT--Management
Jan 5, 2005
5
FR
I am using the following script to log into a series of systems consecutively.

proc main
string sLine, sNum, sRmalogin, sRmapassw, sMtclpassw, sCaplog
if fopen 0 "file.txt" READ TEXT
while not feof 0
fgets 0 sLine
strtok sNum sLine "`t" 1
strtok sRmalogin sLine "`t" 1
strtok sRmapassw sLine "`t" 1
strtok sMtclpassw sLine "`t" 1
strtok sCaplog sLine "`t" 1

clear
Set Capture File sCaplog
Capture On

dialnumber DATA sNum
while $DIAlING
yield
endwhile
if $CARRIER
;******************
;login sequence
;******************
waitfor "eRMA login: " FOREVER
transmit sRmalogin
; etc...
; list of commands
endif
Capture off
endwhile
endif
fclose 0
endproc

In some cases, my modem fails to connect to the remote modem but then, the script just hangs. I set the numbers of retries to 2 and after 2 unsuccessful attempts, the script does not dial the next number (as I would like it to do).

Any idea how I could make the script resume after a connection failre ?

Thanks
 
Is the modem reporting anything back to Procomm or the script? What is displayed in the dialing window? Does it seem to lock up like this if you dial manually (assuming you have a connection that is often problematic that you can test with)?

 
When I posted the thread above I noticed a wrong spelling in the following lines of the script :

while $DIAlING
yield
endwhile


I changed $DIAlING to $DIALING (with a capital "L"), recompiled and ran the script again. Since then, it went much better (I hope this makes sense). By the way, the script compiled without any error before.

However, I still ran into the problem a couple of times. In one case, the dial window showed :

Dial Attempt: 2
Dialing call
Call proceeding
Call disconnected
Disconnected : Busy

When I got the problem, I heard from my modem that the call was answered and hang up (the number dialed was not a modem). The dial window showed Disconnected: Busy.
The script did not go on with the next number, leaving the little man still running and the capture file still opened.

Another occurence of the problem might have been but I cannot confirm at this time because I was not in front of the PC : the remote modem answered but the negociation failed. The dial window showed Disconnected : No answer.

I know for sure I cannot reproduce this problem systematically so it might depend on something else than procomm itself. (?)
 
The dialing window always disappears before the script blocks.
 
In these cases where the script appears to hang, is the CD "modem light" at the bottom of the Procomm window red or grey? If red, then either Windows or the modem thinks a connection is made (meaning you are in the if $CARRIER clause). Depending on what code you have in there (since you did not post it all), I would think the script would eventually come out of that clause and continue if you just have waitfors that time out and transfer statements. If the modem or Windows are not reporting the correct value of CD back to Procomm though, I would try reinstalling the modem, checking for updated modem drivers and firmware (if your modem is flashable).

 
OK. I will check the CD modem light when I get the problem and keep you posted.
 
I eventually had a chance to bump into the problem again.
It appears that the CD light is definitely grey when the script hangs.
I understand that in this case what you suggest is to reinstall the modem, or update the driver ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top