.title KRTDIA Dial command and related items .ident "V03.62" ; /62/ 27-Jul-93 Billy Youdelman ; ; add support for call back modems, SET DIAL/PHONE [NO]ANSWER ; ; add a one-tick pacing delay in DODIAL's loop at 21$ (when the modem ; doesn't echo commands) to match what was done for echoing modems ; ; fix SHO MODEM for changes to SET DIAL [NO]ECHO and [NO]INIT_ONCE ; add initiate_prompt, dial_ack, confirm_ack, [no]binary_response ; ; added x.result (default "Hayes" xmode) and time.settle defaults, ; and in "Hayes" and Telebit modem definitions ; ; if DCD is high when exiting program, hang up modem ; add support for 38.4kb ; add Telebit T3000 modem def, needs KM handler and SET FLOW_CONTROL RTS ; ; double the settle_time value for the wait after dropping DTR, ; as some modems (like the T3000) need more time to recover ; /BBS/ 1-Dec-91 Billy Youdelman V03.61 ; ; set$mo now won't write bad modem name into modem: ; if DIAL/REDIAL succeeds jump to CONNECT automatically ; set linksts when dialing so ^C abort will catch correct ttname ; findmodem now does not try to process an empty string in modem: ; added c$idle, call to reset modem to idle (answer) mode ; findmodem/findnumber will match on partial input string ; added %X format effector for setting Hayes extended response mode ; added Telebit T2500 modem definitions ; ; redial loop moved to c$dial, runs faster without initializing ; the modem's lun every pass thru the loop, reduces cpu usage too ; ; load buffer with defmsg after displaying RING, to not overwrite ; the default message with call status stuff ; ; if DIAL can't translate an alias, say so then die (instead of ; prompting to continue with an empty number buffer) ; ; added xredial flag word, for keeping return path straight when ; connecting after a successful REDIAL. speed up redial process for ; modems which define init.once by not initting before every retry. ; init.once and mready (status flag) were added to support all this.. ; ; while waiting for a response after dialing modem, check for ; input from keyboard, allowing an easy abort ; ; .default patched to get/set handler speed from modem response, ; old speed is saved and restored, unless set different after.. ; Hayes definition completed and moved to it. this also renders ; Hayes responses displayable via SHO MODEM. ; ; diatmo from SET DIAL TIME_OUT gets written into dial.time(r4) ; when either c$dial or sho$dial is called. it's now usable with ; any modem type (not just user-defined) by setting the modem's ; internal timer to the max (ATS7=255 etc) then letting Kermit's ; timer take action first. ; ; modified waitfor to test for keyboard input, allowing a "strike ; any char" abort during dialing, now including the init string. ; DTR is dropped to ensure the modem will actually abort the call. ; ; SHO MODEM expanded to display everything ; result message must match from 1st byte to avoid embedded strings ; save modem init status to drop unnecessary inits ; SET MODEM now inits same, if a line (and speed) have been set ; echo everything from modem (if it echoes) during DIAL ; add CONNECT/nnnn for Hayes to alter DTE speed w/TSX and CL ; add Concord Data Systems 224 Auto-dial modem ; ; moved SET DTR code here, and reinit modem after DTR drop if one ; was on-line before it ; Copyright 1985,1986 Change Software, Inc. ; ; 18-Oct-85 20:06:09 Brian Nelson ; ; 04-Dec-85 11:22:32 BDN Add optional linked list structure to ; define modem responses, will be useful ; when adding a SET DIAL command ; 09-Jan-86 17:48:17 RTM Added support for the RIXON Intelligent ; (RTM01) auto-dial modem (R212A) ; 13-Feb-86 10:10:08 BDN Put the DF112 and DF224 responses into ; linked lists ; 23-Sep-86 14:10:30 BDN Vadic 4224 modems ; 23-Sep-86 14:10:42 BDN Added format effector %M for pulse/tone ; if a SET PHONE PULSE/TONE was done ; Added %B for "blind" dialing, enabled if ; SET PHONE BLIND ; 30-Sep-86 13:05:53 BDN Added CTS2424, Also SHO DIAL ; 09-Feb-89 00:00:00 JCH Complete definition of DF224 modem .include "IN:KRTMAC.MAC" .iif ndf KRTINC .error <; .include for IN:KRTMAC.MAC failed> .sbttl Modem data base structure ; Loosely based on CKUDIAL.C ; ; Anything new that is needed in the modem database should be added at ; the end of the list just before mod.size which should be incremented ; to include the new element. You must also conform the define macro. mod.next ==: 0 ; link to next modem in list mod.string ==: 2 ; address of name of modem dial.time ==: 4 ; dial time_out value in secs wake.string ==: 6 ; address of wakeup string wake.rate ==: 10 ; ticks delay between sending chars wake.prompt ==: 12 ; address of wakeup prompt string dmod.string ==: 14 ; address of dial initiate string and dmod.prompt ==: 16 ; address of prompt returned for it dial.string ==: 20 ; address of dial format string dial.rate ==: 22 ; ticks delay between sending chars dial.ack ==: 24 ; modem response to confirm number dial.blind ==: 26 ; if <> dial w/o wait for dial tone dial.wait ==: 30 ; string for pause format effector dial.confirm ==: 32 ; string to confirm number for dialing dial.go ==: 34 ; ie, va212 returns "DIALING\n" res.bin ==: 36 ; if <> it's binary responses (DF03) dial.echo ==: 40 ; if <> modem echoes its input mod.comment ==: 42 ; addr of brief description of modem res.head ==: 44 ; head of the list of result messages dial.xabort ==: 46 ; /45/ string to kill call in progress dial.idle ==: 50 ; /45/ string puts modem in idle state dial.pulse ==: 52 ; /45/ pulse dialing command string dial.nopulse ==: 54 ; /45/ tone dialing command string init.once ==: 56 ; /BBS/ if <> modem stays initialized time.settle ==: 60 ; /62/ reset settle_time in secs x.result ==: 62 ; /62/ "Hayes" style extended mode ph.answer ==: 64 ; /62/ enable answer mode string ph.noanswer ==: 66 ; /62/ disable answer mode string mod.size ==: 70 ; /62/ length of data defined above .sbttl Macros for individual fields of a modem's data structure ; these two are inserted by the define macro ; mod.next 0 link to next modem in list ; mod.string 2 address of name of modem .macro dial$time v modval v ,dial.time ; 4 dial time_out value in secs .endm dial$time .macro wake$string s modstr ,wake.string ; 6 address of wakeup string .endm wake$string .macro wake$rate v modval v ,wake.rate ; 10 ticks delay between chars .endm wake$rate .macro wake$prompt s modstr ^~s~ ,wake.prompt ; 12 address of wakeup prompt string .endm wake$prompt .macro dmod$string s modstr ,dmod.string ; 14 address of dial initiate string .endm dmod$string .macro dmod$prompt s modstr ,dmod.prompt ; 16 address of prompt returned by it .endm dmod$prompt .macro dial$string s modstr ,dial.string ; 20 address of dial format string .endm dial$string .macro dial$rate v modval v ,dial.rate ; 22 ticks delay between chars .endm dial$rate .macro dial$ack s modstr ,dial.ack ; 24 modem response to confirm number .endm dial$ack .macro dial$blind s modstr ,dial.blind ; 26 if <> dial w/o waiting dial tone .endm dial$blind .macro dial$wait s modstr ,dial.wait ; 30 string for pause format effector .endm dial$wait .macro dial$confirm s modstr ,dial.confirm ; 32 string to confirm dialed number .endm dial$confirm .macro dial$go s modstr ,dial.go ; 34 ie, va212 returns "DIALING\n" .endm dial$go .macro res$bin v modval v ,res.bin ; 36 if <> it's binary responses .endm res$bin .macro dial$echo v modval v ,dial.echo ; 40 if <> modem echoes its input .endm dial$echo .macro mod$comment s modstr ^~s~ ,mod.com ; 42 addr of brief modem description .endm mod$comment .macro mod$res s ,class ; 44 listhead of result messages ; ; res.head(current_modem) --> first entry of linked list ; ; .word link_to_next or zero for the last entry ; .word response_class <0 fail, 0 info, 1 ring, >1 success ; .asciz "response_string" ; .list me .save .psect resdat ,ro,d,lcl,rel,con ; /62/ .nlist me $res1 = . ; save current pc in "resdat" .word 0 ; link to next is zero for now.. .if b ; if class not specified, then .word 0 ; make it zero (info only message) .iff ; else insert specified .word class ; response class .endc .asciz "s" ; the actual text /BBS/ allow "/" .list me .even ; must do .restore .nlist me .if eq $res ; is this first time for new type? modval $res1 ,res.head ; yes, stuff the link header .iff ; not the first time .list me .save .psect resdat ,ro,d,lcl,rel,con $respc = . ; save the current pc . = $reslast ; back to link word of previous entry .word $res1 ; insert address of new entry . = $respc ; restore current pc .restore .nlist me .endc $reslast = $res1 ; lastlink = current_entry $res = 1 ; not the first time anymore .endm mod$res .macro dial$xabort s modstr ,dial.xabort ; 46 string to kill call in progress .endm dial$xabort .macro dial$idle s modstr ,dial.idle ; 50 string puts modem in idle state .endm dial$idle .macro dial$pulse s modstr ,dial.pulse ; 52 pulse dialing command string .endm dial$pulse .macro dial$nopulse s modstr ,dial.nopulse ; 54 tone dialing command string .endm dial$nopulse .macro init$once v modval v ,init.once ; 56 if <> modem stays initialized .endm init$once .macro time$settle v modval v ,time.settle ; 60 reset settle_time in secs .endm time$settle .macro x$result v modval v ,x.result ; 62 "Hayes" style extended mode .endm x$result .macro ph$answer s modstr ,ph.answer ; 64 enable answer mode string .endm ph$answer .macro ph$noanswer s modstr ,ph.noanswer ; 66 disable answer mode string .endm ph$noanswer .sbttl Macros to place data in the individual fields .macro modstr s ,offset ; insert a string in modem's data .list me .save .psect string ,ro,d,lcl,rel,con .nlist me $$addr = . $$ = 0 .irpc ch ,^~s~ ; translate "^M" syntax to ".byte 15" ch1 = ''ch ; get copy of char as a literal .if eq ch1-'^ $$ = 100 ; char is a ^, set flag for next char .iff .if ne $$ ; if not a ^ but last char flag is set .if ge -<'a!40> ; ensure alpha chars are upper case .iif le <-<'z!40>> ch1 = ch1&137 ; so char-100 works! .endc .endc .byte ch1-$$ ; char-100 = control char of same name $$ = 0 ; reset the ^ flag .endc .endr .byte 0 ; null terminate .list me .psect modinf ,ro,d,lcl,rel,con . = $$current+offset .word $$addr ; where to find it.. .restore .nlist me .endm modstr .macro modval val ,offset ; insert value (word) in modem's data .list me .save .psect modinf ,ro,d,lcl,rel,con . = $$current+offset ; it goes here.. .word val .restore .nlist me .endm modval .sbttl The actual modem definition macro ; The following creates a modem's data structure, inserting the default ; values as shown. These defaults may be modified using the individual ; data field macros. The individual modem definition entries following ; (two pages below) are good examples of how this is accomplished. .macro define lab ,s ,user .if eq $$trip ; /62/ this has to be done this way $$prev = modinf ; /62/ because "ndf" blows up the $$trip = 1 ; /62/ .LST output.. .endc ; /62/ $res = 0 ; init the result message $reslast = 0 ; macro counters .if nb ; if we are doing the "user_defined" .list me ; modem we need to be in a .save ; psect that is never swapped out .globl lab ; user_defined listhead must be global .psect usermd ,rw,d,gbl,rel,con ; this psect is forced into the root .nlist me ; by inclusion in KRTSJ and KRTXM .iff $modtail = . ; use this to link to "usermd" as it .endc ; avoids error from differing psects $$current = . ; save listhead for auxiliary macros .list me .save .psect string ,ro,d,lcl,rel,con ; switch to string psect $$ = . ; save location of .asciz "s" ; the modem type string .even .restore .nlist me lab: .word 0 ; 0 mod.next link to next please .word $$ ; 2 mod.string modem type string address .word 30. ; 4 dial.time dial time_out in secs .word null ; 6 wake.string init to dial out string .word 0 ; 10 wake.rate ticks between init chars .word null ; 12 wake.prompt command mode prompt string .word null ; 14 dmod.string optional dial cmd string .word null ; 16 dmod.prompt optional dial prompt string .word null ; 20 dial.string actual dial command string .word 0 ; 22 dial.rate ticks between dial chars .word null ; 24 dial.ack dialing acknowledged string .word null ; 26 dial.blind blind dial command string .word null ; 30 dial.wait pause character string .word null ; 32 dial.confirm optional "ok" string .word null ; 34 dial.go optional "dialing" string .word 0 ; 36 res.bin if <> single char response .word 0 ; 40 dial.echo if <> modem echos commands .word null ; 42 mod.comment modem comment string .word 0 ; 44 res.head result messages listhead .word null ; 46 dial.xabort abort dialing string .word null ; 50 dial.idle reset modem to idle string .word null ; 52 dial.pulse PULSE dialing string .word null ; 54 dial.nopulse TONE dialing string .word 0 ; 56 init.once if <> modem stays initted .word 20. ; 60 time.settle ticks to wait after a reset .word -1 ; 62 x.result Hayes Xmode, default is off .word null ; 64 ph.answer enable auto-answer string .word null ; 66 ph.noanswer disable auto-answer string $$end = . .iif ne <<$$end-$$current>-mod.size> .error <; 's define size error> .if b ; if not the user_defined modem . = $$prev ; insert link address of modem data .word lab ; just defined in the previous modem . = $$end ; then go back where we were $$prev = lab ; and save new address for next link .iff ; if this is the user_defined modem.. .list me .restore ; exit root, come back to this overlay $$$ = . . = $modtail ; /BBS/ back to top of last definition .word lab ; /62/ insert link to user_defined . = $$$ .nlist me .endc ; b .endm define .sbttl Modem response classes ; /BBS/ CON38400 = 38400. ; /62/ connect at designated speeds CON19200 = 19200. ; that is, when the modem's result message CON9600 = 9600. ; matches the string associated with one of CON7200 = 7200. ; these speed specific classes, then force CON4800 = 4800. ; the DTE speed to it (if possible).. CON2400 = 2400. ; see the Hayes definition below for an CON1200 = 1200. ; example of exactly how this is done CON300 = 300. CONNECT = 2 ; don't check or change speed RING = 1 ; a ring was detected INFO = 0 ; info only /62/ *** SEE NOTE BELOW *** FAILED = -1 ; call failed, modem has already stopped ABORTED = -2 ; aborted by program, need to kill modem ; /62/ NOTE: Since an INFO message is anything undefined, INFO messages ; have been dumped here to save space - this module is full! ; /BBS/ This is used by SHOW MODEM to format the display of response messages ; and actions to them. It's the column at which the actions begin and may be ; increased if longer response strings must accommodated. COL.ACT = 18. .psect modinf ,ro,d,lcl,rel,con .sbttl Finally, we can define the modems ; /BBS/ NOTE: When a response string is a substring of another response ; string the response being the substring _MUST FOLLOW_ the other containing ; it as otherwise an unwanted match will occur on the first one encountered. ; /62/ Control chars may be included in strings using the "^X" notation per ; the modstr macro, above. ; /BBS/ Keep these in modem name alphabetical order for SET MODEM ? display. modinf:: ; /62/ this is the top of the list $$trip = 0 ; /62/ init for the define macro define concord , ; /BBS/ added mod$comment wake$string <^M^M> ; keyboard interactive mode wake$prompt ^~CDS >~ dial$string dial$wait dial$echo 1 dial$pulse

