home *** CD-ROM | disk | FTP | other *** search
- ;**************************************************************************
- ; Network Courier Script File
- ;
- ; Filename: SMARTTA
- ; Date : 08/05/97
- ; Script : For NetComm SmartTA (IS5000)
- ;
- ; Note: MSMail only supports 57600 maximum DTE speed whereas the IS5000
- ; defaults to 115,200 default DTE speed.
- ;
- ; Before using this script please do the following:
- ;
- ; - Open a terminal session at 115200 DTE speed.
- ; - Reset the SmartTA with AT$ZZ
- ; - Type ATS114=57 to set 57600 DTE speed in the TA.
- ; - Set the DTE speed to 57600
- ; - Type AT&W
- ; - Load the SmartTA MsMail script and set 57600 in MSMail.
- ; (There is no AT&F or ATZ in the script so the TA will still be set to 57600)
- ;
- ;**************************************************************************
-
-
- INITIALIZE:
- title "NetComm SmartTA ISDN (IS5000)"
-
- baud 57600 ; set the baud rate
- display " Baud Rate : 57600"
- $attempts = 5
-
- init_retry:
- display "SmartTA is now being reset"
- sendln "AT" ; reset modem to default settings
- wait 8
- waitrsp 6
-
- if ("0" isin response)
- display "Successfully reset"
- goto reset_okay
-
- if ("OK" isin response)
- display "Successfully reset"
- {
- reset_okay:
- display "SmartTA is now being initialized"
- sendln "AT&D2E0V0X3&K3W2"
- wait 2
- waitrsp 3
-
- if ("0^M" isin response)
- display "Successfully initialized"
- {
- display "S Registers now being set"
- sendln "ATS0=0"
- waitrsp 3
- if (response = "0^M")
- display "S Registers set successfully"
- return 0
- }
- }
- dec $attempts
- if ($attempts > 0)
- goto init_retry
-
- return 4
-
-
- RESET:
- baud 57600 ; set the baud rate
- display " Baud Rate : 57600"
-
- display "SmartTA is now being reset"
- sendln "AT" ; reset modem to default settings
- wait 8
- waitrsp 1
- 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 (response = "1^M")
- {
- baud 57600
- display ">>> CONNECT <<<"
- $ret = 1
- }
- else if (response = "3^M")
- {
- display ">>> NO CARRIER <<<"
- $ret = 8 ; no answer or no connect
- }
- else if (response = "19^M")
- {
- baud 57600
- display ">>> CONNECT 64000 <<<"
- $ret = 19
- }
- else if (response = "7^M")
- {
- display ">>> BUSY <<<"
- $ret = 7 ; busy
- }
- else if (response = "31^M")
- {
- baud 57600
- display ">>> CONNECT 115200 <<<"
- $ret = 31
- }
-
-
- return $ret ; return connect baud rate to application
-
-
-
- ANSWER:
- $ret = 8 ; set default ret code to "no answer"
-
- waitrsp 8 ; see if phone is ringing
-
- if (response = "2^M") ; 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")
- {
- baud 57600
- display ">>> CONNECT <<<"
- wait 1
- $ret = 1
- }
- else if (response = "3^M")
- {
- display ">>> NO CARRIER <<<"
- wait 1
- $ret = 8 ; no answer or no connect
- }
- else if (response = "19^M")
- {
- baud 57600
- display ">>> CONNECT 64000 <<<"
- wait 1
- $ret = 19
- }
- else if (response = "31^M")
- {
- baud 57600
- display ">>> CONNECT 115200 <<<"
- wait 1
- $ret = 31
- }
- }
-
- 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
- wait 2 ; wait 2 seconds
-
- 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
-