; File QX4232.SCR -- minor modification of Klensin's PENRIL.SCR. ; To be used with MS-DOS Kermit 3.11 or later. ; ; This MS-DOS Kermit script program is for dialing a Microcom QX/4232hs modem, ; which is a v.32(w/bis) / v.42(w/bis) MNP class *10* modem. What else do you ; expect from the people who created the Microcom Networking Protocol anyway? ; The QX/4232hs, like most V.32 modems, is Hayes-compatible up to the point ; that one starts dealing with buffering, error-correction, and compression ; modes. Expects variable %\1 to contain the phone number; this is done by ; the DIAL macro defined in MSKERMIT.INI. Items marked by "*!*" might need ; editing. ; ; NOTE: The annotation *FDSS indicates a MS-KERMIT software setting that was ; originally defined by the Factory Default Switch Settings, which do not ; always match the default software settings. Also, many terminal packages ; have their own preferred settings for the switches, and default software ; settings in the modem's NRAM. This script studiously avoids touching any of ; the NRAM functions, or modem switches, to avoid trashing the functionality ; of other packages that expect the NRAM & switches to be in a certain ; configuration. It also attempts to put everything back to the original ; factory sets, with minor modifications for optimal Kermit functionality, as ; the ones for this modem are the most viable for auto-reliable connections to ; the widest variety of modems. These changes are all completely temporary, ; and are wiped out by a simple ATZ. ; ; The following decimal codes are given as a QRL (Quick Reference Listing) for ; the various special characters in the extended AT command set that the ; Microcom QX/4232hs uses. ; \36 = $ \42 = * ; \37 = % \58 = & ; \38 = & \92 = \ ; ; Uses ATD (modem's default dialing method) to dial the number, after setting ; Tone Dialing with ATT. If you're still in a phone service area that uses ; pulse dialing, modify this script accordingly in the initialization, to set ; Pulse Dialing with ATP. ; ; Sets SUCCESS flag if dialing succeeds, sets FAILURE flag if it fails. ; ; Author: Kevin P. Brott, Clackamas Community College, Oregon City, OR ; e-mail: ; WWW: http://198.153.201.254/html/kevinb.htm ; Last update: 941224.1235PST (24-DEC-94) ; ; Adapted from PENRIL.SCR John C. Klensin, August 1992 ; Adapted from HAYES.SCR by Christine M. Gianone (July 1991). ; Requires MS-DOS Kermit 3.11 or later. ; ; The normal DTE <-> DCE speed of this modem is 38.4 Kbps, regardless of the ; line or character speed. Set that number here, regardless of what the ; DIALUPS file says. However, this may exceed the speed at which MSDOS ; computers can deal with characters and should be reduced if necessary. ; echo Using Microcom QX/4232hs modem\13\10 set speed 38400 ; *!* This is the locked serial speed. ; set flow rts ; Best set, modem default. def errfail echo \%1,hangup,goto fail ; Macro to handle failures. if < VERSION 310 errfail {MS-DOS Kermit 3.10 or later required.} set input timeout proceed ; Allow IF SUCCESS, IF FAILURE set input echo on ; Do echo the modem test/init, for debugging output ATZ\13 ; Send ATZ to reset/init the modem. output AT\38F\13\10 ; Send AT&F, resets modem to factory defaults output ATQ0\13\10 ; Send ATQ0, enables modem result codes output ATT\13\10 ; then send an ATT, setting tone dialing. *!* input 2 OK ; Modem should say "OK" if fail errfail {Turn on or connect your modem!} pause ; Continue initializing output AT\38C1 ; &C1 So CD follows remote carrier *FDSS output \37G1 ; %G1 Allows modem speed to vary from serial output \37B9600 ; %Bn Sets the initial modem speed to 9600 output \92J0 ; \J0 Disables bps rate adjust *FDSS ;; output \58K1 ; :K1 Enables Kermit spoofing asynch protocol. output \92K3 ; \K3 Break passed immediately to remote host output \37L3 ; %L3 Enables CCITT Automode speed matching. output \92N3 ; \N3 Sets Auto-Reliable connect mode *FDSS output \92Q3 ; \Q3 RTS/CTS, bidirectional *FDSS output \92V2 ; \V2 Enables v.42 result codes on CONNECT msg. output S7=60 ; Wait *1* whole minute for connect (insurance) output \13 ; That's it, we're done, xmit to modem! input 2 OK if fail errfail {Unable to initialize modem} clear ; Clear input buffer ; if not equ {\%1} {=} goto dialnow ; This provides for initialization only echo Modem initialization complete, no number to dial end 0 :DIALNOW set count 5 ; Set up dialing retry counter set input echo on ; From now on, show what happens echo Dialing \%1, wait... pause 1 goto dial ; 1st time, skip Redialing message :REDIAL set alarm 30 pause 30 ; Wait 30 seconds before redialing. if not alarm errfail {Dialing canceled.} echo Redialing... ; Message for redialing. pause 1 :DIAL output ATDT\%1\13 ; Dial the number (ATDT) input 10 \10 ; ignore the immediate LF :GETMSG set alarm 130 ; Detect keyboard interruptions. input 60 \10 ; Wait for the linefeeds... input 40 \10 ; that surround response message. if success goto gotmsg ; Got a message. if alarm errfail {No response from modem.} ; No response in a long time hangup ; User interrupted from keyboard, if count goto redial ; so try again right away goto fail ; die here if over count :GOTMSG reinput 7 CONNECT ; Got message, was it CONNECT? if success goto cspeed ; Yes, wait for LAPM, MNP, or /REL reinput 5 ERROR ; No, check for command error. if success errfail {Modem command error.} reinput 10 NO CARRIER ; NO CARRIER? if success goto busy ; Treat like BUSY. reinput 4 BUSY ; BUSY? if success goto busy ; Go wait a bit, then dial again. reinput 4 /REL ; Reliable connection v.42 v.32 MNP/LAPM if success goto speed ; modem ready, set speed reinput 4 LAPM ; Protocol stuff (V.42/V.42bis) if success goto speed ; modem ready, set speed reinput 3 MNP ; MNP, ignore if success goto speed ; modem ready, set speed errfail {No dialtone or no answer. Try again later.} :BUSY if < \v(count) 2 goto quit ; Don't wait 60 seconds if tries used up. Echo Busy or No Carrier, will dial again in 30 seconds... echo Press any key to cancel... hangup ; Hang up. :AGAIN if count goto redial ; Then go redial. :QUIT errfail {It never answers! I give up.} ; Too many tries. ; The following block is retained for compatibility for HAYES.SCR. Since ; this modem buffers (always retains the same DCE<->DTE speed), the computer ; should not speed-match and the next section is a no-op. :CSPEED pause 2 ; wait for protocol announcement :SPEED ; Connected! echo \7 ; Celebrate with a beep. define errfail ; Erase ERRFAIL definition end 0 ; Finished, return success code. :FAIL ; Failed, return failure code. define errfail ; Erase ERRFAIL definition end 1 ; end of QX4232HS.SCR