dial$nopulse dial$xabort <^K> dial$idle dial$time 45. mod$res ,FAILED mod$res ,FAILED mod$res ,CONNECT mod$res ,FAILED mod$res ,FAILED mod$res ,FAILED mod$res ,RING mod$res ,FAILED define cts24 , mod$comment wake$string <^T^WAT^M> wake$rate 10 wake$prompt dial$string dial$rate 10 dial$wait <+> dial$echo 1 dial$blind <&> dial$pulse

dial$nopulse dial$xabort <^T^W> dial$idle <^T^W> dial$time 35. mod$res ,FAILED mod$res ,FAILED mod$res ,FAILED mod$res ,FAILED mod$res ,FAILED mod$res ,FAILED mod$res ,CONNECT ; /BBS/ mod$res ,RING define df03 , mod$comment wake$string <^A^B> ; this inits to dial dial$string <%S^M> ; /62/ needs a return here dial$echo 1 dial$time 30. res$bin 1 ; single char responses mod$res ,CONNECT mod$res ,FAILED define df100 , mod$comment wake$string <^B> wake$prompt dial$string <%S#> ; /45/ dial$rate 10 dial$echo 1 dial$xabort <^M> dial$time 30. mod$res ,CONNECT mod$res ,FAILED mod$res ,FAILED mod$res ,FAILED mod$res ,FAILED mod$res ,FAILED mod$res ,FAILED define df200 , mod$comment wake$string <^B> wake$prompt dial$string <%B%M%S!> ; /60/ dial$echo 1 dial$blind <^A> ; /60/ dial$pulse

