; FILE SUPRA.SCR ; ; An MS-DOS Kermit script program for dialing Supra V.32/V.32bis/V.34 modems, ; to be used with MS-DOS Kermit 3.15 or later. The modem is set for RTS/CTS ; flow control, fixed interface speed, and to negotiate highest modulation, ; error correction, compression, and all types of fallback. ; ; Authors: C. Gianone & F. da Cruz, Columbia U, December 1996 ; ; To use: SET MODEM=SUPRA (in DOS, before starting Kermit or in AUTOEXEC.BAT) ; or: SET MODEM SUPRA (in Kermit, or in MSCUSTOM.INI) ; and: Make sure Kermit has executed the standard MSKERMIT.INI file, ; and then DIAL the desired number. ; ; Variables - define these prior to dialing if desired; they can be either ; Kermit variables or DOS environment variables: ; ; DIALPORT - COM port to use for dialing (COM1, COM2, etc) ; DIALSPEED - Speed for dialing (57600 by default) ; DIALMETHOD - TONE or PULSE (modem's default method is used by default) ; DIALRETRIES - Maximum times to redial the call (default 5) ; DIALTIMEOUT - How long to wait for result from modem (default 90 seconds) ; if < VERSION 315 stop 1 MS-DOS Kermit 3.15 or later required. def ERRFAIL echo \%1, forward FAIL def CHKOK input 3 OK, if fail stop 1 \%1 local __dm __parity ; Local variables set carrier off ; Don't require carrier during dialing. set input echo on ; So we can watch what happens. set input timeout proceed ; Allow IF SUCCESS, IF FAILURE. set input case ignore ; Use caseless string comparisons :PORT if not def DIALPORT asg DIALPORT \$(DIALPORT) if not def DIALPORT forward SPEED set port \m(DIALPORT) if success forward SPEED echo SET PORT \m(DIALPORT) failed end 1 :SPEED asg __parity \v(parity) ; Save parity setting set parity none ; Switch to none while dialing set flow none ; Avoid flow control deadlocks hangup ; Begin by dropping DTR if not def DIALSPEED asg DIALSPEED \$(DIALSPEED) if not def DIALSPEED asg DIALSPEED 57600 set speed \m(DIALSPEED) if fail end 1 \m(DIALSPEED) - Speed not supported ; Dial method, retry limit, and timeout... xif numeric \fsubstr(\%1,1,1) { if eq "\m(DIALMETHOD)" "TONE" asg __dm T if eq "\m(DIALMETHOD)" "PULSE" asg __dm P } if not def DIALRETRIES asg DIALRETRIES \$(DIALRETRIES) if not def DIALRETRIES asg DIALRETRIES 5 if not def DIALTIMEOUT asg DIALTIMEOUT \$(DIALTIMEOUT) if not def DIALTIMEOUT asg DIALTIMEOUT 90 ; Begin the modem dialog... echo Configuring Supra modem on \v(line)... output ATQ0V1\13 ; Enable word result codes chkok {Can't get modem's attention} output ATE1X4&C1&D2&F2\13 ; Set echoing, result codes, etc. chkok {Can't initialize modem} output AT &K3\13 ; RTS/CTS hardware flow control chkok {Can't enable RTS/CTS} ; On modem wait 5 cts if fail errfail {Configuration failed - no CTS from modem} set flow rts/cts ; And in Kermit too, but only now output AT N1\13 ; Enable modulation fallback chkok {Can't enable modulation fallback} output AT \\N3&Q5\13 ; Compression and EC enabled Chkok {Can't enable compression and EC} output AT &Y3\13 ; Make modem pass BREAK transparently chkok {Can't become transparent to BREAK} mpause 500 clear input ; Clear INPUT buffer. clear device ; Clear device buffer. echo Dialing \%1 on \v(line) at \v(speed) bps, wait... echo for \%i 1 \m(DIALRETRIES) 1 { ; Redial loop xif > \%i 1 { echo Redialing... ; Message for redialing hangup ; Hang up first } pause 1 ; Wait a sec for modem to settle output ATD\m(__dm)\%1\13 ; Dial the number. minput \m(DIALTIMEOUT) - CONNECT BUSY ERROR {NO CARRIER} {NO ANSWER} {NO DIALTONE} - RING DELAYED BLACKLISTED FAX xif fail { echo Call timed out, hangup, out \13, continue } switch \v(minput) { :1, forward done :2, Echo Line is busy - will dial again in 30 seconds. echo Press any key to cancel... output \13 pause 30 if fail errfail Canceled break :3, errfail {Dialing command error} :4, errfail {Call failed - no carrier} :5, errfail {No answer - try again later} :6, errfail {No dialtone - is your modem connected to the phone line?} :7, errfail {Call failed - your phone is ringing} :8, errfail {Call failed - answered by voice} :9, errfail {Call delayed - try again later} :10, errfail {Call failed - blacklisted} :11, errfail {Call failed - answered by fax} :default, break } } errfail {It never answers! I give up.} ; Too many tries. :DONE ; Connected. echo \7 ; Celebrate with a beep. set carrier on ; Require carrier from now on. set parity \m(__parity) ; Restore host parity setting undef errfail ; Erase local macro definitions... end 0 ; Finished, return success code. :FAIL undef errfail ; Erase local macro definitions... set carrier off ; Let them reconnect to see what's up. hangup end 1 ; Return failure code. ; End of SUPRA.SCR