;AutoUpload.WAS     v1.0  

;*****************************************************************************
;*                                                                           *
;* AutoUpload.WAS                                                            *
;* Copyright (C) 1998 Symantec                                               *
;* All rights reserved.                                                      *
;*                                                                           *
;* Written by:  Symantec ASPECT Assist                                       *
;* 08/27/98                                                                  *
;*                                                                           *                                                                             
;* This script file automates logging into a host system and uploading a     *
;* specified file.  Depending on the transfer protocol used, multiple files  *
;* can be uploaded during a session. Just specify the directory where the    *
;* files are located.                                                        *
;*                                                                           *
;* This ASPECT script is intended only as a sample of ASPECT programming.    *
;* Symantec makes no warranty of any kind, express or implied, including     *
;* without limitation, any warranties of merchantability and/or fitness      *
;* for a particular purpose.  Use of this program is at your own risk.       *
;*                                                                           *
;* Technical Support is not provided on this script.                         *                                                                          *
;*****************************************************************************


;*****************************************************************************
;*   GLOBAL VARIABLES                                                        *
;*****************************************************************************
string PNumber = "8,19999999999"           ; Phone number to dial including PBX
string FName = "C:\working\test.dat"       ; File name and path to uplaod


;*****************************************************************************
;*   MAIN                                                                    *
;*****************************************************************************
proc main
   
   set port baudrate 19200                    ; Line settings
   set port parity NONE
   set port databits 8
   set port stopbits 1
   set duplex HALF
   set dial retries 5
  
   dialnumber DATA PNumber                    ; Dial the phone number
   while $DIALING                             ; Yield while dialing
   endwhile
   if success                                 ; If dialing success
      if $CARRIER
         waitfor "You have One Minute to Initiate the Transfer"
         pause 1
         sendfile XMODEM FName                ; Upload the file.
         while $XFERSTATUS
            yield                             ; Yield while transfer is going
         endwhile
      else
         usermsg "Error connecting to Host.  File not uploaded."
      endif
   else
      hangup
      pause 5
      usermsg "Error connecting to Host. Problems dialing."
   endif
   hangup                                     ; Disconnect
   pause 6
   pwexit                                     ; Exit the script and Procomm
endproc