; /60/ dial$xabort <^B> ; /60/ dial$nopulse ; /60/ dial$time 30. mod$res ,CONNECT mod$res ,FAILED mod$res ,FAILED mod$res ,FAILED mod$res ,FAILED mod$res ,FAILED mod$res ,FAILED define hayes , ; /BBS/ updated.. mod$comment ^~Hayes Generic Command Set - DTE>>DCE speed~ wake$string ; note time_out set to wake$prompt ; 255 so dial$time (which dial$string ; is settable) will prevail.. dial$echo 1 init$once 1 dial$pulse

dial$nopulse dial$xabort <^M> dial$idle dial$time 45. time$settle <25.> ; /62/ add a few ticks.. x$result <4> ; /62/ extended mode, "ATX4" ph$answer ; /62/ ph$noanswer ; /62/ mod$res ,FAILED mod$res ,CON19200 ; /62/ added mod$res ,CON9600 ; set DTE to indicated speed.. mod$res ,CON4800 mod$res ,CON2400 mod$res ,CON1200 mod$res ,CON300 ; 300 is implied here mod$res ,FAILED mod$res ,FAILED mod$res ,FAILED mod$res ,FAILED ; true Hayes mod$res ,FAILED ; many clones mod$res ,RING ; includes RINGING mod$res ,RING ; Telebit-style rringing mod$res ,FAILED define hayes.mnp , ; /BBS/ added from above.. mod$comment wake$string wake$prompt dial$string dial$echo 1 init$once 1 dial$pulse

