;  4.4  62487  TEB  In the Hayes modem [Make a Call], set the delay
;                     from 2 to 5.  At times when the receiving end
;                     answered, the receiving end wasn't set up yet
;                     to receive the incoming '' char.
;  5.2  920728   LG   Hayes2400 (async)
;                       Added S25=50 to increase time modem will
;                       ignore DTR dropout to .5 seconds.
;  5.3  931009   LG   Modems Added
;                       Telebit WorldBlazer {TelebitWB}
;                       Hayes Optima 144    {HayesOptima}
;                       USR Courier Dual    {USRDUAL}
;                       UDS V.3227          {UDSV3227}
;                       SupraFaxModem       {SupraFax}
;
;
;    SYS.MODEMS
;
;    This file is used as a general modem profile file. Any modem can
;    be configured to use by utilizing the powerful and flexible modem 
;    generator commands.
;
;    A parsing and command interpreter program which resides in
;    the Modem Service reads this file and properly translates the
;    commands and executes them at the appropriate time.
;
;    You can add new modem profiles in this file, and also
;    take out the ones that you don't need.
;
;    The modem profile commands are similar to a mini programming
;    language, with easy to understand command strings.
;    Like any command languages there are certain syntactical
;    rules to be followed.
;
;    Every modem profile section should have the following :
;
;    {MODEM NAME}this name will be reflected in the Modem Service 
;                 Status Monitor, and in Communications manager 
;                 selection when in mail.
;
;    followed by three header strings in the following order:
;
;    [Reset_Modem]
;    [Wait_For_Call]
;    [Make_A_Call]
;
;    Under each header strings are command strings that tells
;    the modem what to do.
;
;    Explanation of COMMAND STRINGS
;    A delimiter character defined as :
;    First string after the delimiter is the command name
;    Second string after the delimiter is the object
;    Command instructs the modem what to do and
;     Object are parameters that are acted upon by the command.
;    Comments start with character ;
;    Ascii characters are represented by single quote
;     such as 'Hello'.
;    Binary values can be represented by a hex number or
;     a decimal number such as 0Ah, B7h, 10, or 25D.
;
;    Spaces,tabs and linefeeds can be used freely, except
;    within a command or object string.
;    Comments string should end with a LF
;
;    For a Detailed description of commands please refer to
;    The Modem Service Reference Manual.
;
;  Modem Script Headings (As must appear in Modemservice.config)
;
;    AJ2400
;    Bizcomp
;    DC2400
;    Hayes1200
;    Hayes2400
;    HayesOptima
;    Microcom
;    Milgo
;    Sema
;    SupraFax
;    SyncDC2400
;    SyncMicro
;    SyncHayes
;    TelebitWB
;    UDSV3227
;    URSDUAL
;    Vadic
;    Ventel31
;    V25BisMilgo
;    V25BisSema
:
;    Direct
;    DirectCTS
;    DTRDial
;    
;
;    NOTE: Some applications may require minor script modifications
;          due to timing considerations.  Typical change would be to
;          add :DELAY:n before :Online: in the Make_A_Call script.
;

{AJ2400}
; AndersonJacobson AJ2412STHM modem


  [Reset_Modem]

    :DropAndRaiseDTR:2
        ; drops DTR wait 2 sec then raise DTR again
    :SendString:'ATZ',0Dh
        ; Reset the modem
    :Delay:6
        ; initializing takes some time
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the 'OK'
    :SendString:'ATE0',0Dh
        ; Set echo off
    :Delay:1
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the 'OK'
    :SendString:'ATD2',0Dh;
        ; modem goes onhook and disables autoanswer; 
        ; when DTR goes low
        ; gives the modem enough time to execute the command and to 
        ; answer back with an 'OK' before the next command is sent 
    :Delay:1
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; ignore the crlf  OKcrlf response from modem
    :SendString:'ATM0',0Dh
        ; Set speaker off
    :Delay:1
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the 'OK'
    :SendString:'ATB1',0Dh;
        ; Bell protocol
    :Delay:1
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; ignore the crlf  OKcrlf response from modem
    :SendString:'ATC1',0Dh;
        ; Carrier detect follows true carrier 
    :Delay:1
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; ignore the crlf  OKcrlf response from modem
    :SendString:'AT*C1',0Dh;
        ; DTE rate is constant regarless of modem to modem speed
    :Delay:1
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; ignore the crlf  OKcrlf response from modem
    :SendString:'ATS2=128',0Dh
        ; Disable escape sequence so we can
        ; read data which might contain the
        ; escape sequence.
    :Delay:1
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the 'OK'
    :SendString:'ATS0=1',0Dh
        ; Answer after 1 ring
    :Delay:1
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the 'OK'
    :SendString:'ATS7=45',0Dh
        ; Delay for receiving carrier detect
    :Delay:1
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the 'OK'
    :SendString:'ATS0=1',0Dh
        ; Answer after 1 ring
    :Delay:1
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the 'OK'

    :SendString:'ATS10=20',0Dh
        ; sets loss of carrier delay to 2 seconds
    :Delay:1
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the 'OK'
    :Finish:
        ;reset modem completed


  [Wait_For_Call]

    :WaitStringReturn:
        ; WAIT FOR THE PHONE TO RING
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the first 'Ring' echo
    :Delay:4
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the 'Connect' response
    :OnLine:
    :Finish:


  [Make_A_Call]

    :SendString:'ATDT'
        ; initiate dialing
    :Delay:1
    :MapPhoneNumberAndDial:','
        ; The comma is the pause character
        ; There is no delay character
    :Delay:1
    :SendString:0Dh
        ; starts dialing process
    :Delay:2
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the 'Connect' response
    :Delay:2
    :OnLine:
    :Finish:
;


{Bizcomp}
; Bizcomp 1012


  [Reset_Modem]

    :DropAndRaiseDTR:2
        ; drop and raise line 2 seconds in between
    :SendString:02,'Z'
        ; send STX Z to reset modem
    :Delay:2 ; delay 2 sec
    :IgnoreStringEndingWithCharacter:0Dh
        ; ignore return string ending with CR
    :Delay:1 ; delay 1 sec
    :SendString:02,'X'
        ; send STX X for transperant mode
    :IgnoreStringEndingWithCharacter:0Dh
        ; ignore return character CR
    :Finish: ; finish


  [Wait_For_Call]

    :SendString:02,'A'
        ; send STX A to enable auto answer
    :IgnoreStringEndingWithCharacter:0Dh
        ; ignore return character CR
    :WaitStringReturn:
        ; starting pt for waiting to be connected
    :SaveStringEndingWithCharacter:0Dh
        ; engage string ending with CR
    :CompareWithSavedString:'1',0Dh
        ; compare saved string with 1,CR
    :JumpIfCompareNotEqual:1
    :OnLine:        
    :Finish: ; finish


  [Make_A_Call]

    :SendStringIfToneDial:02,'V'
        ; tone dial then send STX V
    :IgnoreStringEndingWithCharacter:0Dh
        ; ignore return character CR
    :SendString:02,'Q'
        ; send STX Q for fast busy detection
    :IgnoreStringEndingWithCharacter:0Dh
        ; ignore return character CR
    :SendString:02,'D'
        ; send STX D for start dialing command
    :MapPhoneNumberAndDial:':'
        ; map phone number for dialing
    :SendString:0Dh
        ; ends with CR to start dialing process
    :SaveStringEndingWithCharacter:0Dh
        ; engage string ending with CR
    :CompareWithSavedString:'7',0Dh
        ; compare that string with 7,CR
    :JumpIfCompareNotEqual:1
        ; jump 1 if not equal
    :SaveStringEndingWithCharacter:0Dh
        ; equal so engage another
    :CompareWithSavedString:'1',0Dh
        ; compare with 1,CR
    :JumpIfCompareNotEqual:1
    :OnLine:
    :Finish:
        ; finish


;

{DC2400}
; Convergent DC2400 Asynchronous 2400 baud
; Switch settings: Front panel(SW1)  2 On; 1, 3 thru 6 Off
;                   Rear          (SW2)  1, 2 On; 3 thru 7 Off

  [Reset_Modem]

    :DropAndRaiseDTR:2
    :SendString:'ATF',0Dh
        ; Reset the modem
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the 'OK'
    :SendString:'ATD3',0Dh
        ; Assume init state, if DTR On to Off
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
    :SendString:'ATC1',0Dh
        ; CD follows true line conditions
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
    :SendString:'ATX0',0Dh
        ; Basic result codes, eg. CONNECT, not CONNECT 2400
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
    :SendString:'AT<',0Dh
        ; go to MNP mode
    :IgnoreStringEndingWithCharacter:2Ah
    :SendString:'T1',0Dh
        ; Disable flow control
    :IgnoreStringEndingWithCharacter:2Ah
    :SendString:'B2',0Dh
        ; Immediately send break
    :IgnoreStringEndingWithCharacter:2Ah
    :SendString:'L0',0Dh
        ; No ARQ mode
    :IgnoreStringEndingWithCharacter:2Ah
    :SendString:'Q',0Dh
        ; Quit MNP mode
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
    :SendString:'AT\I0',0Dh
        ; Auto line speed
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
    :SendString:'ATM0',0Dh
        ; Speaker off
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
    :SendString:'ATS2=0',0Dh
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Disable Escape code
    :SendString:'ATW',0Dh
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Store config  reqd since modem does not respond
        ; correctly otherwise
    :Finish:
        ;reset modem completed


  [Wait_For_Call]

    :SendString:'ATS0=1',0Dh
        ; Answer after 1 ring
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the 'OK'
    :WaitStringReturn:
        ; Wait for the phone to ring
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the first 'Ring' echo
    :Delay:2
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the 'Connect' echo
    :OnLine:
    :Finish:

  [Make_A_Call]

    :SendString:'ATDT'
        ; initiate dialing
    :Delay:1
    :MapPhoneNumberAndDial:','
        ; The comma is the pause character
        ; There is no delay character
    :Delay:1
    :SendString:0Dh
        ; starts dialing process
    :IgnoreStringEndingWithCharacter:0Ah
    :SaveStringEndingWithCharacter:0Ah
        ; Engage string ending with LF
    :CompareWithSavedString:'CONNECT',0Dh,0Ah
        ; Compare that string with 'CONNECT',CR,LF
    :JumpIfCompareNotEqual:2
    :Delay:2
    :OnLine:
    :Finish:

;


{Hayes1200}
; Hayes Smartmodem 1200


  [Reset_Modem]

    :DropAndRaiseDTR:2
        ; drops DTR wait 2 sec then raise DTR again
    :SendString:'ATZ',0Dh
        ; Reset the modem
    :Delay:2
        ; initializing takes some time
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the 'OK'
    :Delay:2
    :SendString:'ATM0',0Dh
        ; Set speaker off
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the 'OK'
    :SendString:'ATS2=128',0Dh
        ; Disable escape sequence so we can
        ; read data which might contain the
        ; escape sequence.
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the 'OK'
    :SendString:'ATS0=1',0Dh
        ; Answer after 1 ring
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the 'OK'
    :Finish:
        ;reset modem completed


  [Wait_For_Call]

    :WaitStringReturn:
        ; WAIT FOR THE PHONE TO RING
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the first 'Ring' echo
    :Delay:3
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the 'Connect' response
    :OnLine:
    :Finish:


  [Make_A_Call]

    :SendString:'ATDT'
        ; initiate dialing
    :Delay:1
    :MapPhoneNumberAndDial:','
        ; The comma is the pause character
        ; There is no delay character
    :Delay:1
    :SendString:0Dh
        ; starts dialing process
    :Delay:2
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the 'Connect' response
        ; Update: 62487 by TEB.  Was :Delay:2
    :Delay:5
    :OnLine:
    :Finish:

;
{Hayes2400}
; Hayes Government 2400

  [Reset_Modem]

    :DropAndRaiseDTR:2
        ; drops DTR wait 2 sec then raise DTR again
    :SendString:'ATF',0Dh
        ; Load factory configuration
    :Delay:2
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the 'OK'
    :SendString:'ATE0M0X0Y1',0Dh
        ; Echo Off, speaker off, basic result codes, break enable
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the 'OK'
    :SendString:'ATS0=1S2=128S25=50',0Dh
        ; Answer after 1 ring,
        ; Disable escape sequence so we can
        ; read data which might contain the
        ; escape sequence.
		; Ignore DTR dropout of less than 50100s second.
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the 'OK'
    :SendString:'ATC1D2R1S1',0Dh
        ; DCD on when carrier detected
        ; Hang up and enter command state after reset
        ; CTS always ON  modem ignores RTS
        ; DSR operates according to RS232C specifications
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the 'OK'
    :Finish:
        ;reset modem completed


  [Wait_For_Call]

    :WaitForCarrier:
        ; Wait for CD to go high
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; ignore the Ring message
    :IgnoreStringEndingWithCharacter:0Ah
    :SaveStringEndingWithCharacter:0Ah
    :CompareWithSavedString:'CONNECT',0Dh,0Ah
        ; compare saved string with CR
    :JumpIfCompareNotEqual:1
    :OnLine:
    :Finish:


  [Make_A_Call]

    :SendString:'ATDT'
        ; initiate dialing
    :Delay:1
    :MapPhoneNumberAndDial:','
        ; The comma is the pause character
        ; There is no delay character
    :Delay:1
    :SendString:0Dh
        ; starts dialing process
    :IgnoreStringEndingWithCharacter:0Ah
    :SaveStringEndingWithCharacter:0Ah
    :CompareWithSavedString:'CONNECT',0Dh,0Ah
        ; compare saved string with CR
    :JumpIfCompareNotEqual:1
    :OnLine:
    :Finish:

;

{HayesOptima}
;
; Hayes Optima 14.4
; lGlamb R5.3 930924  Version 1.2
;


; WARNING
; This script intializes the modem to use error correction and data 
; compression protocols (both MNP and V.42).  
; This may cause problems when attempting to establish a link with
; modems not supporting these protocols.
; This script is also set to use TONE dial only.  
;
; The following guidlines will work with many older non MNP or V.42 modems
;
; When CALLING a modem known to not support these protocols:
;    Add the following before the number to dial
;
;        <bs><bs>Q6DT
;
;        <bs> = backspace = 08h
;
; When being CALLED by a modem not supporting these protocols:
;    Have the REMOTE site wait at least 5 seconds after getting CONNECT message
;      before sending user data.
;    In Modem Service this typically means adding :DELAY:5 
;      before the :OnLine: command in the Make_A_Call script.
;
;      :JumpIfCompareNotEqual:1    becomes    :JumpIfCompareNotEqual:2
;      :OnLine:                               :Delay:5
;      :Finish:                               :OnLine:
;                                             :Finish:

  [Reset_Modem]

    :DropAndRaiseDTR:2
        ; drops DTR wait 2 sec then raise DTR again
    :SendString:'ATF',0Dh
        ; Load factory configuration 
        ;      Async with V.42 bis
        ; Contains:
        ;    B16   Initiate Calls use 103 at 300bps
        ;    N1    Use highest common line speed
        ;    Q0    Return Result Codes
        ;    V1    Use Word Result Codes
        ;    W0    Do NOT return progress messages
        ;    Y0    Do NOT respond to longspace disconnect
        ;   A0    Connect as Answering modem in auto answer
        ;   G0    No guard tones
        ;   J0    RJ1141S45S telco jacks
        ;   K3    Enable RTSCTS flow control
        ;   Q5    Use Error Correction
        ;   R0    Track CTS to RTS
        ;   S0    DSR always ON
        ;   T4    Grant request from remote for digital loopback (TEST MODE)
        ;   U0    Enable trellis coding
        ;   X0    Use Modem clock
        ;   Y0    User config 0 (ATZ0) as power up default
        ;
        ;
        ;   It also sets the following values which will be reprogrammed below
        ;
        ;    B1    Initiate Calls in 212A at 1200bps
        ;    E1    Echo characters
        ;    L2    Speaker Volume Medium 
        ;    M1    Speaker on until CD
        ;    X4    Return Connection speed
        ;   C0    Assume presence of CD
        ;   D0    Ignore status o DTR

    :Delay:2        ; Ignore the 'OK'
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ;    
        ;Many of those options cause problems so here we set them the way
        ;we want them.  Actually we'll reset the important ones so we
        ;aren't impacted by possible factory changes and script may work
        ;for other modems as well
        
        ;  First a couple of registers
    :SendString:'ATS0=0S2=128S25=50',0Dh
        ;	
        ;	S0=0	Don't answer if DTR up for now.
        ;   S2=128	Disable escape sequence so we can read data which might
        ;			contain it
        ;	S25=50	Set DTR drop detect to .5 seconds.  Required if DCI
        ;				applications are to be supported
        ;
    :Delay:2        ; Ignore the 'OK'
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
       

        ;  Now reset those options we don't want from the F    
        ;  and set up the rest of the main environment

:SendString:'ATB0E0X0C1D2S',0Dh
        ;	
        ;	B0      Use V.22 at 1200bps(NOTE U.S. user may want to delete this)
        ;	E0		Echo OFF
        ;   X0		Simple CONNECT message (no speed indicated)
        ;	C1		DCD follows carrier
        ;	D2		DTR drop causes disconnect
        ;	S		DSR always ON
        ;	
    :Delay:2        ; Ignore the 'OK'
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
       

        ;  Now just a couple things people may have personnal preference on
    :SendString:'ATM0L1',0Dh
        ;	
        ;	M0		Turn off speaker or M1 to turn on for testing
        ;	L1		or at least set the volume LOW
        ;	
    :Delay:2        ; Ignore the 'OK'
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ;    
 
	:SetLineControl:2
		;		Set up bytestream flow control to RTSCTS to match
		;		the \Q3 above.  This allows us to talk to the modem
		;		at a constant rate even if the connection rate 
		;		is lower.
    :DropDTR:          ;Extra precaution against accidental answer
    :Finish:						        ;reset modem completed




  [Wait_For_Call]

    :DropAndRaiseDTR:2
    :SendString:'ATS0=2',0Dh
        ;	
        ;	S0=2	Answer on Ring 2 (required in some countries)
    :Delay:2        ; Ignore the 'OK'
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
 

    :WaitForCarrier:			  ; Wait for CD to go high

       ; ignore the Ring message
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
       ; ignore second Ring message
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah

		
    :IgnoreStringEndingWithCharacter:0Ah
    :SaveStringEndingWithCharacter:0Ah
    :CompareWithSavedString:'CONNECT',0Dh,0Ah
        ; compare saved string with CR

    :JumpIfCompareNotEqual:1
    :OnLine:
    :Finish:


  [Make_A_Call]


    :DropAndRaiseDTR:2

    :SendString:'ATS0=0',0Dh
        ;	
        ;	S0=0	Disable Autoanswer to avoid call conflict
    :Delay:2        ; Ignore the 'OK'
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
 
    :SendString:'ATDT'
        ; initiate dialing
    :Delay:1
    :MapPhoneNumberAndDial:'W,'
        ; The W is the tandem dial (equals) 
        ;       or wait for second dial tone character
        ; The comma is the pause (tilde) S8 seconds before next character


    :Delay:1
    :SendString:0Dh
        ; starts dialing process
    :IgnoreStringEndingWithCharacter:0Ah
    :SaveStringEndingWithCharacter:0Ah

    :CompareWithSavedString:'CONNECT',0Dh,0Ah
    :JumpIfCompareNotEqual:1
    :OnLine:
    :Finish:

;
{Microcom}
; Microcom AX9624c 9600 bps  AX2400 2400 bps
; AS button position  A
; Switch settings  FRONT  4, 7 Down, all others UP
;                   BACK   6,7,8 Down, all others UP (AX9624)
;                           6,8 Down, all others UP   (AX2400)
 
 
  [Reset_Modem]

    :DropAndRaiseDTR:2
        ; drops DTR wait 2 sec then raise DTR again
    :SendString:'45',0Dh
        ; for sync with modem
    :IgnoreStringEndingWithCharacter:21h
    :SendString:'INIT',0Dh
        ; Set the modem to initial state and read current switches
    :IgnoreStringEndingWithCharacter:29h
    :IgnoreStringEndingWithCharacter:20h
    :SendString:'Y',0Dh
        ; modem asks 'are you sure'  we say yes
    :Delay:2
    :SendString:'SCEOFF',0Dh
        ; echo off
    :IgnoreStringEndingWithCharacter:21h
    :SendString:'SA0',0Dh
        ; speaker on until CD
    :IgnoreStringEndingWithCharacter:21h
    :SendString:'S0=1',0Dh
        ; answer after 1 ring
    :IgnoreStringEndingWithCharacter:21h
    :SendString:'S1C1',0Dh
        ; CD follows modem carrier
    :IgnoreStringEndingWithCharacter:21h  
    :SendString:'S7=50',0Dh
        ; Carrier wait before disc = 50 sec
    :IgnoreStringEndingWithCharacter:21h
    :SendString:'PBX0',0Dh
        ; equalization in reliable mode = long
    :IgnoreStringEndingWithCharacter:21h
    :SendString:'SBRK1',0Dh
        ; type of break = 1
    :IgnoreStringEndingWithCharacter:21h
    :SendString:'SB9600',0Dh
        ; baud rate 9600
    :IgnoreStringEndingWithCharacter:21h
    :SendString:'BAOFF',0Dh
        ; adjust serial port to connect speed = OFF
    :IgnoreStringEndingWithCharacter:21h
    :SendString:'BLOFF',0Dh
        ; 
    :IgnoreStringEndingWithCharacter:21h
    :SendString:'SMAUT',0Dh
    :IgnoreStringEndingWithCharacter:21h
        ; set mode to autoreliable
    :Finish:
        ;reset modem completed


  [Wait_For_Call]

    :WaitForCarrier:
    :IgnoreStringEndingWithCharacter:07h
    :OnLine:
    :Finish:


  [Make_A_Call]

    :SendString:'D'
        ; initiate dialing
    :Delay:1
    :MapPhoneNumberAndDial:','
        ; The comma is the pause character
        ; There is no delay character
    :Delay:1
    :SendString:0Dh
    :WaitForCarrier:
    :IgnoreStringEndingWithCharacter:07h
    :OnLine:
    :Finish:  
;

{Milgo}
; Async RacalMilgo
; Use quick set up for 2W Dial (Hayes)

  [Reset_Modem]

    :DropAndRaiseDTR:2
        ; drops DTR wait 2 sec then raise DTR again
    :Delay:2
    :SendString:'ATF',0Dh
        ; Reset the modem
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the 'OK'
    :SendString:'AT\Q1,1',0Dh
        ; RTSCTS flow control
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
    :SendString:'ATE0M0S0=1S2=128',0Dh
        ; Set echo off; speaker off
        ; Answer after 1 ring.
        ; Disable escape sequence so we can
        ; read data which might contain the
        ; escape sequence.
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
    :SendString:'ATX0=1',0Dh
        ; basic result codes only.
    ; Disable long space disconnect
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
    :SendString:'AT\V0',0Dh
        ; NO MNP result codes 
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
;    :SendString:'ATD2',0Dh
;        ; Hang up and enter command state after reset
;    :IgnoreStringEndingWithCharacter:0Ah
;    :IgnoreStringEndingWithCharacter:0Ah
;        ; Ignore the 'OK'
    :SetLineControl:2
    :Finish:
        ;reset modem completed


  [Wait_For_Call]

    :WaitStringReturn:
        ; WAIT FOR THE PHONE TO RING
    :Delay:2
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the first 'Ring' echo
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the 'Connect' response
    :OnLine:
    :Finish:


  [Make_A_Call]

    :SendString:'ATDT'
        ; initiate dialing
    :Delay:1
    :MapPhoneNumberAndDial:','
        ; The comma is the pause character
        ; There is no delay character
    :Delay:1
    :SendString:0Dh
        ; starts dialing process
    :WaitForConnectMsgAndIgnore:0Ah
    :SaveStringEndingWithCharacter:0Ah
    :CompareWithSavedString:'CONNECT',0Dh,0Ah
        ; compare saved string with 1,CR
    :JumpIfCompareNotEqual:2
;    :IgnoreStringEndingWithCharacter:0Ah
;    :IgnoreStringEndingWithCharacter:0Ah
    :Delay:3
    :OnLine:
    :Finish:  


;


{Sema}
; Sematrans 9696 by Phillips 9600 Baud, in Hayes format Async
  [Reset_Modem]

;    :Delay:2
    :DropAndRaiseDTR:2
        ; drops DTR wait 2 sec then raise DTR again
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
;    :Delay:5
;    :SendString:0Dh
;    ; Send a CR
;    :IgnoreStringEndingWithCharacter:0Ah
;    :Delay:5
;
;    :SendString:'A'
;    ; For sync
;    :Delay:1
;    :SendString:'A'
;    ; For sync
;    :Delay:1
;    :SendString:'A'
;    ; For sync
;    :Delay:1
;    :SendString:'A'
;    ; For sync
;    :Delay:1
;    :SendString:'AA'
;    ; For sync
;    :Delay:1
;    :SendString:'AAA'
;    ; For sync
;    :Delay:1
;    :SendString:'AAAA'
;    ; For sync
;    :Delay:1
;    :SendString:0Dh
;    :IgnoreStringEndingWithCharacter:0Ah
;    ; Ignore the CR response
;    :SendString:'ATF',0Dh
;    ; Go into V.25 Bis mode
;    :IgnoreStringEndingWithCharacter:3Eh
;    ; Ignore response ending with greater than
;    :SendString:'RCS',0Dh
;    ; Recall factory configuration
;    :IgnoreStringEndingWithCharacter:20h
;    :SetDataBits:7
;    :SetParity:1
;    ; Ignore response ending with spacebar
;    :SendString:'PRR P2',3Bh,' 01110000',0Dh
;    ; Pulse dial, V.25 bis mode, No display of tel. no.
;    :IgnoreStringEndingWithCharacter:3Eh
;    ; Ignore response ending with greater than
;    :SendString:'PRR P0',3Bh,' 00000000',0Dh
;    ; 9600  4800 bitss, No auto fallback
;    :IgnoreStringEndingWithCharacter:3Eh
;    ; Ignore response ending with greater than
;    :SendString:'PRR P1',3Bh,' 10100000',0Dh
;    ; Asynchronous, 10 bits
;    :IgnoreStringEndingWithCharacter:3Eh
;    ; Ignore response ending with greater than
;    :SendString:'PRR P3',3Bh,' 01000000',0Dh
;    ; 2wire
;    :IgnoreStringEndingWithCharacter:3Eh
;    ; Ignore response ending with greater than
;    :SendString:'PRR P4',3Bh,' 11000100',0Dh
;    ; RTS normal, DTR normal, TxC by modem, Full duplex
;    :IgnoreStringEndingWithCharacter:3Eh
;    ; Ignore response ending with greater than
;    :SendString:'PRR P5',3Bh,' 00000000',0Dh
;    ; No test
;    :IgnoreStringEndingWithCharacter:3Eh
;    ; Ignore response ending with greater than
;    :SendString:'PRR P6',3Bh,' 00100000',0Dh
;    :IgnoreStringEndingWithCharacter:3Eh
;    ; Ignore response ending with greater than
;    :SendString:'PRR P7',3Bh,' 00000000',0Dh
;    :IgnoreStringEndingWithCharacter:3Eh
;    ; Ignore response ending with greater than
;    :SendString:'PRR P8',3Bh,' 01010000',0Dh
;    ; Echo by modem, 8 data bits, No parity, 1 stop bit
;    :IgnoreStringEndingWithCharacter:3Eh
;    ; Ignore response ending with greater than
;    :SendString:'PRR P2',3Bh,' 01111000',0Dh
;    ; Pulse dial, AT mode, No display of tel. no.
;    :IgnoreStringEndingWithCharacter:0Ah
;    ; Ignore response ending with LF  remember this is a Hayes response
;    :SetDataBits:8
;    :SetParity:0
;
;    :Delay:2
;    :IgnoreStringEndingWithCharacter:0Ah
;    :IgnoreStringEndingWithCharacter:0Ah
;    :IgnoreStringEndingWithCharacter:0Ah
    :SendString:'ATX0',0Dh
    ; Basic result codes
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
    :SendString:'ATS0=1',0Dh
    ; Answer after 1 ring
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; ignore the OK response
    :SetLineControl:2
    :Delay:2
    :Finish:

        ;reset modem completed


  [Wait_For_Call]

    :WaitForCarrier:
        ; Wait for CD to go up
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; ignore the RING message
    :OnLine:
    :Finish:

  [Make_A_Call]

    :SendString:'ATDT'
        ; initiate dialing
    :Delay:1
    :MapPhoneNumberAndDial:','
        ; The comma is the pause character
        ; There is no delay character
    :Delay:1
    :SendString:0Dh
        ; starts dialing process
    :IgnoreStringEndingWithCharacter:0Ah
    :SaveStringEndingWithCharacter:0Ah
        ; Engage string ending with LF
    :CompareWithSavedString:'CONNECT',0Dh,0Ah
        ; Compare that string with 'CONNECT',CR,LF
    :JumpIfCompareNotEqual:1
    :WaitForCarrier:
        ; Wait for CD to go up
    :OnLine:
    :Finish:
;


{SupraFAX}
;
; SupraFaxModem V.32 bis
; lGlamb R5.3 930924 Version 2.1
;

; NOTE: This script is specifically keyed to running these modems at 19.2 kbps.
;       This speed is not sustainable on all hardwaresoftware combinations
;       and may have to be adjusted downward (requiring script changes).


; WARNING
; This script intializes the modem to use error correction and data 
; compression protocols (both MNP and V.42).  
; This may cause problems when attempting to establish a link with
; modems not supporting these protocols.
; This script is also set to use TONE dial only.  
;
; The following guidlines will work with many older non MNP or V.42 modems
;
; When CALLING a modem known to not support these protocols:
;    Add the following before the number to dial
;
;        <bs><bs>Q6DT
;
;        <bs> = backspace = 08h
;
; When being CALLED by a modem not supporting these protocols:
;    Have the REMOTE site wait at least 6 to 10 seconds after getting 
;      the CONNECT message before sending user data.
;    In Modem Service this typically means adding :DELAY:6
;      before the :OnLine: command in the Make_A_Call script.
;
;      :JumpIfCompareNotEqual:1    becomes    :JumpIfCompareNotEqual:2
;      :OnLine:                               :Delay:6
;      :Finish:                               :OnLine:
;                                             :Finish:


  [Reset_Modem]

    :DropAndRaiseDTR:2
        ; drops DTR wait 2 sec then raise DTR again
    :SendString:'ATF2',0Dh
        ; Load factory configuration
		; F2 contains
		;		\N3		Auto Reliable Connection
		;		K3 	RTSCTS flow control (see below)
		;		W0		DO NOT report err correction 
		;					CONNECT reports DTE rate NOT line rate.
		;					This means Modem Services does NOT have to
		;					speed adjust.
		;		Q5		ASYNC
		;		D2		Auto Answer disabled when DTR OFF		
		;		C1		DCD indicates Carrier								

    :Delay:2        ; Ignore the 'OK'
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah

	:SetLineControl:2
		;		Set up bytestream flow control to RTSCTS to match
		;		the K3 above.  This allows us to talk to the modem
		;		at a constant rate even if the connection rate 
		;		is lower.


    :SendString:'ATE0M0',0Dh
		;		E0		Echo OFF
		;		M0		Speaker OFF  (for test you might change to M1)
		;		

        ; Ignore the 'OK'

    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
    :SendString:'ATS0=0S2=128',0Dh
        ; 		S0=0	Disable Auto Answer 
        ; 		S2=128	Disable escape sequence so we can
        ; 						read data which might contain the
        ; 						escape sequence.

        ; Ignore the 'OK'
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah

    :DropDTR:
    :Finish:						        ;reset modem completed


  [Wait_For_Call]

    :DropAndRaiseDTR:2

    :SendString:'ATS0=2',0Dh
        ; 		S0=2    Auto Answer after 2 rings
        ; Ignore the 'OK'
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah


    :WaitForCarrier:			  ; Wait for CD to go high

       ; ignore the Ring message
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
       ; ignore second Ring message
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah


		; NOTE: This method of connection assumes the line speed in 
		; 		ModemService.config is 19.2 kbps.  If this is changed then
		;		the following compare must be changed to meet the new
		;		text exactly.

		;		Alternatively, one could have script ignore the CONNECT 
		;		message and assume the upper layers will properly
		;		detect a false connection and reset after appropriate 
		;		interval.

       ; ignore the CONNECT message  OPTION
;				    :IgnoreStringEndingWithCharacter:0Ah
;				    :IgnoreStringEndingWithCharacter:0Ah
;					:OnLine:
;					:Finish:

		
    :IgnoreStringEndingWithCharacter:0Ah
    :SaveStringEndingWithCharacter:0Ah
    :CompareWithSavedString:'CONNECT 19200',0Dh,0Ah
        ; compare saved string with CR
    :JumpIfCompareNotEqual:1
    :OnLine:
    :Finish:



  [Make_A_Call]

    :DropAndRaiseDTR:2

    :SendString:'ATS0=0',0Dh
        ; 		S0=    Disable Auto Answer 
        ; Ignore the 'OK'
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah


    :SendString:'ATDT'
        ; initiate dialing
    :Delay:1
    :MapPhoneNumberAndDial:'W,'
        ; The W is the tandem dial (equals) 
        ;       or wait for second dial tone character
        ; The comma is the pause (tilde) S8 seconds before next character

    :Delay:1
    :SendString:0Dh
        ; starts dialing process
    :IgnoreStringEndingWithCharacter:0Ah
    :SaveStringEndingWithCharacter:0Ah

        ; As Noted above, this CONNECT message must reflect the line speed
		; indicated in the config file.  The alternative of ignoring this
		; message on the outgoing call is NOT recommended.

    :CompareWithSavedString:'CONNECT 19200',0Dh,0Ah
    :JumpIfCompareNotEqual:1
    :OnLine:
    :Finish:


;
{SyncDC2400}
; Convergent DC2400 Synchronous 2400 baud
; Switch settings: Front panel(SW1)  2 On; 1, 3 thru 6 Off
;                   Rear          (SW2)  1, 2 On; 3 thru 7 Off

  [Reset_Modem]

    :DropAndRaiseDTR:2
    :SendString:'ATF',0Dh
        ; Reset the modem
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the 'OK'
    :SendString:'ATM0',0Dh
        ; Set speaker off
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
    :SendString:'ATE0',0Dh
        ; echo off
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
    :SendString:'ATC1',0Dh
        ; Make CD follow true line carrier condition
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
    :SendString:'ATD2',0Dh
        ;  DTR off makes Modem go ON HOOK, assume idle state
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
    :SendString:'ATX0',0Dh
        ; Basic result codes, CONNECT, not CONNECT 2400
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
    :SendString:'ATM1',0Dh
        ; Synchronous mode 1
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
    :Finish:
        ;reset modem completed


  [Wait_For_Call]

    :SendString:'ATS0=1',0Dh
        ; Answer after 1 ring
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the 'OK'
    :WaitStringReturn:
        ; Wait for the phone to ring
;    :IgnoreStringEndingWithCharacter:0Ah
;    :IgnoreStringEndingWithCharacter:0Ah
;        ; Ignore the first 'Ring' echo
;    :Delay:5
;    :IgnoreStringEndingWithCharacter:0Ah
;    :SaveStringEndingWithCharacter:0Ah
;    :CompareWithSavedString:'CONNECT',0Dh,0Ah
;        ; compare saved string with CONNECT,CR,LF
;    :JumpIfCompareNotEqual:1
    :OnLine:
    :Finish:

  [Make_A_Call]

    :SendString:'ATDT'
        ; initiate dialing
    :Delay:1
    :MapPhoneNumberAndDial:','
        ; The comma is the pause character
        ; There is no delay character
    :Delay:1
    :SendString:0Dh
        ; starts dialing process
    :IgnoreStringEndingWithCharacter:0Ah
    :SaveStringEndingWithCharacter:0Ah
        ; Engage string ending with LF
    :CompareWithSavedString:'CONNECT',0Dh,0Ah
        ; Compare that string with 'CONNECT',CR,LF
    :JumpIfCompareNotEqual:1
;    :Delay:5
    :OnLine:
    :Finish:

;
{SyncMicro}
; Microcom AX9624c  AX2400c  2400 bps
; AS button position  A
; Switch settings  FRONT  4, 7 Down, all others UP
:                   BACK   6, 8 Down, all others UP
 
  [Reset_Modem]
    :DropAndRaiseDTR:2
        ; drops DTR wait 2 sec then raise DTR again
    :Delay:2
    :SendString:'45',0Dh
        ; for sync with modem
    :IgnoreStringEndingWithCharacter:21h
    :SendString:'INIT',0Dh
        ; Set the modem to initial state and read current switches
    :IgnoreStringEndingWithCharacter:29h
    :IgnoreStringEndingWithCharacter:20h
    :SendString:'Y',0Dh
        ; modem asks 'are you sure'  we say yes
    :Delay:2
    :SendString:'RESET',0Dh
        ; Reset the modem
    :IgnoreStringEndingWithCharacter:21h
    :SendString:'SCEOFF',0Dh
        ; echo off
    :IgnoreStringEndingWithCharacter:21h
    :SendString:'SA0',0Dh
        ; speaker on until CD
    :IgnoreStringEndingWithCharacter:21h
    :SendString:'SNC1',0Dh
        ;Set to synchronous mode 1  async dial, sync data
    :IgnoreStringEndingWithCharacter:21h
    :SendString:'S0=1',0Dh
        ; answer after 1 ring
    :IgnoreStringEndingWithCharacter:21h
    :SendString:'VMODE0',0Dh
        ; Synchronous modulation mode 0
    :IgnoreStringEndingWithCharacter:21h
    :SendString:'SB2400',0Dh
        ; baud rate 2400
    :IgnoreStringEndingWithCharacter:21h
    :SendString:'S1C1',0Dh
        ; CD follows modem carrier
    :IgnoreStringEndingWithCharacter:21h  
    :SendString:'S1D2',0Dh
        ; DSR and CTS both follow CDsetting
    :IgnoreStringEndingWithCharacter:21h  
    :SendString:'SLLOFF',0Dh
        ; Disable leased line
    :IgnoreStringEndingWithCharacter:21h
    :SendString:'PBX1',0Dh
        ; PBX equalizer  SHRT
        ; Direct line connection or PBX to PBX connection
        ; AutoPBX disabled
    :IgnoreStringEndingWithCharacter:21h  
    :SendString:'CRTS1',0Dh
        ; CTS ignores RTS in Synchronous mode
    :IgnoreStringEndingWithCharacter:21h  
    :SendString:'S25=5',0Dh
        ; Delay to DTR = 5 seconds
    :IgnoreStringEndingWithCharacter:21h  
    :Finish:
        ;reset modem completed



  [Wait_For_Call]

    :WaitForConnectMsgAndIgnore:07h
    :OnLine:
    :Finish:


  [Make_A_Call]

    :SendString:'D'
        ; initiate dialing
    :Delay:1
    :MapPhoneNumberAndDial:','
        ; The comma is the pause character
        ; There is no delay character
    :Delay:1
    :SendString:0Dh
    :WaitForConnectMsgAndSave:07h
    :CompareWithSavedString:'CONNECT 2400',0Dh,0Ah,07h
        ; compare saved string with CONNECT 2400,Cr,Lf,Bl
    :JumpIfCompareNotEqual:1
    :OnLine:
    :Finish:  


;
{SyncHayes}
; Hayes 2400 Baud, in Hayes format

 
  [Reset_Modem]

    :DropAndRaiseDTR:2
        ; drops DTR wait 1 sec then raise DTR again
    :SendString:'ATF',0Dh
        ; Load factory configuration
    :Delay:2
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the 'OK'
    :SendString:'ATE0M0X0',0Dh
        ; Echo Off, speaker off, basic result codes
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the 'OK'
    :SendString:'ATS0=1S2=128S25=5',0Dh
        ; Answer after 1 ring,
        ; Disable escape sequence so we can
        ; read data which might contain the
        ; escape sequence,
        ; Delay to DTR 5 seconds after connection establishment
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the 'OK'
    :SendString:'ATC1D2M1R1S1',0Dh
        ; DCD on when carrier detected,
        ; Hang up and enter command state after reset,
        ; CTS always ON  modem ignores RTS
        ; Synchronous mode 1,
        ; DSR operates according to RS232C specifications,
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; Ignore the 'OK'
    :Finish:
        ;reset modem completed


  [Wait_For_Call]

    :WaitForCarrier:
        ; Wait for CD to go high
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ; ignore the Ring message
    :IgnoreStringEndingWithCharacter:0Ah
    :SaveStringEndingWithCharacter:0Ah
    :CompareWithSavedString:'CONNECT',0Dh,0Ah
        ; compare saved string with CR
    :JumpIfCompareNotEqual:1
    :OnLine:
    :Finish:


  [Make_A_Call]

    :SendString:'ATDT'
        ; initiate dialing
    :Delay:1
    :MapPhoneNumberAndDial:','
        ; The comma is the pause character
        ; There is no delay character
    :Delay:1
    :SendString:0Dh
        ; starts dialing process
    :IgnoreStringEndingWithCharacter:0Ah
    :SaveStringEndingWithCharacter:0Ah
    :CompareWithSavedString:'CONNECT',0Dh,0Ah
        ; compare saved string with CR
    :JumpIfCompareNotEqual:1
    :OnLine:
    :Finish:

;
{TelebitWB}
;
; Telebit WorldBlazer
; lGlamb R5.3 930924   Version 1.1
;

; WARNING
; This script intializes the modem to use error correction and data 
; compression protocols (both MNP and V.42).  
; This may cause problems when attempting to establish a link with
; modems not supporting these protocols.
; This script is also set to use TONE dial only.  
;
; The following guidlines will work with many older non MNP or V.42 modems
;
; When CALLING a modem known to not support these protocols:
;    Add the following before the number to dial
;
;        <bs><bs>S180=0S190=0DT
;
;        <bs> = backspace = 08h
;
;       NOTE: Use of this technique will also require modification of the
;             Make_A_Call script to allow passing of the = sign normally
;             used to indicate Wait For Second Dial Tone (or tandem calling). ;             So all numbers stored for this modem will need to include the W
;             instead of expecting Modem Service to map it.
;             See MapPhoneNumberAnd Dial below. 
;
;
; When being CALLED by a modem not supporting these protocols:
;    Have the REMOTE site wait at least 5 seconds after getting the 
;      CONNECT message before sending user data.
;    In Modem Service this typically means adding :DELAY:5 
;      before the :OnLine: command in the Make_A_Call script.
;
;      :JumpIfCompareNotEqual:1    becomes    :JumpIfCompareNotEqual:2
;      :OnLine:                               :Delay:5
;      :Finish:                               :OnLine:
;                                             :Finish:


  [Reset_Modem]

    :DropAndRaiseDTR:2
        ; drops DTR wait 2 sec then raise DTR again

    :SendString:'ATs254=255',0Dh
        ; Set F to point at factory defaults

    :SendString:'ATF',0Dh
        ; Load factory configuration 

        ;    
        ;Not the best option selection for Modem Service but it does get    
        ;us to a known state.   Important setting that do default properly 
        ;are:

        ;	V1		Response messages not codes
        ;	S0		DSR always ON
        ;   Q0     Async Mode
  		;	R3     CTS Flow control
        ;                     negotiation with some modems
        ;    
    :Delay:2        ; Ignore the 'OK'
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ;    
        ;Many of the default options cause problems so here we set them the way
        ;we want them.  Actually we'll reset the important ones so we
        ;aren't impacted by possible factory changes and script may work
        ;for other modem models as well
        
        ;  First a couple of registers
    :SendString:'ATS0=0S2=128S25=50',0Dh
        ;	
        ;	S0=0	Disable Auto Answer for now
        ;   S2=128	Disable escape sequence so we can read data which might
        ;			contain it
        ;	S25=50	Set DTR drop detect to .5 seconds.  Required if DCI
        ;				applications are to be supported
        ;
    :Delay:2        ; Ignore the 'OK'
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
 

        ; Following are all factory defaults but set for safty
   :SendString:'ATS51=252S59=0S180=2S190=1S191=7',0Dh
        ;	
		;   S51=252 Autobaud detect on every AT
		;   S59=0   No protocol suffixes used on CONNECT msg
		;   S180=2  Use V.42 with MNP fallback error correction
		;   S190=1  Data Compression Enabled
        ;   S191=7  Use Telebit LZ compression or V.42bis
        ;               NOTE: you may need to set S191=6 to disable LZ
        ;
    :Delay:2        ; Ignore the 'OK'
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        

        ;  Now set the main environment
    :SendString:'ATE0C1D2B0X0S58=2S68=2',0Dh
        ;	
        ;	
        ;	E0		Echo OFF
        ;	C1		DCD follows carrier
        ;	D2		DTR drop causes disconnect
        ;   B0      Use CCITT standard at 3001200 bps
        ;              NOTE: Use B1 to connect with Bell Standard modems
        ;	X0		Simple result codes (CONNECT)
        ;   S58=2   Use RTSCTS DTE flow control
        ;   S68=2   Use RTSCTS DCE flow control
        ;	
    :Delay:2        ; Ignore the 'OK'
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
       

        ;  Now just a couple things people may have personnal preference on
    :SendString:'ATM0L1',0Dh
        ;	
        ;	M0		Turn off speaker or M1 to turn on for testing
        ;	L1		or at least set the volume LOW
        ;	
    :Delay:2        ; Ignore the 'OK'
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ;    
 
	:SetLineControl:2
		;		Set up bytestream flow control to RTSCTS to match
		;		the H3 above.  This allows us to talk to the modem
		;		at a constant rate even if the connection rate 
		;		is lower.

    :DropDTR:

    :Finish:						        ;reset modem completed




  [Wait_For_Call]


    :DropAndRaiseDTR:2

    :SendString:'ATS0=2',0Dh
        ;	
        ;	S0=2	Answer on Ring 2 (required in some countries)
        ;
    :Delay:2        ; Ignore the 'OK'
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
 

    :WaitForCarrier:			  ; Wait for CD to go high

       ; ignore the Ring message
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
       ; ignore second Ring message
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
		
    :IgnoreStringEndingWithCharacter:0Ah
    :SaveStringEndingWithCharacter:0Ah
    :CompareWithSavedString:'CONNECT',0Dh,0Ah
        ; compare saved string with CR
    :JumpIfCompareNotEqual:1
    :OnLine:
    :Finish:


  [Make_A_Call]

    :DropAndRaiseDTR:2

    :SendString:'ATS0=0',0Dh
        ;	
        ;	S0=	    Disable Auto Answer        ;
    :Delay:2        ; Ignore the 'OK'
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
 


    :SendString:'ATDT'
        ; initiate dialing
    :Delay:1

    ; For use with non error correcting modems, the following should be 
    ; replaced with      
