; FILE PP14400.SCR (MSMPP144.SCR) ; ; An MS-DOS Kermit script program for dialing the Practical Peripherals 14400 ; FXMT or FXSA, PM9600FXMT, PM9600SA, or PM9600 modem, to be used with MS-DOS ; Kermit 3.12 or later. The modem is set up for compression, error ; correction, all types of fallback. RTS/CTS flow control, fixed interface ; speed of 57600 or 38400, depending on the modem model. ; ; Authors: Christine M. Gianone, Frank da Cruz; Columbia U, June 1993 ; Revised: December 1993 to accommodate the 9600bps models; ; Acknowledgements to David Zakai of SUNY-Health Science Center ; at Brooklyn for info about them and debugging help. ; def errfail echo \%1, hangup, goto fail ; Macro to handle failures. if < VERSION 312 errfail {MS-DOS Kermit 3.12 or later required.} define chkerr if fail stop 1 \%1 define chkok input 3 OK, if fail stop 1 \%1 ; Macro to try to get attention of modem's command processor ; at the given speed, or if no speed given, at the current speed. ; define atok - if not def \%1 assign \%1 \v(speed), - set speed \%1, - echo Trying \%1..., - output ATQ0V1\13, - input 3 OK, - end \v(status) 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 set parity none ; Avoid parity foulups set flow none ; Avoid flow control deadlocks hangup ; Begin by dropping DTR pause 1 ; for one second atok 38400 ; Look for OK response at 38400 bps if fail atok 9600 ; Fall back to 9600 bps if fail stop 1 Can't get modem's attention output AT E1 W1 S95=47 &D2 X4\13 ; Set up echoing, result codes, etc. chkok {Can't initialize modem} ; Now see which Practical Peripherals model we have. ; output ATI3\13 ; Issue model query input 5 OK if fail stop 1 Can't get modem model info! reinput 0 PM9600FXMT ; PM9600FXMT if success goto PP9600FX reinput 0 PM9600 ; PM9600 or PM9600SA if success goto PP9600SA reinput 0 PM14400 ; PM14400FXSA or PM14400FXMT if success goto PP14400 stop 1 Unknown Practical Peripherals Modem model. ; Model-specific items... :PP9600SA atok 38400 ; Highest interface speed is 38400 if fail stop 1 No response at 38400 bps! echo Configuring PP9600 or PP9600SA... define _modcmd S37=9 N1 ; Highest modulation speed is V.32 = 9600 goto config :PP9600FX atok 57600 ; Highest interface speed is 57600 if fail stop 1 No response at 57600 bps! echo Configuring PP9600FXMT... define _modcmd S37=9 N1 ; Highest modulation speed is V.32 = 9600 goto config :PP14400 atok 57600 ; Highest interface speed is 57600 if fail stop 1 No response at 57600 bps! echo Configuring PP14400FXMT or SA... define _modcmd S37=11 N1 ; Highest modulation speed is V.32bis = 14400 :CONFIG echo Enabling modulation negotiation... output AT \m(_modcmd)\13 ; Issue the modulation setup command chkok {Can't enable modulation speed negotiation} define _modcmd echo Enabling hardware flow control... output AT &K3\13 ; Enable RTS/CTS hardware flow control chkok {Can't enable RTS/CTS} ; On modem wait 5 cts if fail errfail {Modem is not asserting CTS!} set flow rts/cts ; And in Kermit too, but only now echo Configuring modem to ignore BREAK... output AT S82=128\13 ; Make modem ignore BREAK chkok {Can't become transparent to BREAK} echo Enabling error correction and data compression... output AT &Q5 S36=7 S46=2\13 ; Enable error correction & compression ; with automatic speed buffering chkok {Can't enable compression EC and fallback} if def \%1 if not equal "\%1" "=" goto BEGIN echo Modem initialization complete, no number to dial end 0 :BEGIN ; Now DIAL. clear ; Clear INPUT buffer. set count 5 ; Dialing retry counter, 5 tries allowed. echo Dialing \%1 on \v(line) at \v(speed) bps, wait... echo pause 1 goto dial ; 1st time, skip pause and 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 ATD\%1\13 ; Dial the number. set alarm 90 ; (For detecting keyboard interruptions.) if > VERSION 312 clear input ; Clear echo from INPUT buffer. if < VERSION 313 clear input 30 \10 ; Wait for the linefeeds... :GETMSG input 60 \10 ; ...that surround the response message. if success goto gotmsg ; Got a message. if alarm errfail {No response from modem.} ; No response in 90 seconds. hangup ; User interrupted from keyboard, output \13 ; cancel dialing by sending carriage return, goto again ; and go try again right away. :GOTMSG reinput 1 CONNECT ; Got a message, was it CONNECT? if success goto done ; If so, we're done. reinput 1 BUSY ; Line is busy. if success goto busy ; Go wait a while and then dial again. reinput 1 ERROR ; Command syntax error. if success errfail {Dialing command error} reinput 1 NO CARRIER ; Phone didn't answer or no carrier. if success errfail {No answer or no carrier} reinput 1 NO DIALTONE ; No dialtone when phone taken off hook. if success errfail {No dialtone - Is your modem connected to the phone line\63} goto getmsg ; None of the above, get another message. :BUSY if < \v(count) 2 goto quit ; Don't wait 30 seconds if tries are used up. Echo Line is busy, will dial again in 30 seconds echo Press any key to cancel... output \13 ; CR cancels dialing hangup ; Hang up. :AGAIN if count goto redial ; Then go redial. :QUIT errfail {It never answers! I give up.} ; Too many tries. :DONE ; Connected. echo \7 ; Celebrate with a beep. define errfail ; Erase local macro definitions... define _modcmd end 0 ; Finished, return success code. :FAIL ; Dialing failed, no beep. define errfail ; Erase local macro definitions... define _modcmd end 1 ; Return failure code. ; End of PP14400.SCR