dial$nopulse dial$xabort <^M> dial$idle dial$time 60. time$settle <25.> x$result <4> ph$answer ; /62/ ph$noanswer ; /62/ mod$res ,FAILED mod$res ,CONNECT mod$res ,FAILED mod$res ,FAILED mod$res ,FAILED mod$res ,FAILED mod$res ,FAILED mod$res ,RING mod$res ,RING mod$res ,FAILED define microcom , mod$comment wake$string <4445^MSE2^MS1C0^MSCE ON^M> wake$rate 10 wake$prompt dial$string dial$rate 10 dial$echo 1 dial$time 35. mod$res ,FAILED mod$res ,CONNECT mod$res ,FAILED define r212a , ; added by edit RTM01 mod$comment wake$string <^M^M> wake$rate 10 ; wait 8. ticks wake$prompt <$> dmod$string dmod$prompt dial$string <%S^M> dial$rate 10 dial$go dial$echo 1 dial$time 60. ; long time_out for overseas mod$res ,FAILED mod$res ,FAILED mod$res ,CONNECT mod$res ,CONNECT mod$res ,FAILED mod$res ,RING define T2500 , ; /BBS/ added.. mod$comment ^~Telebit w/o MNP/V.42 - DTE>>DCE speed~ wake$string wake$prompt dial$string dial$echo 1 init$once 1 dial$pulse

