home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 April
/
Chip_1997-04_cd.bin
/
ovladace
/
zyxel
/
software
/
ms-mail
/
zyx2864.mdm
next >
Wrap
Text File
|
1997-02-20
|
11KB
|
381 lines
;**************************************************************************
;
; Microsoft Mail Script File
;
; Filename: ZYX2864.MDM
; Date : Jan 30, 1996
; Script : Script file for ZyXEL ELITE 2864 series modem
; modified: Robert Pabeschitz, Floegl Software - Vienna, Austria
;
; This script file contains the standard modem setup strings used by
; the External, Transmit and Listen programs. There are five procedures
; defined in this script file for setting up the modem and for connecting
; to a remote External machine.
;
; The modem setup strings used here will be adequate for most people
; but there may be some changes required if you are dialing overseas and
; require a longer wait for Carrier Detect (S7 register) or if you wish
; to change the speaker volume. Note that if you used the -Innn option
; in version 1.0 or 2.0 that you will have to modify the S7 register and
; recompile this script file.
;
; Consult your modem manual for more information on setup options.
;
; - Please note that this driver has only been modified by ZyXEL
; for Elite 2864 V.34 modem
; - For using 57600 bps DTE speed, 16550/16552 UART is demanded,
; otherwise 38400 bps DTE speed is recommended.
; - Link speed 31200, 33600 bps are not supported, they are reserved for
; future expension.
; - For technical information, please contact ZyXEL head office.
; E-Mail address: support@zyxel.hinet.net
;
; Script procedures defined:
; INITIALIZE
; RESET
; CALL
; ANSWER
; DISCONNECT
;
; Return codes for External, Transmit, Listen:
; 0 - OK
; 1 - CONNECT
; 2 - RING
; 3 - NO CARRIER
; 4 - ERROR
; 5 - CONNECT 1200
; 6 - NO DIAL TONE
; 7 - BUSY
; 8 - NO ANSWER
; 9 - RINGING
; 10 - CONNECT 2400
; 11 - CONNECT 4800
; 12 - CONNECT 9600
; 14 - CONNECT 19200
; 15 - CONNECT 7200
; 16 - CONNECT 12000
; 17 - CONNECT 14400
; 18 - CONNECT 16800
; 42 - CONNECT 21600
; 41 - CONNECT 24000
; 40 - CONNECT 26400
; 39 - CONNECT 28800
; 35 - CONNECT 31200
; 38 - CONNECT 33600
;
;**************************************************************************
INITIALIZE:
title "ZyXEL Elite 2864 series modem"
baud 57600 ; set the baud rate
display " Baud Rate : 57600"
$attempts = 5
init_retry:
sendln "ATZ0" ; reset modem to default settings
wait 2
waitrsp 1
if ("0" isin response)
goto reset_okay
if ("OK" isin response)
{
reset_okay:
sendln "AT&F&C1&D2E0V0X7"
wait 2
waitrsp 3
if ("0^M" isin response)
{
sendln "ATS0=0S7=60S9=6S10=50S35.1=1&W0"
waitrsp 3
if (response = "0^M")
return 0
}
}
dec $attempts
if ($attempts > 0)
goto init_retry
return 4
RESET:
baud 57600 ; set the baud rate
display " Baud Rate : 57600"
clearrsp ; clear out any ring signals
sendln "ATZ0" ; reset modem to default settings
waitrsp 3
if (response = "0^M")
return 0
else
return 4
CALL:
$ret = 8 ; set default ret code to "no answer"
clearrsp ; clear the response buffer
echo 0 ; do not display phone number
sendln "ATD" + dial_mode + phone_number ; execute the dial up
echo 1 ; turn echo back on
waitrsp 120 ; wait until the modem responds (max 2 minutes)
if ("38^M" isin response)
{
display ">>> CONNECT 33600 <<<"
$ret = 12
}
else if ("35^M" isin response)
{
display ">>> CONNECT 31200 <<<"
$ret = 12
}
else if ("39^M" isin response)
{
display ">>> CONNECT 28800 <<<"
$ret = 12
}
else if ("40^M" isin response)
{
display ">>> CONNECT 26400 <<<"
$ret = 12
}
else if ("41^M" isin response)
{
display ">>> CONNECT 24000 <<<"
$ret = 12
}
else if ("42^M" isin response)
{
display ">>> CONNECT 21600 <<<"
$ret = 12
}
else if ("14^M" isin response)
{
display ">>> CONNECT 19200 <<<"
$ret = 12
}
else if ("18^M" isin response)
{
display ">>> CONNECT 16800 <<<"
$ret = 12
}
else if ("17^M" isin response)
{
display ">>> CONNECT 14400 <<<"
$ret = 12
}
else if ("16^M" isin response)
{
display ">>> CONNECT 12000 <<<"
$ret = 12
}
else if ("12^M" isin response)
{
display ">>> CONNECT 9600 <<<"
$ret = 12
}
else if ("15^M" isin response)
{
display ">>> CONNECT 7200 <<<"
$ret = 15
}
else if ("11^M" isin response)
{
display ">>> CONNECT 4800 <<<"
$ret = 11
}
else if ("10^M" isin response)
{
display ">>> CONNECT 2400 <<<"
$ret = 10
}
else if ("7^M" isin response)
{
display ">>> BUSY <<<"
$ret = 7 ; busy
}
else if ("5^M" isin response)
{
display ">>> CONNECT 1200 <<<"
$ret = 5
}
else if ("3^M" isin response)
{
display ">>> NO CARRIER <<<"
$ret = 8 ; no answer or no connect
}
else if ("1^M" isin response)
{
display ">>> CONNECT <<<"
$ret = 1
}
return $ret ; return connect baud rate to application
ANSWER:
$ret = 8 ; set default ret code to "no answer"
waitrsp 1 ; see if phone is ringing
if ("2^M" isin response) ; 2 is numeric form of "RING"
{
if (listen = 1) ; see if Listen program is running or not
sendln "ATD" ; answer phone in originate mode (Listen)
else
sendln "ATA" ; answer the phone normally
waitrsp 120 ; wait for return code from modem (max 2 minutes)
if (response = "1^M")
{
display ">>> CONNECT <<<"
$ret = 1
}
else if (response = "3^M")
{
display ">>> NO CARRIER <<<"
$ret = 8 ; no answer or no connect
}
else if (response = "5^M")
{
display ">>> CONNECT 1200 <<<"
$ret = 5
}
else if (response = "10^M")
{
display ">>> CONNECT 2400 <<<"
$ret = 10
}
else if (response = "11^M")
{
display ">>> CONNECT 4800 <<<"
$ret = 11
}
else if (response = "15^M")
{
display ">>> CONNECT 7200 <<<"
$ret = 15
}
else if (response = "12^M")
{
display ">>> CONNECT 9600 <<<"
$ret = 12
}
else if (response = "16^M")
{
display ">>> CONNECT 12000 <<<"
$ret = 12
}
else if (response = "17^M")
{
display ">>> CONNECT 14400 <<<"
$ret = 12
}
else if (response = "18^M")
{
display ">>> CONNECT 16800 <<<"
$ret = 12
}
else if (response = "14^M")
{
display ">>> CONNECT 19200 <<<"
$ret = 12
}
else if (response = "42^M")
{
display ">>> CONNECT 21600 <<<"
$ret = 12
}
else if (response = "41^M")
{
display ">>> CONNECT 24000 <<<"
$ret = 12
}
else if (response = "40^M")
{
display ">>> CONNECT 26400 <<<"
$ret = 12
}
else if (response = "39^M")
{
display ">>> CONNECT 28800 <<<"
$ret = 12
}
else if (response = "35^M")
{
display ">>> CONNECT 31200 <<<"
$ret = 12
}
else if (response = "38^M")
{
display ">>> CONNECT 33600 <<<"
$ret = 12
}
if ($ret = 8) ; if there was no answer, make sure that
{ ; modem goes back on hook. There seems
dtr 0 ; to be a problem with these modems
wait 1 ; where the modem can sometimes refuse
dtr 1 ; to hang up if ATA fails to establish
} ; a connection.
}
return $ret ; return connect baud rate to application
DISCONNECT:
wait 2 ; wait 2 seconds
send "+++" ; send escape sequence to put modem back to
; command state
if (response !="0^M") ; if hang up failed, drop DTR to force hang up
{
DTR 0 ;drop DTR to reset modem
wait 2 ;some modems require a delay here
DTR 1 ;raise DTR
clearrsp ;clear response buffer
return 0
}
wait 2 ; wait 2 seconds
waitrsp 3 ; wait for response from modem
clearrsp ; clear the response buffer
sendln "ATH0" ; hang up the phone
waitrsp 3 ; wait for a response
if (response != "0^M") ; if hang up failed, drop DTR to force hang up
{
DTR 0 ; drop DTR to reset modem
wait 2 ; some modems require a delay here
DTR 1 ; raise DTR
clearrsp ; clear response buffer
}
return 0 ; always return OK