;    :MapPhoneNumberAndDial:'=,'

    :MapPhoneNumberAndDial:'W,'
        ; The W is the tandem dial (equals) 
        ;       or wait for second dial tone character
        ; The comma is the pause (tilde) S8 seconds before next character

    :Delay:1
    :SendString:0Dh
        ; starts dialing process
    :IgnoreStringEndingWithCharacter:0Ah
    :SaveStringEndingWithCharacter:0Ah

    :CompareWithSavedString:'CONNECT',0Dh,0Ah
    :JumpIfCompareNotEqual:1
    :OnLine:
    :Finish:

;
{UDSV3227}
;
; UDS V.3227
; lGlamb R5.3 930924  Version 1.4
;


; WARNING
; This script intializes the modem to use error correction and data 
; compression protocols (both MNP and V.42).  
; This may cause problems when attempting to establish a link with
; modems not supporting these protocols.
; This script is also set to use TONE dial only.  
;
; The following guidlines will work with many older non MNP or V.42 modems
;
; When CALLING a modem known to not support these protocols:
;    Add the following before the number to dial
;
;        <bs><bs>\N0DT
;
;        <bs> = backspace = 08h
;
; When being CALLED by a modem not supporting these protocols:
;    Have the REMOTE site wait at least 5 seconds after getting CONNECT message
;      before sending user data.
;    In Modem Service this typically means adding :DELAY:5 
;      before the :OnLine: command in the Make_A_Call script.
;
;      :JumpIfCompareNotEqual:1    becomes    :JumpIfCompareNotEqual:2
;      :OnLine:                               :Delay:5
;      :Finish:                               :OnLine:
;                                             :Finish:

  [Reset_Modem]

    :DropAndRaiseDTR:2
        ; drops DTR wait 2 sec then raise DTR again
    :SendString:'ATF',0Dh
        ; Load factory configuration 1
        ;      Async with V.42 bis
        ; Contains
        ;    LAPM and MNP Enabled
        ;    Data Compression Normal
        ;    Constant speed DTE
        ;    No Protocol response codes
        ;    XONXOFF flow control
        ;    8N1
        ;    IGNORE DTR
        ;    DCD HIGH
        ;    CTS HIGH
        ;    DSR HIGH
        ;    Answer on 1 Ring
        ;    Call Timeout 30 sec
        ;    Speaker on MED until CD
        ;    
        ;Not the best option selection for Modem Service but it does get    
        ;us to a known state.
        ;    
    :Delay:2        ; Ignore the 'OK'
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ;    
        ;Many of those options cause problems so here we set them the way
        ;we want them.  Actually we'll reset the important ones so we
        ;aren't impacted by possible factory changes and script may work
        ;for other modems as well
        
        ;  First a couple of registers
    :SendString:'ATS0=0S2=128S25=50',0Dh
        ;	
        ;	S0=0	Don't answer if DTR up for now.
        ;   S2=128	Disable escape sequence so we can read data which might
        ;			contain it
        ;	S25=50	Set DTR drop detect to .5 seconds.  Required if DCI
        ;				applications are to be supported
        ;
    :Delay:2        ; Ignore the 'OK'
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
       

        ;  Now set the main environment
    :SendString:'ATE0V1X0C1D2SC1\C1\J\N7\V\Q3',0Dh
        ;	
        ;	
        ;	E0		Echo OFF
        ;	V1		Response messages not codes
        ;   X0		Simple CONNECT message (no speed indicated)
        ;	C1		DCD follows carrier
        ;	D2		DTR drop causes disconnect
        ;	S		DSR always ON
        ;	C1		Enable Data Compression (MNP5 or V.42vis)
        ;	\C1     Buffer Data  
        ;				NOTE: the \C1 option is critical if modem
        ;				is to talk with non V.42 modems
        ;	\J		Constant Speed DTE
        ;	\N7     LAPM, MNP or NORMAL mode
        ;				NOTE: the \N7 option may vary with other modem
        ;				styles.
        ;	\V1     Disable Protocol Response Codes
        ;	\Q3		RTSCTS flow control (see below)
        ;	
    :Delay:2        ; Ignore the 'OK'
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
       

        ;  Now just a couple things people may have personnal preference on
    :SendString:'ATM0L1',0Dh
        ;	
        ;	M0		Turn off speaker or M1 to turn on for testing
        ;	L1		or at least set the volume LOW
        ;	
    :Delay:2        ; Ignore the 'OK'
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ;    
 
	:SetLineControl:2
		;		Set up bytestream flow control to RTSCTS to match
		;		the \Q3 above.  This allows us to talk to the modem
		;		at a constant rate even if the connection rate 
		;		is lower.
    :DropDTR:          ;Extra precaution against accidental answer
    :Finish:						        ;reset modem completed




  [Wait_For_Call]

    :DropAndRaiseDTR:2
    :SendString:'ATS0=2',0Dh
        ;	
        ;	S0=2	Answer on Ring 2 (required in some countries)
    :Delay:2        ; Ignore the 'OK'
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
 

    :WaitForCarrier:			  ; Wait for CD to go high

       ; ignore the Ring message
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
       ; ignore second Ring message
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah

		
    :IgnoreStringEndingWithCharacter:0Ah
    :SaveStringEndingWithCharacter:0Ah
    :CompareWithSavedString:'CONNECT',0Dh,0Ah
        ; compare saved string with CR

    :JumpIfCompareNotEqual:1
    :OnLine:
    :Finish:


  [Make_A_Call]


    :DropAndRaiseDTR:2

    :SendString:'ATS0=0',0Dh
        ;	
        ;	S0=0	Disable Autoanswer to avoid call conflict
    :Delay:2        ; Ignore the 'OK'
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
 
    :SendString:'ATDT'
        ; initiate dialing

    :Delay:1
    :MapPhoneNumberAndDial:'W,'
        ; The W is the tandem dial (equals) 
        ;       or wait for second dial tone character
        ; The comma is the pause (tilde) S8 seconds before next character

    :Delay:1
    :SendString:0Dh
        ; starts dialing process
    :IgnoreStringEndingWithCharacter:0Ah
    :SaveStringEndingWithCharacter:0Ah

    :CompareWithSavedString:'CONNECT',0Dh,0Ah
    :JumpIfCompareNotEqual:1
    :OnLine:
    :Finish:

;



{USRDUAL}
;
; USR Courier HST DUAL
; lGlamb R5.3 930924   Version 1.3
;

