home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR10
/
MODEM31.ZIP
/
CALL.HP
< prev
next >
Wrap
Text File
|
1993-08-30
|
70KB
|
1,962 lines
;call.hp -- HyperACCESS/5 calling script
;
; $Revision: 2.20 $
; $Date: 13 Aug 1993 16:29:32 $
;
; Definition of variables
;
declare integer BaudRate ; contains the baud rate
declare integer BaudIndex ; an index into a baud rate array
declare integer CallType ; contains the type of call
declare integer IrqLevel ; contains the port interrupt level
declare integer MaxCallAttempts ; defines number of redial attempts
declare integer CallAttempt ; used to loop through calling attempts
declare integer MiscInt1 ; used for miscellaneous purposes
declare integer MiscInt2 ; used for miscellaneous purposes
declare integer MiscInt3 ; used for miscellaneous purposes
declare integer ModemNumber ; contains the modem type
declare integer LoopCount ; used as a loop counter
declare integer EscBranch ; controls ESC branching
declare integer Row ; current cursor row
declare integer Col ; current cursor column
declare integer OSVersion ; version number of operating system
declare integer TempBaud ; a temporary baud rate value
declare flag Logging ; true if logging is specified
declare flag NonDialable ; true if non-dialable modem
declare flag CD_High ; true if modem's CD is held high
declare flag DirectCable ; true if direct cable connection
declare flag VoiceCall ; true if a voice call
declare flag HHS ; true if modem requires cts/rts
declare flag MiscFlag1 ; used for miscellaneous functions
declare flag DateTime ; true if already have time and date
declare flag UK_Version ; true if UK restrictions
declare flag UserDefinedModem ; true if modem name is User-Defined
declare flag ViewDataEmulation ; true if ViewData emulator is defined
declare flag OS2 ; true if OS/2 is the operating system
declare flag ATT_Initialized ; true if the AT&T dev has been setup
declare flag ISDN_Support ; true if device is ISDN
declare flag LeasedLine ; true if leased line support selected
declare flag SlowOS2 ; true if OS/2 version < 2.00
declare string SystemName ; contains the remote system name
declare string PhoneNumber ; contains the phone number
declare string PhonePrefix ; contains the telephone number prefix
declare string PhoneSuffix ; contains the telephone number suffix
declare string ExtraMdmCmds ; contains the extra modem commands
declare string LogonScript ; contains the sign-on script
declare string NamePlusPhone ; contains the remote system name....phone number
declare string DialType ; contains the dialing method
declare string LogFileName ; contains the log file name
declare string ModemName ; contains the modem name
declare string ConnectTime ; contains the system time at connect
declare string MiscString1 ; serves miscellaneous purposes
declare string ConnectMessage ; contains connect message from modem
declare string ModemInitString ; initializiers for some modems
declare string InitString2 ; 2nd line of initialization strings
declare string UserDefCall ; user defined modem values read from
declare string UserDefAnswer ; modemdef.dat. modemderf.dat is
declare string UserDefDial ; created by running the utility script
declare string UserDefHangup ; named modemdef.
declare string UserDefCD
declare string UserDefToggleDTR
declare string UserDefHHS
InitializeCallEnvironment:
option("BOTTOM LINE",no)
bottom line(0,"")
get position(Row,Col)
report("screen columns", MiscInt1)
if equal(MiscInt1, 40)
set flag(ViewDataEmulation, true)
else
set flag(ViewDataEmulation, false)
endif
option("mouse", on)
ClearScreen:
prompt("/n")
if decrement(Row) goto ClearScreen
escape key("<ESC>")
set integer(EscBranch,990)
option("temporary settings",yes)
if flag(ViewDataEmulation) emulate("tty")
option("blank",yes)
GetInfoFromProgram:
key integer(CallType,"") ;type of call
key string(SystemName,"") ;system
key string(PhonePrefix, "") ;telephone number prefix
key string(PhoneNumber,"") ;telephone number
key string(PhoneSuffix, "") ;telephone number suffix
key integer(BaudRate,"") ;baud
key string(ModemName,"") ;modem name
key integer(ModemNumber,"") ;modem number
key string(DialType,"") ;dialing method
key string(ExtraMdmCmds,"") ;extra commands
key string(LogonScript,"") ;logon script
key string(LogFileName,"") ;log file name
SetFlags:
set flag(UK_Version,false)
ifnot truncate(LogonScript," ") greater(2,1)
if length("/(LogFileName)", MiscInt1)
set flag(Logging,true)
else
set flag(Logging,false)
endif
if string match(PhoneSuffix,";")
set flag(VoiceCall,true)
else
set flag(VoiceCall,false)
endif
report("operating system", MiscInt1)
if equal(MiscInt1, 2)
set flag(OS2, True)
else
set flag(OS2, False)
endif
report("operating system version", OSVersion)
set flag(ATT_Initialized, False)
set flag(ISDN_Support, False)
set flag(LeasedLine, false)
if get environment(MiscString1, "HA5LEASED")
if string match(MiscString1, "TRUE")
set flag(LeasedLine, true)
endif
endif
get porttype(MiscString1)
if string match(MiscString1, "PBX") set flag(ISDN_Support, True)
if string match(MiscString1, "ISDN") set flag(ISDN_Support, True)
if equal(ModemNumber, 102) set flag(ISDN_Support, True)
if equal(ModemNumber, 103) set flag(ISDN_Support, True)
BeginCalling:
option("blank",no)
put environment("HA_CALL_STATUS","CONNECTED")
wipe screen()
position(1,1)
option("ignore case",yes)
MenuSettings:
gosub SetFlowControl
if string match(ModemName,"Direct-cabled (no modem)") goto DirectCableCall
set flag(DirectCable,FALSE)
ifnot length("/(PhoneNumber)",MaxCallAttempts)
goto MenuSettings2
else
Set String(PhoneNumber, "/(PhonePrefix)/(PhoneNumber)/(PhoneSuffix)")
endif
if equal(MaxCallAttempts, 1) goto MenuSettings1
goto SetBasicTerminal
MenuSettings1:
if string match(PhoneNumber,";") goto MenuSettings2
goto SetBasicTerminal
MenuSettings2:
option("use menu colors",yes)
option("bold", yes)
draw box(3,80)
position(3,33)
prompt(" ESC to cancel ")
option("bold", no)
position(2,3)
if flag(VoiceCall) set string(PhoneNumber,"")
option("mouse", off)
prompt("Enter the phone number to use for this call: ")
key edit(PhoneNumber,30)
Set String(PhoneNumber, "/(PhonePrefix)/(PhoneNumber)/(PhoneSuffix)")
option("mouse", on)
MenuSettings3:
if flag(VoiceCall) set string(PhoneNumber,"/(PhoneNumber);")
option("use menu colors",no)
wipe screen()
position(1,1)
SetBasicTerminal:
option("echo",no)
option("fduplex",yes)
option("send line feeds",no)
option("receive line feeds",no)
setting("outgoing hhs",0)
setting("incoming hhs",0)
CheckModem:
gosub DisplayBanners4
if flag(ISDN_Support)
option("use menu colors", no)
goto CheckCD
endif
if equal(ModemNumber,97) goto UncommandedModems
if equal(ModemNumber,98) goto UncommandedModems
if equal(ModemNumber,99) goto UncommandedModems
if equal(ModemNumber,49) goto Avatex
DisplayModemName:
get position(row,col)
add(row,1)
position(row,5)
prompt("Preparing the /(ModemName)/n/n/n")
option("use menu colors",no)
character delay(50)
if equal(ModemNumber,49) wait seconds(2)
SpecialModemSupportRoutines:
if equal(ModemNumber,21) goto MultiTech
if equal(ModemNumber,124) goto MultiTech
if equal(ModemNumber,36) goto USR2400E
if equal(ModemNumber,44) goto Microcom
if equal(ModemNumber,123) goto Microcom
if equal(ModemNumber,61) goto ATT
if equal(ModemNumber,62) goto Telrad
if equal(ModemNumber,63) goto Fujitsu
if equal(ModemNumber,64) goto NEC_ISDterm
if equal(ModemNumber,80) goto UserDefined
if equal(ModemNumber,138) goto WorldBlazer
SetModemInitString:
set string(MiscString1,"ATE1V1Q0S0=0")
set string(InitString2,"")
if greater(ModemNumber,39) goto UniqueModemInitString
if less(ModemNumber,10) goto UniqueModemInitString
if less(ModemNumber,20) set string(MiscString1,"/(MiscString1)X1")
if less(ModemNumber,20) goto UniqueModemInitString
if less(ModemNumber,30) set string(MiscString1,"/(MiscString1)X2")
if greater(ModemNumber,29) set string(MiscString1,"/(MiscString1)X3")
UniqueModemInitString:
if equal(ModemNumber,1) set string(MiscString1,"AT&F&C1&D2&R0\G1\J0\N3\Q3\V1\X1S11=55")
if equal(ModemNumber,1) set flag(HHS,true)
if equal(ModemNumber,2) set string(MiscString1,"AT&FX4&C1&D2&R0\J0\N3\Q3\V1\X1%C1S11=55")
if equal(ModemNumber,2) set flag(HHS,true)
if equal(ModemNumber,3) set string(MiscString1,"AT&FE1Q0X4&C1&D2\N3\Q3\J0\V1%C1S11=55")
if equal(ModemNumber,3) set flag(HHS,true)
if equal(ModemNumber,4) set string(MiscString1,"AT&FE1Q0X4&C1&D2&K1S11=55")
if equal(ModemNumber,4) set flag(HHS,true)
if equal(ModemNumber,5) set string(MiscString1,"ATX4%J3S17=1S19=1S30=192")
if equal(ModemNumber,5) set flag(HHS,true)
if equal(ModemNumber,6) set string(MiscString1,"AT&F&C1&D2&R0&K3\N3%C1S11=55")
if equal(ModemNumber,6) set flag(HHS,true)
if equal(ModemNumber,7) set string(MiscString1,"AT&FE1V1Q0&C1&D2&R0$E1$F4$S8")
if equal(ModemNumber,7) set flag(HHS,true)
if equal(ModemNumber,8) set string(MiscString1,"AT&FE1V1Q0X1&C1&D2S11=55")
if equal(ModemNumber,9) set string(MiscString1,"/(MiscString1)S61=1")
if equal(ModemNumber,9) set flag(HHS,true)
if equal(ModemNumber,9) hangup()
if equal(ModemNumber,11) set string(MiscString1,"/(MiscString1)S18=0")
if equal(ModemNumber,12) set string(MiscString1,"AT&FE1V1Q0X4&C1&D2\N3\J0\Q3\V1S11=55")
if equal(ModemNumber,12) set flag(HHS,true)
if equal(ModemNumber,13) set string(MiscString1,"AT&FE1V1Q0X4&C1&D2&K3&R0\A3%C1S11=55S95=3")
if equal(ModemNumber,13) set flag(HHS,true)
if equal(ModemNumber,14) set string(MiscString1,"AT&FE1V1Q0X4&C1&D2\J0\N3\V1\X1\Q3%C1S11=55")
if equal(ModemNumber,14) set flag(HHS,true)
if equal(ModemNumber,15) set string(MiscString1,"AT&FE1V1Q0X4&C1&D2\D1\J0\N3\V1\X1\Q3S11=55")
if equal(ModemNumber,15) set flag(HHS,true)
if equal(ModemNumber,16) set string(MiscString1,"AT&FE1V1Q0&A1&C1&I1&K2&E1S11=55")
if equal(ModemNumber,16) set flag(HHS,true)
if equal(ModemNumber,17) goto Fastcomm
if equal(ModemNumber,18) goto Concord
if equal(ModemNumber,19) set string(MiscString1,"AT&FX1&C1&D1*C1*F2*L1")
if equal(ModemNumber,19) set flag(HHS,true)
if equal(ModemNumber,22) set string(MiscString1,"AT&FL0&C1&D2S11=55S36=7")
if equal(ModemNumber,22) set flag(HHS,true)
if equal(ModemNumber,23) set string(MiscString1,"AT&FL0&C1&D2S11=55S37=9")
if equal(ModemNumber,23) set flag(HHS,true)
if equal(ModemNumber,24) set string(MiscString1,"AT&FX4&C1&D2&K3\N3S11=55")
if equal(ModemNumber,24) set flag(HHS,true)
if equal(ModemNumber,25) set string(MiscString1,"AT&FE1V1Q0X5&B1&C1&D2&H3&N0&R0S11=55")
if equal(ModemNumber,25) set flag(HHS,true)
if equal(ModemNumber,26) set string(MiscString1,"/(MiscString1)\N3\Q2")
if equal(ModemNumber,26) set flag(HHS,true)
if equal(ModemNumber,27) set string(MiscString1,"AT&FE1V1Q0X4&C1&D2\J0\N3\Q3\X1")
if equal(ModemNumber,27) set flag(HHS,true)
if equal(ModemNumber,28) set string(MiscString1,"AT&FE1V1Q0X4&C1&D2&K3&R0\N3%C1")
if equal(ModemNumber,28) set flag(HHS,true)
if equal(ModemNumber,29) set string(MiscString1,"AT&FE1V1Q0X4&C1&D2")
if equal(ModemNumber,29) set flag(HHS,true)
if equal(ModemNumber,30) goto USR2400
if equal(ModemNumber,31) set string(MiscString1,"AT&F&C1&D2\J0\N6\Q3\V1\X1%C1S11=55")
if equal(ModemNumber,31) set flag(HHS,true)
if equal(ModemNumber,32) set string(MiscString1,"AT&F&C1&D2&K3&Q5\A3\N3S36=7S11=55")
if equal(ModemNumber,32) set flag(HHS,true)
if equal(ModemNumber,33) set string(MiscString1,"AT&FE1V1Q0X4&B1&C1&D2S11=55")
if equal(ModemNumber,33) set flag(HHS,true)
if equal(ModemNumber,34) set string(MiscString1,"AT&FE1V1Q0X4&C1&D2&K3&R0S11=40S38=0S95=3")
if equal(ModemNumber,34) set flag(HHS,true)
if equal(ModemNumber,35) set string(MiscString1,"/(MiscString1)S11=55&C1&D2")
if equal(ModemNumber,37) goto Telebit
if equal(ModemNumber,38) set string(MiscString1,"AT&F\V1X4&C1&D2\G0\J0\N3\Q3\X1S11=55")
if equal(ModemNumber,38) set flag(HHS,true)
if equal(ModemNumber,39) set string(MiscString1,"AT&F2&C1&D2\J0\N3\X1\V1\Q3%C1S11=55")
if equal(ModemNumber,39) set flag(HHS,true)
if equal(ModemNumber,41) goto Telebit
if equal(ModemNumber,42) goto Telebit
if equal(ModemNumber,43) set string(MiscString1,"AT&F1Q0V1X4W2&B1&C1&D2&K3&R0S11=55")
if equal(ModemNumber,43) set flag(HHS,true)
if equal(ModemNumber,45) goto Convertible
if equal(ModemNumber,46) set string(MiscString1,"AT&FE1\V1X4\D1\G\J\N3\Q3&C1&D2")
if equal(ModemNumber,46) set flag(HHS,true)
if equal(ModemNumber,47) set string(MiscString1,"AT B11010100")
if equal(ModemNumber,48) set string(MiscString1,"AT&F1E1Q0X4&C1&D2\J0\N3\Q3\V1\X1%C1")
if equal(ModemNumber,48) set flag(HHS,true)
if equal(ModemNumber,49) set string(MiscString1,"AT")
if equal(ModemNumber,50) goto NEC_Modem
if equal(ModemNumber,51) goto Telebit
if equal(ModemNumber,52) set string(MiscString1,"ATE1X4N1&C1&D2&R0\G0\J0\Q3\X1\V1\N3%E1")
if equal(ModemNumber,52) set flag(HHS,true)
if equal(ModemNumber,53) set string(MiscString1,"ATE1V1Q0X6&C1&D2&E4&K3&R0&U2S0=0")
if equal(ModemNumber,53) set flag(HHS,true)
if equal(ModemNumber,54) set string(MiscString1,"AT&F0E1V1Q0X6&C1&D2&R1&I2\N3\Q3%C1S0=0")
if equal(ModemNumber,54) set flag(HHS,true)
if equal(ModemNumber,55) gosub SetDowtySub
if equal(ModemNumber,55) set string(MiscString1,"AT&F0E1V1Q0X6&C1&I2%C1%R0%K3%U3-E3//S0//U0U/(MiscInt2)S0=0")
if equal(ModemNumber,55) set flag(HHS,true)
if equal(ModemNumber,56) gosub SetDowtySub
if equal(ModemNumber,56) set string(MiscString1,"AT&F0E1V1Q0X6&C1&Q11&I2%C1%R0%K3%U3-E3U/(MiscInt2)S0=0")
if equal(ModemNumber,56) set flag(HHS,true)
if equal(ModemNumber,57) set string(MiscString1,"ATE1V1Q0X4&C1&D2//Q3//N3S0=0")
if equal(ModemNumber,57) set flag(HHS,true)
if equal(ModemNumber,58) set string(MiscString1,"AT&F!C0E1Q0X3&C1&D2\J0\N3\V1\Q3\X1%C1S11=55")
if equal(ModemNumber,58) set flag(HHS,true)
if equal(ModemNumber,59)
set string(MiscString1,"AT&FX4&C1&D2&K3&R0\D1")
set string(InitString2,"AT\J\N3\Q3\R\V1\X1S11=55")
set flag(HHS,true)
endif
if equal(ModemNumber,60) set string(MiscString1,"AT&FX4&C1&D2\J0\N3\Q3\V1\X1S11=55")
if equal(ModemNumber,60) set flag(HHS,true)
if equal(ModemNumber,65) goto Telebit
if equal(ModemNumber,70) set string(MiscString1,"AT&FE1V1Q0L0&C1&D2&K3S11=55S38=0S95=2")
if equal(ModemNumber,70) set flag(HHS,true)
if equal(ModemNumber,71) set string(MiscString1,"AT&FE1V1L0Q0X4&C1&D2&R0\Q1\V0\X0S25=0")
if equal(ModemNumber,71) set flag(HHS,true)
if equal(ModemNumber,73) set string(MiscString1,"AT&F&C1&D2E1Q\J\N3\Q3\V1\X1S11=55")
if equal(ModemNumber,73) set flag(HHS,true)
if equal(ModemNumber,74) set string(MiscString1,"AT&FE1X4\V1\D1\J\N3\Q3&C1&D2&R%C1%F1\M1\X1")
if equal(ModemNumber,74) set flag(HHS,true)
if equal(ModemNumber,75) set string(MiscString1,"AT&F2E1V1L0Q0W2X4&C1&D2S11=55")
if equal(ModemNumber,75) set flag(HHS,true)
if equal(ModemNumber,76) set string(MiscString1,"AT&FE1V1Q0S0=0*F3")
if equal(ModemNumber,76) set flag(HHS,true)
if equal(ModemNumber,77) set string(MiscString1,"AT&F&C1&D2&K1S11=55")
if equal(ModemNumber,77) set flag(HHS,true)
if equal(ModemNumber,78) set string(MiscString1,"AT&F&C1&D2X4\N3\Q3%F2*B1&W1&Y1S64=1S11=55")
if equal(ModemNumber,78) set flag(HHS,true)
if equal(ModemNumber,79)
if string match(ModemName, "PSD on D")
set string(MiscString1,"%A1=1%A3=9%A0=2")
elseif string match(ModemName, "PSD on B1")
set string(MiscString1,"%A1=1%A3=3%A0=2")
elseif string match(ModemName, "PSD on B2")
set string(MiscString1,"%A1=1%A3=5%A0=2")
else
set string(MiscString1,"%A1=0%A2=2%A0=2")
endif
set string(MiscString1,"ATE1V1Q0X4&C1&D2&K3/(MiscString1)S0=0")
set flag(HHS,true)
goto AddExtraCmds
endif
if equal(ModemNumber,81) set string(MiscString1,"AT&FE1V1Q0X4&C1&D2&J0&K3\G1\N3S11=55S95=2")
if equal(ModemNumber,81) set flag(HHS,true)
if equal(ModemNumber,82) set string(MiscString1,"AT&FE1Q0V1X4&C1&D2&R0*E9*F3*M1*S1S0=0")
if equal(ModemNumber,82) set flag(HHS,true)
if equal(ModemNumber,83) set string(MiscString1,"AT&FE1V1Q0X4B1&B1&H1&R2&N0S11=55")
if equal(ModemNumber,83) set flag(HHS,true)
if equal(ModemNumber,84) set string(MiscString1,"AT&FE1V1Q0X4B0&B1&H1&R2&N0&A3S11=55")
if equal(ModemNumber,84) set flag(HHS,true)
if equal(ModemNumber,85) set string(MiscString1,"AT&FE1V1Q0X4&C1&D2&R0\H0\N6\Q3S11=55")
if equal(ModemNumber,85) set flag(HHS,true)
if equal(ModemNumber,86) set string(MiscString1,"AT&FE1V1Q0X4&C1&D2\J\V1\X1&R0S11=55")
if equal(ModemNumber,86) set flag(HHS,true)
if equal(ModemNumber,87) set string(MiscString1,"AT&FE1V1Q0X4&C1&D2&R0*SC1*FL3*XC2S11=55")
if equal(ModemNumber,87) set flag(HHS,true)
if equal(ModemNumber,88) goto Telebit
if equal(ModemNumber,89) set string(MiscString1,"AT&F&C1&D2&R%C1%E1\A3\G\J\N3\Q3\X1")
if equal(ModemNumber,89) set flag(HHS,true)
if equal(ModemNumber,100) set string(MiscString1,"AT&FX4&C1&D2&R0\J0\Q3\V2\X1S11=55")
if equal(ModemNumber,100) set flag(HHS,true)
if equal(ModemNumber,101) set string(MiscString1,"AT&FE1V1Q0X4&C1&D2&R%BS7=50")
if equal(ModemNumber,101) set flag(HHS,true)
if equal(ModemNumber,104) set string(MiscString1,"AT&FX4&C1&D2\J\N3\Q3\V2\X1S11=55")
if equal(ModemNumber,104) set flag(HHS,true)
if equal(ModemNumber,105) set string(MiscString1,"AT&F&C1&D2S0=0")
if equal(ModemNumber,106) set string(MiscString1,"ATE1V1Q0&C1S0=0")
if equal(ModemNumber,107) set string(MiscString1,"AT&F&C1&D2\N3\V2\Q3\J0\C1\X1%C1/"H3")
if equal(ModemNumber,107) set flag(HHS, true)
if equal(ModemNumber,108) set string(MiscString1,"AT&FX6&C1&D2&R0\D1\N3\Q3\X1/"H3")
if equal(ModemNumber,108) set flag(HHS, true)
if equal(ModemNumber,109) set string(MiscString1,"AT&FE1V1Q0X4&A3&B1&H1&R2S11=55")
if equal(ModemNumber,109) set flag(HHS, true)
if equal(ModemNumber,110) set string(MiscString1,"AT&F2E1V1X4\N6\Q3\V1\J\X1%C1S11=55")
if equal(ModemNumber,110) set flag(HHS, true)
if equal(ModemNumber,111)
if equal(BaudRate, 300)
set integer(MiscInt1, 1)
elseif equal(BaudRate, 600)
set integer(MiscInt1, 2)
elseif equal(BaudRate, 1200)
set integer(MiscInt1, 3)
elseif equal(BaudRate, 2400)
set integer(MiscInt1, 4)
elseif equal(BaudRate, 4800)
set integer(MiscInt1, 5)
elseif equal(BaudRate, 9600)
set integer(MiscInt1, 6)
else
set integer(MiscInt1, 7)
endif
set string(MiscString1,"AT&FX4&A1&B/(MiscInt1)&H1&R2S11=55")
set flag(HHS, true)
endif
if equal(ModemNumber,112) set string(MiscString1,"AT&FX4&C1&D2&K3\N3S11=55S95=61")
if equal(ModemNumber,112) set flag(HHS, true)
if equal(ModemNumber,113) set string(MiscString1,"AT&FX4&C1&D2&K3\G0S11=55S36=7S46=138S95=3")
if equal(ModemNumber,113) set flag(HHS, true)
if equal(ModemNumber,114) set string(MiscString1,"AT&F2X4&C1&D2&K3&Q9\N3S11=55S95=32")
if equal(ModemNumber,114) set flag(HHS, true)
if equal(ModemNumber,115) set string(MiscString1,"AT&FX4&C1&D2&K3&R0\N3%C1S11=55S95=35")
if equal(ModemNumber,115) set flag(HHS, true)
if equal(ModemNumber,116) set string(MiscString1,"AT&FX4&C1&D2\J0\N6\Q3\V1\X1S11=55")
if equal(ModemNumber,116) set flag(HHS, true)
if equal(ModemNumber,117) set string(MiscString1,"AT&FX4&C1&D2&K3S59=0S11=55")
if equal(ModemNumber,117) set flag(HHS, true)
if equal(ModemNumber,118) set string(MiscString1,"AT&FX4&C1&D2&K3&Q5&R0S11=55S95=35")
if equal(ModemNumber,118) set flag(HHS, true)
if equal(ModemNumber,119) set string(MiscString1,"AT&F1V1X4&C1&D2&K3&Q5S11=55")
if equal(ModemNumber,119) set flag(HHS, true)
if equal(ModemNumber,120) set string(MiscString1,"AT&FX4&C1&D2*FL3*MS0*SM3*XC2*TL1S11=55")
if equal(ModemNumber,120) set flag(HHS, true)
if equal(ModemNumber,121)
set string(MiscString1,"AT&FX4&C1&D2&Q5\J0\N3\Q3\V1\X1%C1")
set string(InitString2,"ATS46=138S48=7S11=55")
set flag(HHS, true)
endif
if equal(ModemNumber,122)
set string(MiscString1,"AT&F1&C1&D2\Q3&S1")
set flag(HHS, true)
endif
if equal(ModemNumber,125) set string(MiscString1,"AT&F0X6&C1&D2&R0\C1\D1\N5\Q3\X1S0=0")
if equal(ModemNumber,125) set flag(HHS, true)
if equal(ModemNumber,126) set string(MiscString1,"AT&F&C1&D2&K3&Q5\N3S11=55S95=47")
if equal(ModemNumber,126) set flag(HHS, true)
if equal(ModemNumber,127) set string(MiscString1,"AT&F&C1&D2*SM3*XC2*FL3")
if equal(ModemNumber,127) set flag(HHS, true)
if equal(ModemNumber,128) set string(MiscString1,"AT&F&C1&D2&K3&Q9\N3S11=55S95=1")
if equal(ModemNumber,128) set flag(HHS, true)
if equal(ModemNumber,129) set string(MiscString1,"AT&FV1&C1&D2\D1\G1\N3\X1")
if equal(ModemNumber,129) set flag(HHS, true)
if equal(ModemNumber,130) set string(MiscString1,"AT&F&C1&D2\J\N3\Q3\V2\X1S11=55")
if equal(ModemNumber,130) set flag(HHS, true)
if equal(ModemNumber,131) set string(MiscString1,"AT&F&C1&D2\J\N3\Q3\V2\X1S11=55")
if equal(ModemNumber,131) set flag(HHS, true)
if equal(ModemNumber,132) set string(MiscString1,"AT&FX6&C1&D2\N7\Q3\X1S11=55")
if equal(ModemNumber,132) set flag(HHS, true)
if equal(ModemNumber,133) set string(MiscString1,"AT&FX4&C1&D2\N3\Q1\V0\X1\M1\P1")
if equal(ModemNumber,133) set flag(HHS, true)
if equal(ModemNumber,134) set string(MiscString1,"AT&FX4&C1&D2&K3%C1\J0\Q3\V1\X1")
if equal(ModemNumber,134) set flag(HHS, true)
if equal(ModemNumber,135) set string(MiscString1,"AT&F&C1&D2\N9\J0\V1\X1S11=55")
if equal(ModemNumber,135) set flag(HHS, true)
if equal(ModemNumber,136) set string(MiscString1,"AT&FX4&C1&D2&K3S11=55")
if equal(ModemNumber,136) set flag(HHS, true)
if equal(ModemNumber,137) set string(MiscString1,"AT&FE1V1Q0X4&C1&D2")
if equal(ModemNumber,139) set string(MiscString1,"AT&F")
if equal(ModemNumber,139) set flag(HHS, true)
if equal(ModemNumber,140) set string(MiscString1,"AT&F0S11=55")
if equal(ModemNumber,140) set flag(HHS, true)
if equal(ModemNumber,141) set string(MiscString1,"AT&F2S11=55")
if equal(ModemNumber,141) set flag(HHS, true)
if equal(ModemNumber,142) set string(MiscString1,"AT&F&C1&D22S11=55")
if equal(ModemNumber,143) set string(MiscString1,"AT&F&C1&D2&I0E1V1Q0X3\X0\V1\Q2\R2\N3%C1")
if equal(ModemNumber,143) set flag(HHS, true)
if equal(ModemNumber,144) set string(MiscString1,"AT&F&C1&D2N3\N3\Q3\V1\X1S11=55")
if equal(ModemNumber,144) set flag(HHS, true)
if equal(ModemNumber,145) set string(MiscString1,"AT&F&C1&D2S11=55")
if equal(ModemNumber,146) set string(MiscString1,"AT&F&C1&D2&K3\N35S11=55S95=2")
if equal(ModemNumber,146) set flag(HHS, true)
if equal(ModemNumber,147) set string(MiscString1,"AT&FX4&C1&D2\J0\Q3\V2\X1S11=55")
if equal(ModemNumber,147) set flag(HHS,true)
if equal(ModemNumber,148) set string(MiscString1,"ATE1V1Q0S0=0X1")
if equal(ModemNumber,148) set flag(HHS,false)
if equal(ModemNumber,149) set string(MiscString1,"AT&F0E1V1Q0X4&C1&D2&R0\N3&K3%C3")
if equal(ModemNumber,149) set flag(HHS,True)
if equal(ModemNumber,150) set string(MiscString1,"AT&FX3W0&C1&D2&K3\N5")
if equal(ModemNumber,150) set flag(HHS,True)
if equal(ModemNumber,151) set string(MiscString1,"AT&FE1V1Q0X4&C1&D2\J0\N3\X1S11=55")
if equal(ModemNumber,151) set flag(HHS,True)
if equal(ModemNumber,152) set string(MiscString1,"AT&FE1V1Q0X4&C1&D2\N3\V1%C1S11=55")
if equal(ModemNumber,152) set flag(HHS,True)
if equal(ModemNumber,153) set string(MiscString1,"AT&FE1V1Q0X4&C1&D2&K3\V1\J0\N3\Q3S11=55")
if equal(ModemNumber,153) set flag(HHS,True)
AddExtraCmds:
if length("/(ExtraMdmCmds)",MiscInt2)
ifnot string match(InitString2, "AT") set string(InitString2, "AT")
set string(InitString2,"/(InitString2)/(ExtraMdmCmds)")
endif
goto InitializeModem
NEC_ISDterm:
set string(MiscString1,"NEC")
if flag(VoiceCall) goto ErrVoiceThruDeskset
character delay(50)
set integer(MiscInt2,6)
NEC_ISDterm1:
if equal(MiscInt2,6) set integer(MaxCallAttempts,9600)
if equal(MiscInt2,5) set integer(MaxCallAttempts,19200)
if equal(MiscInt2,4) set integer(MaxCallAttempts,4800)
if equal(MiscInt2,3) set integer(MaxCallAttempts,2400)
if equal(MiscInt2,2) set integer(MaxCallAttempts,1200)
if equal(MiscInt2,1) set integer(MaxCallAttempts,300)
ifnot flag(DirectCable) setting("baud",MaxCallAttempts)
type("AT/r")
if wait text("OK",1)
set integer(BaudRate,MaxCallAttempts)
option("xprotocol",on)
goto CheckCD
elseif decrement(MiscInt2)
goto NEC_ISDterm1
else
goto ErrNoModemResponse
endif
NEC_Modem:
set string(MiscString1,"AT&FE1V1Q0X4&C1&D2L1/(ExtraMdmCmds)")
set flag(HHS,true)
type("/(MiscString1)/r")
ifnot wait text("OK") goto ErrNoModemResponse
type("AT</r")
ifnot wait text("*") goto ErrNoModemResponse
type("C1 T1/r")
ifnot wait text("OK") end()
type("Q/r")
ifnot wait text("OK") goto ErrNoModemResponse
goto ContinueModemInit
Fujitsu:
set string(MiscString1,"Fujitsu")
if flag(VoiceCall) goto ErrVoiceThruDeskset
set string(ModemName, "/(PhoneNumber)")
ifnot truncate(ModemName,"//") set string(ModemName, "ADPS")
if string match(ModemName, "ADPS") goto Fujitsu1
ifnot string match(ModemName, "ABCS") goto ErrInvalidDataMode
if greater(MaxCallAttempts,9600) goto ErrUnsupportedRate
Fujitsu1:
character delay(50)
type ("AT/r")
wait seconds(1)
if screen match("1>",1) goto Fujitsu2
type("ATMENU/r")
ifnot wait line(1,2) goto ErrNoModemResponse
ifnot wait text("1>",1) goto ErrNoModemResponse
Fujitsu2:
type("/(ModemName):/r")
ifnot wait line(1,2) goto ErrNoModemResponse
ifnot wait text("1>",1) goto ErrNoModemResponse
type("END/r")
if wait text("OK",2) goto Fujitsu3
Fujitsu3:
ifnot wait line(1,1) prompt("/n")
type("AT%P0/r")
if equal(MaxCallAttempts,9600) goto Fujitsu4
setting("baud", 9600)
ifnot wait text("OK",2) goto ErrNoModemResponse
setting("baud",MaxCallAttempts)
type("AT/r")
Fujitsu4:
ifnot wait text("OK",2) goto ErrNoModemResponse
type("ATS54=1/r")
ifnot wait text("OK",2) goto ErrNoModemResponse
type("ATS56=5/r")
ifnot wait text("OK",2) goto ErrNoModemResponse
option("xprotocol",on)
goto CheckCD
Telrad:
ifnot flag(VoiceCall) goto Telrad1
set string(MiscString1,"Telrad")
goto ErrVoiceThruDeskset
Telrad1:
set string(ModemName, "/(PhoneNumber)")
ifnot cut(ModemName,"//") goto Telrad2
truncate(PhoneNumber,"//")
if string match(ModemName,"B") set integer(IrqLevel,70)
if string match(ModemName,"b") set integer(IrqLevel,70)
if equal(IrqLevel,70) goto UncommandedModems
Telrad2:
character delay(50)
set integer(MiscInt2,7)
Telrad3:
if equal(MiscInt2,7) set integer(MaxCallAttempts,9600)
if equal(MiscInt2,6) set integer(MaxCallAttempts,4800)
if equal(MiscInt2,5) set integer(MaxCallAttempts,2400)
if equal(MiscInt2,4) set integer(MaxCallAttempts,1200)
if equal(MiscInt2,3) set integer(MaxCallAttempts,300)
if equal(MiscInt2,2) set integer(MaxCallAttempts,1800)
if equal(MiscInt2,1) set integer(MaxCallAttempts,600)
setting("baud",MaxCallAttempts)
type("/r")
if wait text("*",2) goto Telrad4
if decrement(MiscInt2) goto Telrad3
goto ErrNoModemResponse
Telrad4:
setting("outgoing hhs",0)
setting("incoming hhs",0)
type("PROF 4/r")
wait seconds(1)
setting("baud",9600)
type("/r")
ifnot wait line(1,2) goto ErrNoModemResponse
ifnot wait text("*",1) goto ErrNoModemResponse
if equal(BaudRate,9600) goto Telrad5
set integer(MaxCallAttempts,2)
if equal(BaudRate,4800) set integer(MaxCallAttempts,13)
if equal(BaudRate,2400) set integer(MaxCallAttempts,12)
if equal(BaudRate,1800) set integer(MaxCallAttempts,7)
if equal(BaudRate,1200) set integer(MaxCallAttempts,3)
if equal(BaudRate,600) set integer(MaxCallAttempts,4)
type("set 11:/(MaxCallAttempts)/r")
wait seconds(1)
setting("baud",BaudRate)
type("/r")
ifnot wait line(1,2) goto ErrNoModemResponse
ifnot wait text("*",2) goto ErrNoModemResponse
Telrad5:
type("set 2:0,101:32,103:16,104:80,126:1,130:0/r")
ifnot wait line(1,3) goto ErrNoModemResponse
ifnot wait text("*",3) goto ErrNoModemResponse
set flag(HHS, true)
goto CheckCD
ATT:
if flag(ATT_Initialized) goto CheckCD
if flag(VoiceCall)
set string(MiscString1,"AT&T")
goto ErrVoiceThruDeskset
else
character delay(50)
set integer(MiscInt2,6)
endif
ATT2:
if equal(MiscInt2,6) set integer(MaxCallAttempts,9600)
if equal(MiscInt2,5) set integer(MaxCallAttempts,19200)
if equal(MiscInt2,4) set integer(MaxCallAttempts,4800)
if equal(MiscInt2,3) set integer(MaxCallAttempts,2400)
if equal(MiscInt2,2) set integer(MaxCallAttempts,1200)
if equal(MiscInt2,1) set integer(MaxCallAttempts,300)
setting("baud",MaxCallAttempts)
break()
wait seconds(1)
type("at/r")
if wait text("CMD:",1) goto ATT3
if decrement(MiscInt2) goto ATT2
goto ErrNoModemResponse
ATT3:
type("set au on/r")
ifnot wait line(1,2) goto ErrNoModemResponse
ifnot wait text("CMD:",2) goto ErrNoModemResponse
setting("baud",9600)
break()
wait seconds(1)
type("at/r")
ifnot wait line(1,2) goto ErrNoModemResponse
ifnot wait text("CMD:",1) goto ErrNoModemResponse
type("copy p0 to active/r")
ifnot wait line(1,2) goto ErrNoModemResponse
ifnot wait text("CMD:",2) goto ErrNoModemResponse
setting("baud",BaudRate)
break()
wait seconds(1)
type("at/r")
ifnot wait line(1,2) goto ErrUnsupportedRate
ifnot wait text("CMD:",2) goto ErrUnsupportedRate
type("set dcd fo/r")
ifnot wait line(1,2) goto ErrNoModemResponse
ifnot wait text("CMD:",1) goto ErrNoModemResponse
type("set dtr fo/r")
ifnot wait line(1,2) goto ErrNoModemResponse
ifnot wait text("CMD:",1) goto ErrNoModemResponse
if string match(ModemName, "D Channel")
type("set mode DX25/r")
else
type("set mode B2/r")
endif
ifnot wait line(1,2) goto ErrNoModemResponse
ifnot wait text("CMD:",1) goto ErrNoModemResponse
type("set rec eia/r")
ifnot wait line(1,2) goto ErrNoModemResponse
ifnot wait text("CMD:",1) goto ErrNoModemResponse
type("set tran eia/r")
ifnot wait line(1,2) goto ErrNoModemResponse
ifnot wait text("CMD:",1) goto ErrNoModemResponse
type("set an man/r")
ifnot wait line(1,2) goto ErrNoModemResponse
ifnot wait text("CMD:",1) goto ErrNoModemResponse
set flag(HHS, true)
goto CheckCD
Fastcomm:
character delay(250)
if greater(BaudRate,8000) setting("baud",2400)
hangup()
gosub Fastcomm2
ifnot flag(MiscFlag1) goto ErrNoModemResponse
if less(BaudRate,8000) goto Fastcomm1
setting("baud",BaudRate)
hangup()
gosub Fastcomm2
ifnot flag(MiscFlag1) goto ErrNoModemResponse
Fastcomm1:
set flag(MiscFlag1,false)
character delay(50)
if greater(BaudRate,3000) set flag(HHS,true)
type("AT#FQ0S0=0#LCN#LDN#LX3#LRF/(ExtraMdmCmds)#W/r")
ifnot wait text("OK",3) goto ErrNoModemResponse
ifnot wait line(1,2) goto ErrNoModemResponse
hangup()
goto ContinueModemInit
Fastcomm2:
set flag(MiscFlag1,false)
gosub Fastcomm4
if wait text("OK",3) goto Fastcomm3
gosub Fastcomm4
if wait text("OK",3) goto Fastcomm3
return()
Fastcomm3:
ifnot wait line(1,1) prompt("/n")
set flag(MiscFlag1,true)
return()
Fastcomm4:
set integer(MiscInt2,5)
Fastcomm5:
type("A")
if wait text("A",1) goto Fastcomm6
if decrement(MiscInt2) goto Fastcomm5
Fastcomm6:
type("T/r")
return()
Telebit:
set string(ModemInitString,"/(MiscString1)")
if flag(OS2)
set integer(MiscInt2, 6)
goto Telebit1
endif
if equal(ModemNumber, 37)
set integer(MiscInt2, 8)
else
set integer(MiscInt2,7)
endif
Telebit1:
if equal(MiscInt2,8) set integer(MaxCallAttempts,57600)
if equal(MiscInt2,7) set integer(MaxCallAttempts,38400)
if equal(MiscInt2,6) set integer(MaxCallAttempts,19200)
if equal(MiscInt2,5) set integer(MaxCallAttempts,9600)
if equal(MiscInt2,4) set integer(MaxCallAttempts,4800)
if equal(MiscInt2,3) set integer(MaxCallAttempts,2400)
if equal(MiscInt2,2) set integer(MaxCallAttempts,1200)
if equal(MiscInt2,1) set integer(MaxCallAttempts,300)
ifnot equal(ModemNumber,42) goto Telebit2
divide(MaxCallAttempts,10)
multiply(MaxCallAttempts,9)
Telebit2:
setting("baud",MaxCallAttempts)
type("AT&F/r")
if wait text("OK",1) goto Telebit3
if decrement(MiscInt2) goto Telebit1
goto ErrNoModemResponse
Telebit3:
setting("baud",9600)
set integer(MiscInt2,5)
if equal(BaudRate,300) set integer(MiscInt2,0)
if equal(BaudRate,1200) set integer(MiscInt2,1)
if equal(BaudRate,2400) set integer(MiscInt2,2)
if equal(BaudRate,4800) set integer(MiscInt2,3)
if equal(BaudRate,9600) set integer(MiscInt2,4)
if equal(BaudRate,19200) set integer(MiscInt2,5)
if equal(BaudRate,38400) set integer(MiscInt2,6)
if equal(BaudRate,57600) set integer(MiscInt2,7)
if equal(ModemNumber, 88)
set string(ModemInitString,"/(ModemInitString)X2S51=/(MiscInt2)")
elseif equal(ModemNumber, 65)
set string(ModemInitString,"ATE1V1Q0X2S11=50S51=/(MiscInt2)")
elseif equal(ModemNumber, 37)
set string(ModemInitString,"ATE1V1Q0X2S11=50S51=/(MiscInt2)")
elseif equal(ModemNumber, 51)
set string(ModemInitString,"/(ModemInitString)X3S51=/(MiscInt2)")
else
set string(ModemInitString,"/(ModemInitString)X3S51=/(MiscInt2)I")
endif
wait seconds(1)
character delay(50)
type("/(ModemInitString)/r")
ifnot wait text("OK",3) goto ErrNoModemResponse
if equal(ModemNumber,51) goto Telebit4
ifnot screen match("96",2) goto Telebit4
ifnot get integer(MiscInt2,"/(MiscString1)") goto Telebit4
ifnot equal(MiscInt2,961) set integer(ModemNumber,41)
Telebit4:
if wait line(1,1) goto Telebit5
prompt("/n")
Telebit5:
setting("baud",BaudRate)
if equal(ModemNumber,42) gosub SetFastlinkSub
character delay(50)
set flag(HHS,true)
if equal(ModemNumber, 88)
set string(MiscString1,"AT&C1&D2S58=2S59=15/(ExtraMdmCmds)")
elseif equal(ModemNumber, 65)
set string(MiscString1,"AT&C1&D2S58=2S59=15/(ExtraMdmCmds)")
elseif equal(ModemNumber, 37)
set string(MiscString1,"AT&C1&D2S58=2S59=15/(ExtraMdmCmds)")
elseif equal(ModemNumber, 51)
set string(MiscString1,"ATS52=1S53=1S58=2S66=1S95=2/(ExtraMdmCmds)")
else
set string(MiscString1,"ATS52=1S53=1S58=2S66=1/(ExtraMdmCmds)")
endif
wait seconds(1)
goto InitializeModem
WorldBlazer:
option("Blank", yes)
option("Display Ascii", yes)
option("Tenths", yes)
type("AT/r",0)
if wait text("OK",1)
ifnot wait line(1,1) greater(2,1)
option("Blank", no)
option("Display Ascii", no)
option("Tenths", no)
goto TelebitInit
else
length(ModemName, MiscInt1)
add(MiscInt1, 20)
option("Blank", no)
option("use menu colors", yes)
option("Blink", yes)
position(3,MiscInt1)
prompt("(Hunting for DTE rate...)")
option("Blank", yes)
option("use menu colors", no)
option("Blink", no)
position(6,1)
endif
set integer(BaudIndex, 13)
set flag(SlowOS2, false)
if flag(OS2)
if less(OSVersion, 200)
set flag(SlowOS2, True)
endif
endif
goto HuntLoop
HuntLoop:
if equal(BaudIndex,13)
if and(OS2, SlowOS2) goto NextBaudIndex
set integer(TempBaud,38400)
elseif equal(BaudIndex,12)
set integer(TempBaud,19200)
elseif equal(BaudIndex,11)
set integer(TempBaud,9600)
elseif equal(BaudIndex,10)
set integer(TempBaud,2400)
elseif equal(BaudIndex,9)
if and(OS2, SlowOS2) goto NextBaudIndex
set integer(TempBaud,57600)
elseif equal(BaudIndex,8)
if and(OS2, SlowOS2) goto NextBaudIndex
set integer(TempBaud,115200)
elseif equal(BaudIndex,7)
if and(OS2, SlowOS2) goto NextBaudIndex
set integer(TempBaud,76800)
elseif equal(BaudIndex,6)
if and(OS2, SlowOS2) goto NextBaudIndex
set integer(TempBaud,14400)
elseif equal(BaudIndex,5)
if and(OS2, SlowOS2) goto NextBaudIndex
set integer(TempBaud,12000)
elseif equal(BaudIndex,4)
if and(OS2, SlowOS2) goto NextBaudIndex
set integer(TempBaud,7200)
elseif equal(BaudIndex,3)
if and(OS2, SlowOS2) goto NextBaudIndex
set integer(TempBaud,4800)
elseif equal(BaudIndex,2)
set integer(TempBaud,1200)
elseif equal(BaudIndex,1)
set integer(TempBaud,300)
endif
setting("Baud",TempBaud)
type("AT/r",0)
if wait text("OK",1)
ifnot wait line(1,1) greater(2,1)
option("Tenths", no)
option("Blank", no)
option("use menu colors", yes)
position(3,MiscInt1)
prompt(" ")
option("use menu colors", no)
position(6,1)
option("Blank", no)
option("Display Ascii", no)
position(5,1)
goto TelebitInit
endif
NextBaudIndex:
if decrement(BaudIndex) goto HuntLoop
option("Blank", no)
option("Display Ascii", no)
option("Tenths", no)
goto ErrNoModemResponse
TelebitInit:
if equal(BaudRate,115200)
set integer(BaudIndex,9)
elseif equal(BaudRate,76800)
set integer(BaudIndex,8)
elseif equal(BaudRate,57600)
set integer(BaudIndex,7)
elseif equal(BaudRate,38400)
set integer(BaudIndex,6)
elseif equal(BaudRate,19200)
set integer(BaudIndex,5)
elseif equal(BaudRate,14400)
set integer(BaudIndex,46)
elseif equal(BaudRate,12000)
set integer(BaudIndex,43)
elseif equal(BaudRate,9600)
set integer(BaudIndex,4)
elseif equal(BaudRate,7200)
set integer(BaudIndex,35)
elseif equal(BaudRate,4800)
set integer(BaudIndex,3)
elseif equal(BaudRate,2400)
set integer(BaudIndex,2)
elseif equal(BaudRate,1200)
set integer(BaudIndex,1)
elseif equal(BaudRate,300)
set integer(BaudIndex,0)
endif
position(6,1)
type("AT&F&C1&D2X2S11=55S51=/(BaudIndex)S58=2S59=15S69=2S92=1/(ExtraMdmCmds)/r",0)
ifnot wait text("OK",3) goto ErrNoModemResponse
ifnot wait line(1,1) greater(2,1)
setting("baud",BaudRate)
set flag(HHS,true)
goto ContinueModemInit
Rixon:
wait seconds(1)
type("/r/r")
ifnot wait text("$",10) goto ErrNoModemResponse
wait seconds(1)
type("NU")
ifnot wait text("OK",3) goto ErrNoModemResponse
goto ContinueModemInit
USR2400E:
set integer(MiscInt2,7)
USR2400E1:
type("AT/r")
if wait text("OK",1) goto USR2400E2
if equal(MiscInt2,7) setting("baud",2400)
if equal(MiscInt2,6) setting("baud",19200)
if equal(MiscInt2,5) setting("baud",9600)
if equal(MiscInt2,4) setting("baud",4800)
if equal(MiscInt2,3) setting("baud",1200)
if equal(MiscInt2,2) setting("baud",300)
if equal(MiscInt2,1) setting("baud",600)
if decrement(MiscInt2) goto USR2400E1
goto ErrNoModemResponse
USR2400E2:
ifnot wait lines(1,3) prompt("/n")
if less(BaudRate,300) type("AT &F/r")
if equal(BaudRate,19200) type("AT&F&B7/r")
if equal(BaudRate,9600) type("AT&F&B6/r")
if equal(BaudRate,4800) type("AT&F&B5/r")
if equal(BaudRate,2400) type("AT&F&B4/r")
if equal(BaudRate,1200) type("AT&F&B3/r")
if equal(BaudRate,600) type("AT&F&B2/r")
if equal(BaudRate,300) type("AT&F&B1/r")
ifnot wait text("OK",3) goto ErrNoModemResponse
ifnot wait lines(1,3) prompt("/n")
setting("baud",BaudRate)
set flag(HHS,true)
type("ATE1S0=0X4&H1&R2&D2&C1/(ExtraMdmCmds)/r")
if wait text("OK",3) goto ContinueModemInit
goto ErrNoModemResponse
USR2400:
set string(ModemName,"/(MiscString1)")
type("AT S14?/r")
ifnot wait text("OK",3) goto ErrNoModemResponse
ifnot wait lines(1,2) goto USR24001
USR24001:
if screen match("000",5) set string(ModemName,"/(ModemName) &C1&D2")
set string(MiscString1,"/(ModemName)")
if length("/(ExtraMdmCmds)",MiscInt2) set string(MiscString1,"/(MiscString1) /(ExtraMdmCmds)")
goto InitializeModem
Convertible:
option("receive line feeds",yes)
set string(MiscString1,"/x0EL 0,F 4,C 0,S 2")
if equal(BaudRate,300) set string(MiscString1,"/x0EL 0,F 4,C 0,S 1")
if equal(BaudRate,110) set string(MiscString1,"/x0EL 0,F 4,C 0,S 0")
if length("/(ExtraMdmCmds)",MiscInt2) set string(MiscString1,"/(MiscString1) /(ExtraMdmCmds)")
setting("baud",1200)
type("/(MiscString1)/r")
if wait text("OK",3) goto ContinueModemInit
setting("baud",300)
type("/(MiscString1)/r")
if wait text("OK",3) goto ContinueModemInit
setting("baud",110)
type("/(MiscString1)/r")
if wait text("OK",3) goto ContinueModemInit
goto ErrNoModemResponse
Avatex:
set string(MiscString1,"in. ")
if equal(BaudRate,300) goto Avatex1
ifnot equal(BaudRate,1200) goto ErrUnsupportedRate
set string(MiscString1,"out.")
Avatex1:
position(3,3)
prompt("The DATA//VOICE button should be in and the 300//1200 button should be /(MiscString1)")
goto DisplayModemName
MultiTech:
set flag(HHS,true)
type("AT&FX4B0$BA0S11=55$SB/(BaudRate)/r")
gosub CheckResponse
type("AT&E1&E4&E7&E13/(ExtraMdmCmds)/r")
gosub CheckResponse
type("AT/r")
gosub CheckResponse
goto ContinueModemInit
Microcom:
;Modem number 44 = Microcom QX/4232hs
;Modem number 123 = Microcom QX/4232bis
if equal(ModemNumber, 44) set integer(LoopCount,6)
if equal(ModemNumber, 123) set integer(LoopCount,8)
if flag(OS2)
ifnot equal(OSVersion, 200) set integer(LoopCount, 6)
endif
Microcom1:
if equal(LoopCount,8) set integer(TempBaud,115200)
if equal(LoopCount,7) set integer(TempBaud,38400)
if equal(LoopCount,6) set integer(TempBaud,9600)
if equal(LoopCount,5) set integer(TempBaud,19200)
if equal(LoopCount,4) set integer(TempBaud,4800)
if equal(LoopCount,3) set integer(TempBaud,2400)
if equal(LoopCount,2) set integer(TempBaud,1200)
if equal(LoopCount,1) set integer(TempBaud,300)
ifnot setting("baud", TempBaud)
if decrement(LoopCount)
goto Microcom1
else
goto ErrNoModemResponse
endif
endif
type("AT&F/r")
if wait text("OK",1)
ifnot wait lines(1,1) prompt("/n")
goto Microcom2
endif
if decrement(LoopCount) goto Microcom1
goto ErrNoModemResponse
Microcom2:
if less(TempBaud, 2401) goto Microcom3
type("AT%U/r")
gosub CheckResponse
Microcom3:
setting("baud", BaudRate)
if equal(ModemNumber, 123)
set string(MiscString1,"AT&F&C1&D2\J0\N3\Q3\V2W2-M\X1S0=0S11=55")
else
set string(MiscString1,"ATS0=0X4&C1&D2\J0\N3\Q3")
endif
set flag(HHS,true)
type("/(MiscString1)/r")
gosub CheckResponse
Microcom4:
if length("/(ExtraMdmCmds)", MiscInt1)
ifnot string match(InitString2, "AT") set string(InitString2, "AT")
set string(InitString2,"/(InitString2)/(ExtraMdmCmds)")
type("/(InitString2)/r")
gosub CheckResponse
endif
goto ContinueModemInit
Concord:
type("AT Z/r")
if wait text("OK",3) goto Concord1
ifnot screen match(">",1) goto ErrNoModemResponse
type("SMC/r")
if wait text("OK",3) goto Concord1
goto ErrNoModemResponse
Concord1:
if wait line(1,1) goto Concord2
Concord2:
type("AT@ SMD2 SMF0 SLCA2 SPF2 SLCB0 SLCF1 SLCD1 /(ExtraMdmCmds) SAVE/r")
ifnot wait text("OK",3) goto ErrNoModemResponse
if wait line(1,1) goto Concord3
Concord3:
set flag(HHS,true)
set string(MiscString1,"AT X1 S0=0")
goto InitializeModem
UserDefined:
ifnot read from("modemdef.dat") goto ErrNoModemDef
ifnot read string(UserDefCall,"") goto ErrBadModemDef
ifnot read string(UserDefAnswer, "") goto ErrBadModemDef
ifnot read string(UserDefDial, "") goto ErrBadModemDef
ifnot read string(UserDefHangup, "") goto ErrBadModemDef
ifnot read string(UserDefCD, "") goto ErrBadModemDef
ifnot read string(UserDefToggleDTR, "") goto ErrBadModemDef
ifnot read string(UserDefHHS, "") goto ErrBadModemDef
read from("")
set flag(UserDefinedModem, true)
set string(MiscString1, UserDefCall)
if length("/(ExtraMdmCmds)",MiscInt2) set string(MiscString1,"/(MiscString1)/(ExtraMdmCmds)")
if string match(UserDefHHS,"YES")
set flag(HHS, true)
else
set flag(HHS, false)
endif
gosub SetFlowControl
goto InitializeModem
InitializeModem:
gosub CheckAbort
type("/(MiscString1)/r")
ifnot wait text("OK",5) goto ErrNoModemResponse
ifnot wait lines(1,1) goto ErrNoModemResponse
if equal(ModemNumber,47) goto Rixon
if length(InitString2, MiscInt1)
type("/(InitString2)/r")
ifnot wait text("OK",5) goto ErrNoModemResponse
ifnot wait lines(1,1) goto ErrNoModemResponse
endif
ContinueModemInit:
ifnot flag(DirectCable) setting("baud",BaudRate)
if equal(ModemNumber,42) gosub SetFastlinkSub
wait seconds(1)
ifnot equal(ModemNumber,47) goto CheckCD
type("ATZ/r")
wait seconds(1)
CheckCD:
if wait carrier(0,0) set flag(CD_High,true)
SetCallAttempts:
if flag(UK_Version)
set integer(MaxCallAttempts,4)
else
set integer(MaxCallAttempts,20)
endif
set integer(CallAttempt,0)
MainDialingLoop:
character delay(50)
wait seconds(1)
add(CallAttempt,1)
ifnot flag(UK_Version) goto ClearOldDialCommands
if equal(CallAttempt,2) goto ErrNoDataConnection
ClearOldDialCommands:
if flag(VoiceCall) gosub VoiceInstructions
ifnot flag(VoiceCall) gosub DisplayBanners4
position(3,5)
if flag(VoiceCall) position(10,3)
option("use menu colors",yes)
WaitForDialtone:
ifnot string match(PhoneNumber,"$") goto SetDialCommand
truncate(PhoneNumber,"$")
prompt("Calling attempt #/(CallAttempt) (press ENTER when you hear dialtone):/n/n/n")
option("use menu colors",no)
type("ATH1/r")
wait seconds(1)
key string(DialType,"")
position(3,5)
if flag(VoiceCall) position(10,3)
SetDialCommand:
if flag(LeasedLine)
option("use menu colors", no)
wipe screen()
goto DirectCableCall
endif
option("use menu colors",yes)
ifnot flag(UK_Version) prompt("Calling attempt #/(CallAttempt) (press SPACEBAR to redial immediately)/n/n/n")
if flag(UK_Version) prompt("Calling attempt #/(CallAttempt)/n/n/n")
option("use menu colors",no)
if flag(UserDefinedModem)
set string(MiscString1, UserDefDial)
goto SendDialCommand
endif
if flag(ISDN_Support) goto SendDialCommand
set string(MiscString1,"ATDT")
if string match(DialType,"P") set string(MiscString1,"ATDP")
if equal(ModemNumber,61) set string(MiscString1,"di ")
if equal(ModemNumber,62) set string(MiscString1,"")
if equal(ModemNumber,63) set string(MiscString1,"ATD")
if equal(ModemNumber,64) set string(MiscString1,"ATD")
if equal(ModemNumber,79) set string(MiscString1,"ATD")
ifnot equal(ModemNumber,49) goto SetDialCommand1
if truncate(PhoneNumber,";") goto SetDialCommand1
SetDialCommand1:
ifnot equal(ModemNumber,45) goto SendDialCommand
set string(MiscString1,"/x0ED ")
ifnot string match(PhoneNumber,";") goto SetDialCommand2
set string(MiscString1,"/x0EV ,D ")
SetDialCommand2:
if string match(DialType,"P") set string(MiscString1,"/(MiscString1)I")
SendDialCommand:
gosub CheckAbort
if flag(ISDN_Support)
set flag(HHS, true)
if call("/(PhoneNumber)") then goto SetDateFlag else goto SetDateFlag
endif
type("/(MiscString1)/(PhoneNumber)/r")
if flag(VoiceCall) set integer(EscBranch,790)
if flag(DateTime) goto NonDialableModem
SetDateFlag:
set flag(DateTime,true)
gosub TimeDateSub
NonDialableModem:
if flag(NonDialable) goto LogCall
WaitConnection:
if flag(ISDN_Support)
set integer(LoopCount, 35)
else
set integer(LoopCount, 70)
endif
ConnectionLoop:
if wait line(1,2) goto MatchResultMessage
MatchResultMessage:
gosub CheckAbort
if get key(MiscString1) goto KeyPressed
if screen match("NO CON",2) goto NoConnection
if screen match("NO ANS",2) goto NoConnection
if screen match("NECT",2) goto LogCall
if screen match("NO CARRIER",2) goto NoConnection
if screen match("BUSY",2) goto NoConnection
if screen match("NO DIAL",2) goto ErrNoPhoneLine
if screen match("BLACKL",2) goto ErrBlackList
if screen match("OK",2)
get position(Row,Col)
subtract(Row, 2)
position(Row,1)
wipe screen(2,80)
goto ConnectionLoop
endif
if flag(CD_High) goto ContinueLoop
ifnot wait carrier(0,0) goto ContinueLoop
if wait carrier(2,2) goto LogCall
ContinueLoop:
if decrement(LoopCount) goto ConnectionLoop
goto KeyPressedHangup
KeyPressed:
if string match(MiscString1," ") goto KeyPressedHangup
ifnot flag(VoiceCall) goto KeyPressedBeep
if string match(MiscString1,"<ENTER>") goto LogCall
KeyPressedBeep:
prompt("/x07")
goto ContinueLoop
KeyPressedHangup:
ifnot flag(ISDN_Support)
type(" ",30)
ifnot wait line(1,2) greater(2,1)
type("ATH0/r",0)
ifnot wait line(1,2) hangup()
else
hangup()
endif
NoConnection:
if flag(ISDN_Support) wait seconds(10)
if equal(CallType, 0) goto Redial
put environment("HA_CALL_STATUS","NO CONNECTION")
type("<ALT-L>SS")
end()
Redial:
ifnot flag(VoiceCall) goto RedialCheck
if flag(ISDN_Support) goto RedialCheck
type("ATH0/r")
if wait text("OK",3) goto RedialCheck
RedialCheck:
if decrement(MaxCallAttempts)
if equal(ModemNumber,82) wait seconds(1)
goto MainDialingLoop
endif
set string(MiscString1,"Dialed /(PhoneNumber) 20 times w//o connecting.")
gosub DisplayBanners
goto _Error
LogCall:
if screen match("NECT",1) goto LogCall3
set integer(MaxCallAttempts, 10)
LogCall1:
if flag(VoiceCall) goto LogCall3
if screen match("NECT",2) goto LogCall3
if wait line(1,1) goto LogCall2
LogCall2:
if decrement(MaxCallAttempts) goto LogCall1
LogCall3:
set string(ConnectMessage, "/S(9)")
call connected("/(SystemName)")
put environment("HA_CALL_STATUS","CONNECTED")
ifnot flag(Logging) goto AdjustBaudRate
ifnot write to("/(LogFileName)") goto AdjustBaudRate
gosub LoggingName
if flag(VoiceCall) set string(NamePlusPhone,"/(NamePlusPhone), (Voice)")
ifnot write("/r/nCalled /(NamePlusPhone), /(ModemName) /(ConnectTime)") goto AdjustBaudRate
;if flag(DirectCable) return()
if flag(VoiceCall) goto VoiceCalls
LogCall4:
set integer(EscBranch,540)
set string(ModemName,"Duration = //DURATION (min:sec)/r/n/r/n")
if flag(VoiceCall) set string(ModemName,"Duration of data portion of call = //DURATION (min:sec)/r/n")
set flag(VoiceCall, FALSE)
log duration(ModemName,"/(LogFileName)")
AdjustBaudRate:
if flag(VoiceCall) goto VoiceCalls
if equal(ModemNumber,17) goto AdjustBaudRate1
if equal(ModemNumber,23) goto AdjustBaudRate1
if flag(HHS) goto ConfigureTerminal
AdjustBaudRate1:
ifnot screen match("NECT",3) goto ConfigureTerminal
ifnot get integer(MiscInt2,"/S(9)") goto ConfigureTerminal
ifnot equal(ModemNumber,17) goto AdjustBaudRate2
if greater(MiscInt2,3000) goto ConfigureTerminal
AdjustBaudRate2:
if equal(MiscInt2,300) goto AdjustBaudRate3
if equal(MiscInt2,600) goto AdjustBaudRate3
if equal(MiscInt2,1200) goto AdjustBaudRate3
if equal(MiscInt2,2400) goto AdjustBaudRate3
if equal(MiscInt2,4800) goto AdjustBaudRate3
if equal(MiscInt2,9600) goto AdjustBaudRate3
if equal(MiscInt2,19200) goto AdjustBaudRate3
goto ConfigureTerminal
AdjustBaudRate3:
ifnot equal(MiscInt2,BaudRate) set integer(BaudRate,MiscInt2)
ConfigureTerminal:
if flag(ViewDataEmulation) wipe screen()
load system("/(SystemName)",true)
ifnot flag(DirectCable) setting("baud",BaudRate)
option("BOTTOM LINE", yes)
gosub SetFlowControl
ifnot equal(ModemNumber,45) goto CheckLogon
type("/x0ET 0/r")
wait seconds(2)
option("receive line feeds",no)
CheckLogon:
ifnot flag(ViewDataEmulation)
option("use menu colors",yes)
get position(MiscInt2,CallAttempt)
if equal(ModemNumber,97) add(MiscInt2,2)
if equal(ModemNumber,98) add(MiscInt2,2)
if equal(ModemNumber,99) add(MiscInt2,2)
add(MiscInt2,1)
if string match(ModemName,"Direct-cabled (no modem)") decrement(MiscInt2)
position(MiscInt2,1)
option("bold",yes)
draw box(3,80)
option("bold",no)
add(MiscInt2,1)
position(MiscInt2,3)
set string(MiscString1,"You are now connected with")
if length("/(SystemName)",MiscInt2) prompt("/(MiscString1) /(SystemName)./n")
if equal(MiscInt2,0) prompt("/(MiscString1) /(PhoneNumber)./n")
option("use menu colors",no)
ifnot length("/(LogonScript)",MiscInt2) goto NoLogonConnection
else
wipe screen()
position(1,1)
option("use menu colors",yes)
option("bold",yes)
draw box(5,40)
option("bold",no)
position(2,4)
prompt("You are now connected with:")
position(3,4)
prompt(SystemName)
position(4,4)
left(ConnectMessage,30)
prompt(ConnectMessage)
option("use menu colors",no)
position(5,1)
ifnot length(LogonScript, MiscInt1) goto NoLogonConnection
endif
RunLogon:
option("use menu colors",yes)
ifnot flag(ViewDataEmulation)
get position(MiscInt2,CallAttempt)
add(MiscInt2,1)
position(MiscInt2,1)
option("bold",yes)
draw box(3,80)
option("bold",no)
add(MiscInt2,1)
position(MiscInt2,3)
if string match(LogonScript, "LEARNING") goto LearnLogon
prompt("HyperACCESS//5 will now run the logon script named: /(LogonScript)/n/n/n")
else
position(6,1)
option("bold",yes)
if string match(LogonScript, "LEARNING")
draw box(4,40)
else
draw box(5,40)
endif
option("bold",no)
position(7,4)
if string match(LogonScript, "LEARNING") goto LearnLogon
prompt("HyperACCESS//5 will now run the")
position(8,4)
prompt("logon script named:")
position(9,4)
left(LogonScript,20)
prompt("/(LogonScript)/n/n/n")
endif
option("use menu colors",no)
set integer(EscBranch,570)
run("/(LogonScript)")
get environment(MiscString1,"HA_SCRIPT_STATUS")
put environment("HA_CALL_STATUS","/(MiscString1)")
end()
LearnLogon:
put environment("HA_CALL_STATUS","OK")
ifnot flag(ViewDataEmulation)
prompt("HyperACCESS//5 will now learn a logon script./n/n/n")
else
prompt("HyperACCESS//5 will now learn")
position(8,4)
prompt("a logon script./n/n/n")
endif
option("use menu colors",no)
set integer(EscBranch,570)
type("<ALT-L><ALT-L>CALL")
end()
NoLogonConnection:
put environment("HA_CALL_STATUS","OK")
prompt("/n/n")
set integer(EscBranch,570)
NoLogonConnection1:
type("<ALT-L>SS")
end()
UncommandedModems:
set flag(NonDialable,true)
if equal(ModemNumber,99) goto AutodialModems
position(2,3)
option("use menu colors",yes)
option("bold",no)
prompt("Manually place the call to /(PhoneNumber).")
set string(MiscString1,"data ")
if string match(PhoneNumber,";") set string(MiscString1,"voice")
position(3,3)
prompt("Press ENTER when the /(MiscString1) connection is established. ")
option("use menu colors",no)
wait key(MiscString1,300)
goto SetDateFlag
AutodialModems:
set string(MiscString1,"data")
if string match(PhoneNumber,";") set string(MiscString1,"voice")
position(1,1)
draw box(4,80)
position(2,3)
option("bold",no)
prompt("Manually command your modem to place a /(MiscString1) call to: /(SystemName)")
position(3,3)
prompt("Telephone number: /(PhoneNumber)/n")
option("use menu colors",no)
ifnot string match(LogonScript, "LEARNING") goto AutodialModems1
option("use menu colors",yes)
position(5,1)
option("bold",yes)
draw box(4,80)
option("bold",no)
position(6,3)
prompt("HyperACCESS//5 will learn the commands you send to your modem and include")
position(7,3)
prompt("them as part of the logon during subsequent calls./n/n")
goto RunLogon
AutodialModems1:
if flag(VoiceCall) goto AutodialModems2
if length("/(LogonScript)", CallAttempt) goto RunLogon
AutodialModems2:
get position(MiscInt2,CallAttempt)
add(MiscInt2, 2)
position(MiscInt2,1)
option("use menu colors", yes)
option("bold",yes)
draw box(5,80)
option("bold",no)
add(MiscInt2,1)
position(MiscInt2,3)
prompt("When the /(MiscString1) connection is established, press ALT-R. If the connection")
add(MiscInt2,1)
position(MiscInt2,3)
prompt("can't be established, press ALT-R, then ALT-M to return to the menus.")
add(MiscInt2,1)
position(MiscInt2,3)
prompt("You may have to command your modem to go on hook before pressing ALT-R./n/n/n")
option("use menu colors", no)
type("<ALT-L>VKA")
if wait carrier(1,5) goto SetDateFlag
ifnot flag(VoiceCall) goto UncommandedVoiceData2
UncommandedVoiceData:
wipe screen()
option("use menu colors", yes)
position(1,1)
option("bold",yes)
draw box(3,80)
option("bold",no)
position(2,3)
prompt("You should now be in voice communications with the remote system.")
position(4,1)
option("bold",yes)
set integer(MaxCallAttempts,9)
if equal(ModemNumber,99) set integer(MaxCallAttempts,5)
draw box(MaxCallAttempts,80)
option("bold",no)
position(5,3)
prompt("When you're done with the voice call or if you want to use HyperACCESS//5's")
position(6,3)
if equal(ModemNumber,99) goto UncommandedVoiceData1
position(6,3)
prompt("menus, press ESC.")
position(8,3)
prompt("If you want to switch this voice call over to a data call, do NOT press")
position(9,3)
prompt("ESC. Wait for the carrier tone and then follow your modem's manual on")
position(10,3)
prompt("originating a data call. When the data connection is established,")
position(11,3)
prompt("press ENTER.")
option("bold",yes)
position(12,32)
prompt(" ESC to cancel ")
option("bold",no)
option("use menu colors",no)
wait key(MiscString1,300)
goto LogCall4
UncommandedVoiceData1:
prompt("menus, press ALT-R, and then ALT-M. You may have to command your modem to go")
position(7,3)
prompt("on hook before pressing ALT-R./n/n")
position(9,1)
option("bold",yes)
draw box(6,80)
option("bold",no)
position(10,3)
prompt("If you want to switch this voice call over to a data call, do NOT press")
position(11,3)
prompt("ALT-R. Wait for the carrier tone and then command your modem to respond")
position(12,3)
prompt("to the answering modem's carrier tone. After the data connection is")
position(13,3)
prompt("established, press ALT-R./n/n/n")
option("use menu colors",no)
type("<ALT-L>VKA")
if wait carrier(1,1) wipe screen()
if wait carrier(1,1) position(0,0)
if wait carrier(1,1) goto LogCall4
wait seconds(1)
ifnot get key(LogFileName) goto UncommandedVoiceData2
if string match(LogFileName,"<ALT-M>") type("<ALT-M><ALT-L>SS")
UncommandedVoiceData2:
set string(MiscString1,"No data connection was established.")
gosub DisplayBanners
DirectCableCall:
set flag(DirectCable,TRUE)
option("BOTTOM LINE", yes)
if flag(Logging)
gosub LogCall3
else
call connected(SystemName)
endif
position(1,1)
if flag(VoiceCall) goto ErrVoiceThruDirect
if length("/(LogonScript)",MiscInt2) goto CheckLogon
option("use menu colors",yes)
option("bold",yes)
draw box(3,80)
option("bold",no)
position(2,3)
prompt("You are now connected with /(SystemName)./n/n/n")
option("use menu colors",no)
option("bottom line",on)
end()
VoiceCalls:
ifnot wait line(1,1) goto VoiceCalls1
VoiceCalls1:
if flag(NonDialable) goto UncommandedVoiceData
set integer(EscBranch,790)
goto VoiceCalls3
VoiceCalls2:
ifnot equal(ModemNumber,44) goto VoiceCalls3
ifnot wait text("OK",8) goto ErrNoModemResponse
ifnot wait line(1,1) goto VoiceCalls3
VoiceCalls3:
if equal(ModemNumber,41) goto VoiceCalls4
if equal(ModemNumber,42) goto VoiceCalls4
type("ATH0/r")
ifnot wait text("OK",8) goto VoiceCalls7
ifnot wait line(1,1) goto VoiceCalls7
goto VoiceCalls7
VoiceCalls4:
if wait text("OK",1) goto VoiceCalls5
VoiceCalls5:
prompt("/n")
type("AT G/r")
ifnot wait text("OK",5) goto VoiceCalls6
VoiceCalls6:
if wait line(1,1) goto VoiceCalls7
VoiceCalls7:
option("use menu colors",yes)
option("bold",yes)
get postion(MiscInt2,EscBranch)
add(MiscInt2,1)
position(MiscInt2,1)
draw box(5,80)
option("bold",no)
add(MiscInt2,1)
position(MiscInt2,3)
prompt("If you want to switch this voice call over to a data call, wait for the")
add(MiscInt2,1)
position(MiscInt2,5)
prompt("carrier tone and then press ENTER. Otherwise, press ESC to return to")
add(MiscInt2,1)
position(MiscInt2,5)
prompt("the Main menu./n/n")
option("use menu colors",no)
VoiceCalls8:
set string(MiscString1,"")
set flag(MiscFlag1,FALSE)
key string(MiscString1,"/(MiscString1)")
VoiceToData:
set flag(MiscFlag1,TRUE)
gosub TimeDateSub
ifnot write("Voice portion of call ended, /(ModemName) /(ConnectTime)") goto VoiceToData1
VoiceToData1:
option("use menu colors",no)
prompt("/n")
VoiceToData2:
ifnot equal(ModemNumber,44) goto VoiceToData4
VoiceToData3:
wipe screen()
position(1,1)
option("use menu colors",yes)
option("bold",yes)
draw box(3,80)
option("bold",no)
get position(MiscInt2,CallAttempt)
add(MiscInt2,1)
position(MiscInt2,3)
key string(MiscString1,"Push in the T//D button on the modem now and then press ENTER.")
option("use menu colors",no)
goto InitializeVoiceModem1
VoiceToData4:
option("use menu colors",no)
if equal(ModemNumber, 73)
set string(MiscString1, "ATH1O1")
else
set string(MiscString1,"ATD")
endif
if equal(ModemNumber,38) set string(MiscString1,"AT \N1 H1 O")
if equal(ModemNumber,45) set string(MiscString1,"/x0EO")
ifnot equal(ModemNumber,49) goto InitializeVoiceModem
set string(MiscString1,"ATO")
ifnot wait text(">",20) goto InitializeVoiceModem
set string(MiscString1,"ATO")
InitializeVoiceModem:
type("/(MiscString1)/r")
ifnot equal(ModemNumber,38) goto InitializeVoiceModem1
wait seconds(2)
ifnot screen match("CONNECT",2) goto ErrNoDataConnection
ifnot get integer(BaudRate,"/(MiscString1)") goto ErrNoDataConnection
ifnot flag(DirectCable) setting("baud",BaudRate)
InitializeVoiceModem1:
wait seconds(2)
wipe screen()
option("use menu colors",yes)
option("bold",yes)
position(1,1)
draw box(3,80)
option("bold",no)
position(2,3)
prompt("Put the telephone handset into the cradle now./n/n/n")
if equal(ModemNumber,38) goto LogCall4
option("use menu colors",no)
if wait carrier(1,40) goto LogCall4
goto ErrNoDataConnection
DisconnectVoice:
if flag(MiscFlag1) goto DisconnectVoice1
gosub TimeDateSub
ifnot write("Voice call ended, /(ModemName) /(ConnectTime)") goto DisconnectVoice1
DisconnectVoice1:
option("use menu colors",no)
prompt("/n")
wait seconds(1)
if equal(ModemNumber,45) goto _Error
if equal(ModemNumber,49) goto _Error
type("ATH0/r")
if wait text("OK",3) goto _Error
goto _Error
SetFlowControl:
if flag(DirectCable) goto (SetFlowControl1)
ifnot equal(BaudRate,0) setting("baud",BaudRate)
SetFlowControl1:
if equal(ModemNumber,42) gosub SetFastlinkSub
ifnot flag(HHS) return()
setting("outgoing hhs",4)
setting("incoming hhs",5)
return()
SetFastlinkSub:
set integer(ModemNumber,BaudRate)
divide(ModemNumber,10)
multiply(ModemNumber,9)
setting("baud",ModemNumber)
set integer(ModemNumber,42)
return()
TimeDateSub:
date(ModemName)
length("/(ModemName)",MiscInt2)
if less(MiscInt2,9) set string(ModemName," /(ModemName)")
time oday(ConnectTime,MiscInt2)
length("/(ConnectTime)",MiscInt2)
if less(MiscInt2,6) set string(ConnectTime," /(ConnectTime)")
return()
SetDowtySub:
set integer(MiscInt2,0)
if equal(BaudRate,19200) set integer(MiscInt2,17)
if equal(BaudRate,9600) set integer(MiscInt2,13)
if equal(BaudRate,4800) set integer(MiscInt2,11)
if equal(BaudRate,2400) set integer(MiscInt2,10)
if equal(BaudRate,1200) set integer(MiscInt2,9)
if equal(BaudRate,300) set integer(MiscInt2,7)
if equal(BaudRate,110) set integer(MiscInt2,3)
if equal(BaudRate,50) set integer(MiscInt2,1)
return()
CheckResponse:
ifnot wait text("OK", 3) goto ErrNoModemResponse
ifnot wait lines(1, 1) goto ErrNoModemResponse
return()
CheckAbort:
mouse position(Row, Col)
if equal(Row, 0) return()
if string match(S(9), "ESC") goto _Escape
return()
LoggingName:
set integer(MiscInt1,41)
set string(MiscString1,"...............................................")
ifnot length(SystemName, MiscInt2) set integer(MiscInt2,0)
ifnot length(PhoneNumber, MiscInt3) set integer(MiscInt2,0)
add(MiscInt2,MiscInt3)
subtract(MiscInt1,MiscInt2)
left(MiscString1,MiscInt1)
set string(NamePlusPhone,"/(SystemName)/(MiscString1)/(PhoneNumber)")
if flag(DirectCable) left(NamePlusPhone,41)
return()
DisplayBanners:
set integer(MiscInt1, 80)
ifnot length("/(MiscString1)",MaxCallAttempts) goto DisplayBanners1
DisplayBanners1:
option("use menu colors",no)
gosub DisplayBanners2
goto _Escape
DisplayBanners2:
option("use menu colors",yes)
option("bold",yes)
position(10,1)
draw box(3,80)
position(12,32)
prompt(" ESC to continue ")
option("bold",no)
position(11,3)
subtract(MiscInt1,MaxCallAttempts)
divide(MiscInt1,2)
DisplayBanners3:
set string(MiscString1," /(MiscString1)")
if decrement(MiscInt1) goto DisplayBanners3
prompt("/(MiscString1)")
option("use menu colors",no)
position(14,1)
whilenot get key(MiscString1)
gosub CheckAbort
wait seconds(1)
endwhile
position(14,1)
return()
DisplayBanners4:
gosub CheckAbort
wipe screen()
position(1,1)
option("use menu colors",yes)
if equal(ModemNumber,49) set integer(MiscInt2,5)
ifnot equal(ModemNumber,49) set integer(MiscInt2,4)
if equal(ModemNumber,97) set integer(MiscInt2,4)
if equal(ModemNumber,98) set integer(MiscInt2,4)
if equal(ModemNumber,99) set integer(MiscInt2,4)
option("bold",yes)
draw box(MiscInt2,80)
position(MiscInt2,32)
prompt(" ESC to cancel ")
if equal(ModemNumber,97) return()
if equal(ModemNumber,98) return()
if equal(ModemNumber,99) return()
position(2,3)
option("bold",no)
prompt("The call will now be placed to ")
if length("/(SystemName)",MiscInt2) prompt("/(SystemName).")
if equal(MiscInt2,0) prompt("/(PhoneNumber).")
return()
ifnot flag(VoiceCall) return()
prompt("/n/n")
if flag(NonDialable) return()
if less(CallAttempt,1) return()
VoiceInstructions:
wipe screen()
position(1,1)
option("use menu colors",yes)
option("bold",yes)
draw box(11,80)
position(11,32)
prompt(" ESC to cancel ")
option("bold",no)
if equal(ModemNumber,97) return()
if equal(ModemNumber,98) return()
if equal(ModemNumber,99) return()
position(2,3)
prompt("The call will now be placed to ")
if length("/(SystemName)",MiscInt2) prompt("/(SystemName).")
if equal(MiscInt2,0) prompt("/(PhoneNumber).")
position(3,5)
prompt("1. If you don't have a modem or a phone with a speaker, pick up the")
position(4,8)
prompt("telephone handset now to hear how the call is progressing.")
position(5,5)
prompt("2. Press ESC if you want to cancel the call.")
position(6,5)
if flag(UK_Version) prompt("3. If busy or no answer, press ESC to cancel the call.")
ifnot flag(UK_Version)prompt("3. If busy or no answer, the number will be redialed automatically.")
position(7,5)
prompt("4. When the call connects, pick up the telephone handset (if you haven't")
position(8,8)
if equal(ModemNumber,44) prompt("already), push in the T//D button on the modem and press ENTER.")
ifnot equal(ModemNumber,44) prompt("already) and press ENTER.")
option("use menu colors",no)
return()
ErrNoModemResponse:
set string(MiscString1,"Your modem isn't responding to commands. (See Appendix C for remedies.)")
ErrDisplayErrMessage:
gosub DisplayBanners
goto _Error
ErrNoPhoneLine:
set string(MiscString1,"Your modem isn't connected to the phone line.")
goto ErrDisplayErrMessage
ErrUnsupportedRate:
set string(MiscString1,"Your modem doesn't support /(BaudRate) baud.")
goto ErrDisplayErrMessage
ErrVoiceThruDeskset:
set string(MiscString1,"Voice calls can't be placed through the /(MiscString1) deskset.")
goto ErrDisplayErrMessage
ErrInvalidDataMode:
set string(MiscString1,"The /(MiscString1) deskset does not support that data mode.")
goto ErrDisplayErrMessage
ErrVoiceThruDirect:
set string(MiscString1,"You cannot place a voice call through a direct-cable.")
goto ErrDisplayErrMessage
ErrNoDataConnection:
set string(MiscString1,"A data connection could not be established.")
goto ErrDisplayErrMessage
ErrNoModemDef:
set string(MiscString1,"User-defined modem definition file not found. Run the MODEMDEF script.")
goto ErrDisplayErrMessage
ErrBadModemDef:
set string(MiscString1,"User-defined modem definition file is bad. Run the MODEMDEF script.")
goto ErrDisplayErrMessage
ErrBlackList:
wipe screen()
option("use menu colors",yes)
option("bold",yes)
position(7,1)
draw box(4,79)
position(10,30)
prompt(" ESC to continue ")
option("bold",no)
position(8,3)
prompt("Your modem has blacklisted this number. You should wait for the period")
position(9,3)
prompt("shown in your modem's manual before retrying the number again.")
position(10,31)
option("use menu colors",no)
ErrBlackList1:
ifnot wait key(S(0)) goto ErrBlackList1
goto _Error
_Escape:
option("mouse", off)
if equal(EscBranch,790) goto DisconnectVoice
if equal(EscBranch,540) goto CheckLogon
if equal(EscBranch,570) goto NoLogonConnection1
hangup()
put environment("HA_CALL_STATUS","CANCELLED")
type("/r")
wait seconds(1)
if flag(ViewDataEmulation) wipe screen()
load system("/(SystemName)")
_Error:
hangup()
bottom line(0,"")
option("ignore case",no)
option("bottom line",on)
option("use menu colors", no)
wipe screen()
type("<ALT-M><ALT-L>SS")
end()