How to recover from a hangup?
I have an app that uses some of the K95 provided scripts and answers
calls and has a simple dialog. I have a problem that results in the
Kermit dos box printing this line over and over:
?Connection on Conexant HCF V90 56K Data Fax PCI Modem is not open.
The script is kicked off by this section of code from Dhostmdm.KSC
; Break out of loop if there is a nonrecoverable error, otherwise
continue.
while 1 {
answer
if > \v(dialstatus) 0 if < \v(dialstatus) 22 stop 1 Fatal modem
error
if = \v(dialstatus) 0 take MM3.ksc
echo Type Ctrl-C to exit... ; Give user a chance to
cancel
sleep 2
}
MM3.KSC just asks for a username and password, and then a menu option
here:
ASG \%T 0
:GETCMD ; What does the user want to do anyway?
OUTPUT \13\10Command:
CLEAR INPUT
INPUT 10 \13
DEF \%C
DEF \%Z \V(INPUT)
DO STRIP {\%Z}
IF = \FLENGTH(\%Z) 0 GOTO GETCMD
ASG \%C \%N
IF EQUAL {\%C} SND GOTO RECEIVE
IF EQUAL {\%C} {RCV R} GOTO SEND
IF EQUAL {\%C} BYE GOTO IFAIL
IF EQUAL {\%C} {RCV M} GOTO SENDM
OUTPUT \13\10REQUEST ERROR|\%C|
INC \%T 1
IF = \%T 4 GOTO IFAIL
GOTO GETCMD
I'll be the first person to admit that I don't know much of the Kermit
language but the code works some of the time that a user hangs up.
Othertimes I get that line repeating and have to restart Kermit.
Is there some error checking I should be doing here to prevent the
hangup from messing the modem up?
Re: How to recover from a hangup?
On 27 Aug 2003 15:05:16 -0400, [email]fdc@sesame.cc.columbia.edu[/email] (Frank da
Cruz) wrote:
[color=blue]
>In article <uoppkvgocr6vgbptg62fm7osanrjhontk3@4ax.com>,
>dgk <sonicechoesWithNoSpam@hotmail.com> wrote:
>: I have an app that uses some of the K95 provided scripts and answers
>: calls and has a simple dialog. I have a problem that results in the
>: Kermit dos box printing this line over and over:
>:
>: ?Connection on Conexant HCF V90 56K Data Fax PCI Modem is not open.
>:
>: The script is kicked off by this section of code from Dhostmdm.KSC
>:
>: ; Break out of loop if there is a nonrecoverable error, otherwise
>: ; continue.
>:
>: while 1 {
>: answer
>: if > \v(dialstatus) 0 if < \v(dialstatus) 22 stop 1 Fatal modem error
>: if = \v(dialstatus) 0 take MM3.ksc
>: echo Type Ctrl-C to exit... ; Give user a chance to cancel
>: sleep 2
>: }
>:
>: MM3.KSC just asks for a username and password, and then a menu option
>: here:
>:
>: ASG \%T 0
>: :GETCMD ; What does the user want to do anyway?
>: OUTPUT \13\10Command:
>: CLEAR INPUT
>: INPUT 10 \13
>: DEF \%C
>: DEF \%Z \V(INPUT)
>: DO STRIP {\%Z}
>: IF = \FLENGTH(\%Z) 0 GOTO GETCMD
>: ASG \%C \%N
>: IF EQUAL {\%C} SND GOTO RECEIVE
>: IF EQUAL {\%C} {RCV R} GOTO SEND
>: IF EQUAL {\%C} BYE GOTO IFAIL
>: IF EQUAL {\%C} {RCV M} GOTO SENDM
>: OUTPUT \13\10REQUEST ERROR|\%C|
>: INC \%T 1
>: IF = \%T 4 GOTO IFAIL
>: GOTO GETCMD
>:
>:
>: I'll be the first person to admit that I don't know much of the Kermit
>: language but the code works some of the time that a user hangs up.
>: Othertimes I get that line repeating and have to restart Kermit.
>:
>: Is there some error checking I should be doing here to prevent the
>: hangup from messing the modem up?
>:
>That's what it sounds like. Every command that could fail should be
>checked. Your MM3.KSC file is a GOTO loop containing INPUTs and OUTPUTs.
>These commands fail if the connection is lost, but your script doesn't
>check for it, so loops forever, printing error messages. See the
>tutorial:
>
> [url]http://www.columbia.edu/kermit/ckscripts.html#tut[/url]
>
>- Frank[/color]
Thanks. I've been putting IF FAIL END after each INPUT, SEND, and
RECEIVE commands. It seems to be working ok.