; WARNING
; This script intializes the modem to use error correction and data 
; compression protocols (both MNP and V.42).  
; This may cause problems when attempting to establish a link with
; modems not supporting these protocols.
; This script is also set to use TONE dial only.  
;
; The following guidlines will work with many older non MNP or V.42 modems
;
; When CALLING a modem known to not support these protocols:
;    Add the following before the number to dial
;
;        <bs><bs>M0DT
;
;        <bs> = backspace = 08h
;
; When being CALLED by a modem not supporting these protocols:
;    Have the REMOTE site wait at least 5 seconds after getting the 
;      CONNECT message before sending user data.
;    In Modem Service this typically means adding :DELAY:5 
;      before the :OnLine: command in the Make_A_Call script.
;
;      :JumpIfCompareNotEqual:1    becomes    :JumpIfCompareNotEqual:2
;      :OnLine:                               :Delay:5
;      :Finish:                               :OnLine:
;                                             :Finish:


  [Reset_Modem]

    :DropAndRaiseDTR:2
        ; drops DTR wait 2 sec then raise DTR again
    :SendString:'ATF',0Dh
        ; Load factory configuration 

        ;    
        ;Not the best option selection for Modem Service but it does get    
        ;us to a known state.
        ;    
    :Delay:2        ; Ignore the 'OK'
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ;    
        ;Many of those options cause problems so here we set them the way
        ;we want them.  Actually we'll reset the important ones so we
        ;aren't impacted by possible factory changes and script may work
        ;for other modems as well
        
        ;  First a couple of registers
    :SendString:'ATS0=0S2=128',0Dh
        ;	
        ;	S0=0	Disbable Auto Answer for now
        ;   S2=128	Disable escape sequence so we can read data which might
        ;			contain it
        ; NOTE the following register is NOT supported so use of this modem
        ;          with DCI application is questionable
        ;	S25=50	Set DTR drop detect to .5 seconds.  Required if DCI
        ;				applications are to be supported
        ;
    :Delay:2        ; Ignore the 'OK'
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
       

        ;  Now set the main environment
    :SendString:'ATE0V1C1D2SB1K1X0A0H1M4',0Dh
        ;	
        ;	
        ;	E0		Echo OFF
        ;	V1		Response messages not codes
        ;	C1		DCD follows carrier
        ;	D2		DTR drop causes disconnect
        ;	S		DSR always ON
        ;	B1		Fixed DTE speed
        ;	K1		Enable Data Compression if DTE rate higher than line
        ;	X0		Simple result codes (CONNECT)
        ;   A0		No ARQ codes
        ;	H1		RTSCTS flow control (see below)
        ;	M4     ARQ or NORMAL mode
        ;	
    :Delay:2        ; Ignore the 'OK'
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
       

        ;  Now just a couple things people may have personnal preference on
    :SendString:'ATM0L1',0Dh
        ;	
        ;	M0		Turn off speaker or M1 to turn on for testing
        ;	L1		or at least set the volume LOW
        ;	
    :Delay:2        ; Ignore the 'OK'
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
        ;    
 
	:SetLineControl:2
		;		Set up bytestream flow control to RTSCTS to match
		;		the H3 above.  This allows us to talk to the modem
		;		at a constant rate even if the connection rate 
		;		is lower.

    :DropDTR:

    :Finish:						        ;reset modem completed




  [Wait_For_Call]


    :DropAndRaiseDTR:2

    :SendString:'ATS0=2',0Dh
        ;	
        ;	S0=2	Answer on Ring 2 (required in some countries)
        ;
    :Delay:2        ; Ignore the 'OK'
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
 

    :WaitForCarrier:			  ; Wait for CD to go high

       ; ignore the Ring message
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
       ; ignore second Ring message
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
		
    :IgnoreStringEndingWithCharacter:0Ah
    :SaveStringEndingWithCharacter:0Ah
    :CompareWithSavedString:'CONNECT',0Dh,0Ah
        ; compare saved string with CR
    :JumpIfCompareNotEqual:1
    :OnLine:
    :Finish:


  [Make_A_Call]

    :DropAndRaiseDTR:2

    :SendString:'ATS0=0',0Dh
        ;	
        ;	S0=	    Disable Auto Answer        ;
    :Delay:2        ; Ignore the 'OK'
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
 


    :SendString:'ATDT'
        ; initiate dialing
    :Delay:1
    :MapPhoneNumberAndDial:'W,'
        ; The W is the tandem dial (equals) 
        ;       or wait for second dial tone character
        ; The comma is the pause (tilde) 2 seconds before next character

    :Delay:1
    :SendString:0Dh
        ; starts dialing process
    :IgnoreStringEndingWithCharacter:0Ah
    :SaveStringEndingWithCharacter:0Ah

    :CompareWithSavedString:'CONNECT',0Dh,0Ah
    :JumpIfCompareNotEqual:1
    :OnLine:
    :Finish:

;
{Vadic}
; RacalVadic VA212
; Async 1200


  [Reset_Modem]

    :DropAndRaiseDTR:2 
    :SendString:05,0DH
        ; sends CntrlE CR to get attention
    :Delay:1
    :IgnoreStringEndingWithCharacter:0AH
    :SaveStringEndingWithCharacter:0AH
    :CompareWithSavedString:'DY'
    ; check if it is READY
    :JumpIfCompareNotEqual:3
    :SendString:'I',0DH
    :Delay:2
    :SendString:05,0DH

    :IgnoreStringEndingWithCharacter:'*'
    :SendString:'O',0DH
        ; the following programs the needed options
        ; such as transperant mode etc.
    :IgnoreStringEndingWithCharacter:0AH
    :IgnoreStringEndingWithCharacter:0AH

    :SendString:'1',0Dh
        ; selects standard options
    :IgnoreStringEndingWithCharacter:0AH
    :IgnoreStringEndingWithCharacter:0AH
    :SendString:'3',0DH
        ; options are set to default values
    :IgnoreStringEndingWithCharacter:0AH
    :IgnoreStringEndingWithCharacter:0AH
    :SendString:0DH
        ; send CR to program it in
    :IgnoreStringEndingWithCharacter:'*'

    :SendString:'O',0DH
        ; now we are going to program needed options
    :IgnoreStringEndingWithCharacter:0AH
    :IgnoreStringEndingWithCharacter:0AH

    :SendString:'24',0Dh
        ; selects call progress detect
    :IgnoreStringEndingWithCharacter:0AH
    :IgnoreStringEndingWithCharacter:0AH
    :SendString:'2',0DH
        ; call progress dectect is disabled
    :IgnoreStringEndingWithCharacter:0AH
    :IgnoreStringEndingWithCharacter:0AH

    :SendString:'25',0DH
        ; failed call delay select
    :IgnoreStringEndingWithCharacter:0AH
    :IgnoreStringEndingWithCharacter:0AH
    :SendString:'1',0DH
        ; program it to 30 seconds
    :IgnoreStringEndingWithCharacter:0AH
    :IgnoreStringEndingWithCharacter:0AH

    :SendString:'16',0DH
        ; carrier detect
    :IgnoreStringEndingWithCharacter:0AH
    :IgnoreStringEndingWithCharacter:0AH
    :SendString:'2',0DH
        ; program it to normal
    :IgnoreStringEndingWithCharacter:0AH
    :IgnoreStringEndingWithCharacter:0AH

    :SendString:'1',0DH
        ; disable options
    :IgnoreStringEndingWithCharacter:0AH
    :IgnoreStringEndingWithCharacter:0AH
    :SendString:'2',0DH
    :IgnoreStringEndingWithCharacter:0AH
    :IgnoreStringEndingWithCharacter:0AH

    :SendString:0DH
        ; send CR to program it in

    :IgnoreStringEndingWithCharacter:'*'
    :SendString:'I',0DH
        ; sends IDLE command to modem
    :IgnoreStringEndingWithCharacter:0AH
    :SaveStringEndingWithCharacter:0AH
    :CompareWithSavedString:'LE    ',0DH,0AH
        ; look for response (IDLE    CR,LF)
    :Finish:


  [Wait_For_Call]

    :WaitNoStringReturn:
    :OnLine:
    :Finish:


  [Make_A_Call]

    :Delay:3
    :SendString:05,0DH
        ; sends CntrlE, CR to get attention
    :Delay:1
    :IgnoreStringEndingWithCharacter:0AH
    :IgnoreStringEndingWithCharacter:'*'
    :SendString:'D',0DH
        ; sends D to initiate dialing
    :IgnoreStringEndingWithCharacter:0AH
    :IgnoreStringEndingWithCharacter:0AH
    :MapPhoneNumberAndDial:'K'
        ; map phone number, pause character is K
    :SendString:0DH,0DH
        ; here we are just ignoring strings
        ; returned from modem
    :IgnoreStringEndingWithCharacter:0AH
    :IgnoreStringEndingWithCharacter:0AH
    :IgnoreStringEndingWithCharacter:0AH

    :SaveStringEndingWithCharacter:0AH
    :CompareWithSavedString:'...',0DH,00,00,0AH
        ; compare with (Dialing ......)
    :JumpIfCompareNotEqual:1

    :IgnoreStringEndingWithCharacter:0AH
        ; ignoring the response (Answer Tone, etc.)

    :SaveStringEndingWithCharacter:0AH
    :CompareWithSavedString:'LINE ',0DH,0AH
        ; finally we are going to compare with
        ; ONLINE CR,LF
    :JumpIfCompareNotEqual:3
        ; if not equal then jumps 2 commands
    :IgnoreStringEndingWithCharacter:07h
        ; ignore bell char
    :Delay:2
    :OnLine:
    :IgnoreStringEndingWithCharacter:'*'
        ; here we have to make the modem IDLE again
        ; as the modem is not connected
    :SendString:'I',0DH
    :IgnoreStringEndingWithCharacter:0AH
    :IgnoreStringEndingWithCharacter:0AH
    :Finish:

;
{Ventel31}
; Ventel MC120031


  [Reset_Modem]

    :DropAndRaiseDTR:3
    :SendString:0DH
    :Delay:1
    :SendString:0DH
        ; sends CR, CR to get attention
        ; same as Bizcomp
    :IgnoreStringEndingWithCharacter:'$'
    :SendString:'L'
    :IgnoreStringEndingWithCharacter:'?'
    :SendString:'S'
    :IgnoreStringEndingWithCharacter:':'
    :SendString:0Dh
    :IgnoreStringEndingWithCharacter:'$'
    :Finish:


  [Wait_For_Call]

    :SendString:'Q'
        ; sends Q for QUIT
    :IgnoreStringEndingWithCharacter:'T'
        ; gets the response from modem back
    :WaitNoStringReturn:
        ; same as cermetek
    :OnLine:
    :Finish:


  [Make_A_Call]

    :SendString:'K'
    :Delay:2
    :MapPhoneNumberAndDial:''
    :SendString:0DH,
        ; dialing process by sending
        ; K... phone number.., CR
        ; e.g. <K95551212,CR>

    :IgnoreStringEndingWithCharacter:0AH
    :IgnoreStringEndingWithCharacter:0AH
    :IgnoreStringEndingWithCharacter:0AH
        ; here we ignore response strings from
        ; the modem
    :SaveStringEndingWithCharacter:0AH
    :CompareWithSavedString:'',0DH,0AH
        ; now we compare with ONLINE 
    :JumpIfCompareNotEqual:2
    :Delay:2
    :OnLine:
    :Finish:


;


{V25BisMilgo}
; RacalMilgo V.25 Bis mode

  [Reset_Modem]

    :DropAndRaiseDTR:2
    :Delay:2
    :SetDataBits:7
    :SetParity:1
    :SendString:'DIC',0Dh
        ; Disregard Incoming Call
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
;    :Delay:2
    :Finish:


  [Wait_For_Call]

    :SendString:'CIC',0Dh
        ; Connect Incoming Call
    :IgnoreStringEndingWithCharacter:0Ah
    :IgnoreStringEndingWithCharacter:0Ah
    :WaitForConnectMsgAndIgnore:0Ah
    :SaveStringEndingWithCharacter:0Ah
    :CompareWithSavedString:'INC',0Dh,0Ah
        ; compare saved string with INC,CR,LF
    :JumpIfCompareNotEqual:5
    :WaitNoStringReturn:
    ; Wait for CD
    :SetLineControl:2
    :SetDataBits:8
    :SetParity:0
    :OnLine:
    :Finish:

  [Make_A_Call]

    :SendString:'CRN T'
        ; Call Request Tone dial
    :Delay:1
    :MapPhoneNumberAndDial:'<:'
        ; < is the pause character
        ; colon is the delay character
    :Delay:1
    :SendString:0Dh
        ; starts dialing process
    :IgnoreStringEndingWithCharacter:0Ah
    :SaveStringEndingWithCharacter:0Ah
        ; Save response
    :SetLineControl:2
    :SetDataBits:8
    :SetParity:0
    :Delay:1
    :WaitForCarrier:
        ; Wait for CD to go up
;    :Delay:2
    :OnLine:
    :Finish:

;

{V25BisSema}
; Sematrans 9696 by Phillips 9600 Baud, in V.25Bis format Async
  [Reset_Modem]

;    :Delay:5
    :DropAndRaiseDTR:2
        ; drops DTR wait 2 sec then raise DTR again
;    :Delay:5
    :IgnoreStringEndingWithCharacter:20h
;    ; Ignore the '> ' prompt
;    :SendString:0Dh
;    ; Send a CR
;    :Delay:5
;
;    :SetDataBits:7
;    :SetParity:1
;    :SendString:'A'
;    ; For sync
;    :Delay:1
;    :SendString:'A'
;    ; For sync
;    :Delay:1
;    :SendString:'A'
;    ; For sync
;    :Delay:1
;    :SendString:'A'
;    ; For sync
;    :Delay:1
;    :SendString:'AA'
;    ; For sync
;    :Delay:1
;    :SendString:'AAA'
;    ; For sync
;    :Delay:1
;    :SendString:'AAAA'
;    ; For sync
;    :Delay:1
;    :SendString:0Dh
;    :IgnoreStringEndingWithCharacter:0Dh
;    ; Ignore the CR response
;    :SendString:'ATF',0Dh
;    ; Go into V.25 Bis mode
;    :IgnoreStringEndingWithCharacter:3Eh
;    ; Ignore response ending with greater than
;    :SendString:'RCS',0Dh
;    ; Recall factory configuration
;    :IgnoreStringEndingWithCharacter:3Eh
;    ; Ignore response ending with greater than
;    :SendString:'PRR P2',3Bh,' 01110000',0Dh
;    ; Pulse dial, V.25 bis mode, No display of tel. no.
;    :IgnoreStringEndingWithCharacter:3Eh
;    ; Ignore response ending with greater than
;    :SendString:'PRR P0',3Bh,' 00000000',0Dh
;    ; 9600  4800 bitss, No auto fallback
;    :IgnoreStringEndingWithCharacter:3Eh
;    ; Ignore response ending with greater than
;    :SendString:'PRR P1',3Bh,' 10100000',0Dh
;    ; Asynchronous, 10 bits
;    :IgnoreStringEndingWithCharacter:3Eh
;    ; Ignore response ending with greater than
;    :SendString:'PRR P3',3Bh,' 01000000',0Dh
;    ; 2wire
;    :IgnoreStringEndingWithCharacter:3Eh
;    ; Ignore response ending with greater than
;    :SendString:'PRR P4',3Bh,' 11000100',0Dh
;    ; RTS normal, DTR normal, TxC by modem, Full duplex
;    :IgnoreStringEndingWithCharacter:3Eh
;    ; Ignore response ending with greater than
;    :SendString:'PRR P5',3Bh,' 00000000',0Dh
;    ; No test
;    :IgnoreStringEndingWithCharacter:3Eh
;    ; Ignore response ending with greater than
;    :SendString:'PRR P6',3Bh,' 00100000',0Dh
;    :IgnoreStringEndingWithCharacter:3Eh
;    ; Ignore response ending with greater than
;    :SendString:'PRR P7',3Bh,' 00000000',0Dh
;    :IgnoreStringEndingWithCharacter:3Eh
;    ; Ignore response ending with greater than
;    :SendString:'PRR P8',3Bh,' 01010000',0Dh
;    ; Echo by modem, 8 data bits, No parity, 1 stop bit
;    :IgnoreStringEndingWithCharacter:3Eh
;    ; Ignore response ending with greater than
;    :SendString:'PRR P2',3Bh,' 01110000',0Dh
;    ; Pulse dial, V.25 bis mode, No display of tel. no.
;    :IgnoreStringEndingWithCharacter:3Eh
;    ; Ignore response ending with greater than
;    :SetDataBits:8
;    :SetParity:0
;    :Delay:2
    :SetLineControl:2
    :Finish:

        ;reset modem completed


  [Wait_For_Call]

;    :Delay:5
    :WaitForConnectMsgAndIgnore:0Ah
    ; Ignore CR,LF
    :WaitForConnectMsgAndSave:20h
    :CompareWithSavedString:'INC',0Dh,0Ah,3Eh,20h
        ; compare saved string with INC,>, 
    :JumpIfCompareNotEqual:2
    :WaitForCarrier:
        ; Wait for the CD to rise
    :OnLine:
    :Finish:

  [Make_A_Call]

;    :Delay:5
    :SendString:'CRN '
        ; initiate dialing
    :Delay:1
    :MapPhoneNumberAndDial:','
        ; The comma is the pause character
        ; There is no delay character
    :Delay:1
    :SendString:0Dh
        ; starts dialing process
    :IgnoreStringEndingWithCharacter:0Ah
    ; Ignore CR,LF
 ;   :Delay:5
    :WaitForCarrier:
        ; Wait for the CD to rise
    :Delay:2
    :OnLine:
    :Finish:

;

{Direct}
; Direct RS232 connection (no modem)


  [Reset_Modem]

    :DropAndRaiseDTR:1
        ; drops DTR wait 1 sec then raise DTR again
    :Finish:
        ; oompleted


  [Wait_For_Call]

    :OnLine:
    :Finish:


  [Make_A_Call]

    :OnLine:
    :Finish:
;

{DirectCTS}
; Direct RS232 connection (no modem) with CTS flow control


  [Reset_Modem]

    :DropAndRaiseDTR:1
        ; drops DTR wait 1 sec then raise DTR again
    :SetLineControl:2
        ; Set CTS flow control
    :Finish:
        ; oompleted


  [Wait_For_Call]

    :OnLine:
    :Finish:


  [Make_A_Call]

    :OnLine:
    :Finish:


;

{DTRDial}
; Any modem DTR Dial mode

[Reset_Modem]

    :DropDTR:
    :Delay:2
    :Finish:
        ;reset modem completed


[Wait_For_Call]

    :WaitForSignal:1
    ; Wait for Ring Indicator
    :RaiseDTR:
    :WaitForCarrier:
        ; Wait for the CD to rise
    :OnLine:
    :Finish:


[Make_A_Call]

    :RaiseDTR:
    :WaitForCarrier:
        ; Wait for the CD to rise
    :Delay:2
    :OnLine:
    :Finish:

;
gEndingWithCharacter:3Eh
;    ; Ignore response ending with greater than
;    :SendString:'RCS',0Dh
;    ; Recall factory configuration
;    :IgnoreStringEndingWithCharacter:3Eh
;    ; Ignore response ending with greater than
;    :SendString:'PRR P