dial$nopulse dial$xabort <^M> dial$idle dial$time 45. x$result <3> ph$answer ; /62/ ph$noanswer ; /62/ mod$res ,FAILED mod$res ,CON19200 mod$res ,CON9600 mod$res ,CON4800 mod$res ,CON2400 mod$res ,CON1200 mod$res ,CON9600 mod$res ,CON300 mod$res ,FAILED mod$res ,FAILED mod$res ,FAILED mod$res ,FAILED mod$res ,RING define T2500MNP , ; /BBS/ added.. mod$comment wake$string wake$prompt dial$string dial$echo 1 init$once 1 dial$pulse

dial$nopulse dial$xabort <^M> dial$idle dial$time 60. x$result <3> ph$answer ; /62/ ph$noanswer ; /62/ mod$res ,FAILED mod$res ,CONNECT ; includes all CONNECT msgs mod$res ,FAILED mod$res ,FAILED mod$res ,FAILED mod$res ,FAILED mod$res ,RING define T2500V.42 , ; /BBS/ added.. mod$comment wake$string wake$prompt dial$string dial$echo 1 init$once 1 dial$pulse

dial$nopulse dial$xabort <^M> dial$idle dial$time 60. x$result <3> ph$answer ; /62/ ph$noanswer ; /62/ mod$res ,FAILED mod$res ,CONNECT mod$res ,FAILED mod$res ,FAILED mod$res ,FAILED mod$res ,FAILED mod$res ,RING define T3000 , ; /62/ added.. mod$comment ^~Telebit w/o MNP/V.42 - DTE>>DCE - RTS/CTS restraint~ wake$string wake$prompt dial$string dial$echo 1 init$once 1 dial$pulse

dial$nopulse dial$xabort <^M> dial$idle dial$time 45. time$settle <35.> ; the T3000 is SLOW to recover x$result <12.> ph$answer ; /62/ ph$noanswer ; /62/ mod$res ,FAILED mod$res ,CON38400 mod$res ,CON19200 mod$res ,CON9600 mod$res ,CON7200 mod$res ,CON4800 mod$res ,CON2400 mod$res ,CON1200 mod$res ,CON300 mod$res ,FAILED mod$res ,FAILED mod$res ,FAILED mod$res ,RING define T3000V.42 , ; /62/ added.. mod$comment wake$string wake$prompt dial$string dial$echo 1 init$once 1 dial$pulse

dial$nopulse dial$xabort <^M> dial$idle dial$time 60. time$settle <35.> ; the T3000 is SLOW to recover x$result <12.> ph$answer ; /62/ ph$noanswer ; /62/ mod$res ,FAILED mod$res ,CONNECT mod$res ,FAILED mod$res ,FAILED mod$res ,FAILED mod$res ,RING define vadic , mod$comment wake$string <^E^M> wake$rate 10 wake$prompt <*> dial$string <%S^M> dial$rate 10 dial$wait dial$ack <^M> dmod$string dmod$prompt dial$confirm <^M> dial$go dial$echo 1 dial$xabort <^M> dial$idle dial$time 35. mod$res ,FAILED mod$res ,FAILED mod$res ,FAILED mod$res ,CONNECT mod$res ,CONNECT mod$res ,RING mod$res

dial$nopulse dial$xabort <^M> dial$idle dial$time 35. mod$res ,FAILED mod$res ,FAILED mod$res ,FAILED mod$res ,CONNECT ; /BBS/ CON2400 ? mod$res ,CONNECT ; /BBS/ CON1200 ? mod$res ,CONNECT ; /BBS/ CON300 ? mod$res ,CONNECT mod$res ,CONNECT mod$res ,RING mod$res