home *** CD-ROM | disk | FTP | other *** search
/ Chip: Windows 95 / WIN95_CD.ISO / sharewar / internet / qmodem / scripts.z / HOST.QSC < prev    next >
Encoding:
Text File  |  1995-07-20  |  18.6 KB  |  740 lines

  1. '
  2. ' Host mode script for QmodemPro for Windows.
  3. '
  4. ' Version 1.11
  5. '
  6. ' Last updated September 21, 1994.
  7. '
  8.  
  9. '$include 'hostutil.qsc'
  10.  
  11. ' Constants
  12.  
  13. const BS  = chr(8)
  14. const LF  = chr(10)
  15. const CR  = chr(13)
  16. const ESC = chr(27)
  17.  
  18. const PrelogFileNamePart   = "host.pre"
  19. const MenuFileNamePart     = "host.mnu"
  20. const ProtocolFileNamePart = "host.pro"
  21. const LogoffFileNamePart   = "host.off"
  22. const HelpFileNamePart     = "host.hlp"
  23.  
  24. const UserFileNamePart      = "host.usr"
  25. const MsgHeaderFileNamePart = "host.hdr"
  26. const MsgDetailFileNamePart = "host.msg"
  27.  
  28. const MaxMsgLines = 99
  29.  
  30. ' Type declarations
  31.  
  32. dialog SetupDialog 18, 18, 214, 240
  33.   caption "QmodemPro Host Setup"
  34.   groupbox "Mode", 101, 18, 9, 74, 64
  35.   modeopen as radiobutton "Open", 102, 26, 23, 62, 12
  36.   modeclosed as radiobutton "Closed", 103, 26, 38, 62, 12
  37.   modecallback as radiobutton "Callback", 104, 26, 53, 62, 12
  38.   groupbox "Security", 150, 100, 9, 100, 64
  39.   maxtime as edittext 105, 151, 22, 42, 12
  40.   dospass as edittext 106, 151, 39, 42, 12
  41.   shutdownpass as edittext 107, 151, 56, 42, 12
  42.   rtext "Max time", -1, 108, 25, 41, 8
  43.   rtext "DOS pwd", -1, 108, 41, 41, 8
  44.   rtext "Shutdown pwd", -1, 108, 59, 41, 8
  45.   groupbox "File transfers", 160, 18, 80, 182, 85
  46.   dlpath as edittext 108, 22, 104, 169, 12
  47.   ulpath as edittext 109, 22, 130, 169, 12
  48.   ltext "Download path", -1, 24, 95, 62, 8
  49.   ltext "Upload path", -1, 24, 120, 69, 8
  50.   sysopanypath as checkbox "Sysop can download from any path", 110, 25, 148, 165, 12
  51.   groupbox "Modem", 170, 18, 175, 182, 30
  52.   modem as combobox 111, 25, 187, 165, 80
  53.   pushbutton "&Modem...", 200, 15, 215, 50, 14
  54.   defpushbutton "OK", IDOK, 81, 215, 50, 14
  55.   pushbutton "Cancel", IDCANCEL, 150, 215, 50, 14
  56. end dialog
  57.  
  58. dialog ModemSetupDialog 6, 15, 194, 179
  59.   caption "QmodemPro Host Modem Setup"
  60.   groupbox "", -1, 8, 9, 177, 139
  61.   init as edittext 101, 48, 17, 127, 12
  62.   answer as edittext 102, 48, 33, 47, 12
  63.   busy as edittext 103, 48, 49, 47, 12
  64.   ok as edittext 104, 48, 65, 47, 12
  65.   ring as edittext 105, 129, 33, 45, 12
  66.   ringcount as edittext 106, 148, 49, 27, 12
  67.   rtext "&Init", -1, 16, 19, 28, 8
  68.   rtext "&Answer", -1, 12, 34, 33, 8
  69.   rtext "&Busy", -1, 12, 50, 33, 8
  70.   rtext "&OK msg", -1, 13, 66, 32, 8
  71.   rtext "&Ring", -1, 105, 35, 20, 8
  72.   rtext "Ring &Count", -1, 106, 51, 38, 8
  73.   defpushbutton "OK", IDOK, 77, 156, 50, 14
  74.   pushbutton "Cancel", IDCANCEL, 137, 156, 50, 14
  75. end dialog
  76.  
  77. type TUser
  78.   Name as string*25
  79.   Password as string*20
  80.   Level as integer
  81.   Phone as string*30
  82. end type
  83.  
  84. type TMessageHeader
  85.   Sender as string*25
  86.   Receiver as string*25
  87.   Subject as string*75
  88.   DateTime as string*20
  89.   Private as integer
  90.   Received as integer
  91.   Killed as integer
  92.   Lines as integer
  93.   Detailpos as long
  94. end type
  95.  
  96. ' connection variables
  97. dim Local as integer
  98. dim Port as integer
  99. dim ModemResult as string
  100. dim BaudRate as long
  101. dim LogonTime as DateTime
  102. dim LogoffTime as DateTime
  103. dim ForceLogoff as integer
  104.  
  105. dim Setup as SetupDialog
  106. dim ModemSetup as ModemSetupDialog
  107. dim User as TUser
  108. dim MsgLines(MaxMsgLines) as string
  109.  
  110. dim PrelogFileName as string
  111. dim MenuFileName as string
  112. dim ProtocolFileName as string
  113. dim LogoffFileName as string
  114. dim HelpFileName as string
  115. dim UserFileName as string
  116. dim MsgHeaderFileName as string
  117. dim MsgDetailFileName as string
  118.  
  119. dim ReceivedFaxes as integer
  120.  
  121. '$include 'hostcfg.qsc'
  122.  
  123. declare sub PackMessages
  124.  
  125. ' Utility routines
  126.  
  127. function MinutesSince(dt as DateTime)
  128.   dim now as DateTime
  129.   GetCurrentDateTime(now)
  130.   dim days as integer, seconds as integer
  131.   DateTimeDiff(now, dt, days, seconds)
  132.   MinutesSince = (days * 86400 + seconds) / 60
  133. end function
  134.  
  135. function MinutesUntil(dt as DateTime)
  136.   dim now as DateTime
  137.   GetCurrentDateTime(now)
  138.   dim days as integer, seconds as integer
  139.   DateTimeDiff(now, dt, days, seconds)  
  140.   MinutesUntil = (days * 86400 + seconds) / 60
  141. end function
  142.  
  143. function TimeLeft as integer
  144.   TimeLeft = MinutesUntil(LogoffTime)
  145. end function
  146.  
  147. function CallerHungUp as integer
  148.   CallerHungUp = (not Local and not Carrier) or ForceLogoff
  149. end function
  150.  
  151. sub DoChat
  152.   dim s as string, c as string
  153.   send #Port,
  154.   send #Port, "You are now chatting with the sysop"
  155.   send #Port,
  156.   do
  157.     c = inkey
  158.     if c = "F2" then
  159.       exit do
  160.     end if
  161.     if c = "" and not Local then
  162.       c = inkey(Port)
  163.     end if
  164.     select case c
  165.       case BS
  166.         if len(s) > 0 then
  167.           s = left(s, len(s)-1)
  168.           send #Port, BS; " "; BS;
  169.         end if
  170.       case CR
  171.         send #Port,
  172.         s = ""
  173.       case is >= " "
  174.         if len(c) = 1 then
  175.           s = s + c
  176.           send #Port, c;
  177.           if len(s) >= 79 then
  178.             if instr(s, " ") then
  179.               dim i as integer
  180.               i = len(s)
  181.               while mid(s, i, 1) <> " "
  182.                 i = i - 1
  183.               wend
  184.               send #Port, string(len(s)-i, BS); string(len(s)-i, " ")
  185.               s = mid(s, i+1, len(s)-i)
  186.               send #Port, s;
  187.             else
  188.               send #Port,
  189.               s = ""
  190.             end if
  191.           end if
  192.         end if
  193.     end select
  194.   loop until CallerHungUp
  195.   send #Port,
  196.   send #Port,
  197.   send #Port, "Returning you to host mode"
  198.   send #Port,
  199. end sub
  200.  
  201. function YesNo(x as integer) as string
  202.   if x then
  203.     YesNo = "Yes"
  204.   else
  205.     YesNo = "No"
  206.   end if
  207. end function
  208.  
  209. declare function GetLine(prompt as string = "", maxlen as integer = 0, start as string = "", passchar as string = "") as string
  210. function GetLine(prompt as string, maxlen as integer, start as string, passchar as string) as string
  211.   dim s as string
  212.   dim starttime as DateTime
  213.   dim warned as integer
  214.   GetCurrentDateTime(starttime)
  215.   warned = false
  216.   s = start
  217.   send #Port, prompt; s;
  218.   do
  219.     dim c as string
  220.     c = inkey
  221.     if c = "" and not Local then
  222.       c = inkey(Port)
  223.     end if
  224.     select case c
  225.       case ""
  226.         dim idle as integer
  227.         idle = MinutesSince(starttime)
  228.         if idle >= 4 and not warned then
  229.           send #Port,
  230.           send #Port,
  231.           send #Port, "CAUTION!  You will be logged off if you do not continue in 60 seconds!"
  232.           send #Port,
  233.           send #Port, prompt; s;
  234.           warned = true
  235.         elseif idle >= 5 then
  236.           send #Port,
  237.           send #Port,
  238.           send #Port, "Logged off due to inactivity."
  239.           delay 1
  240.           hangup
  241.           ForceLogoff = True
  242.         end if
  243.       case "F2"
  244.         DoChat
  245.         GetCurrentDateTime(starttime)
  246.         send #Port, prompt; s;
  247.       case BS
  248.         if len(s) > 0 then
  249.           s = left(s, len(s)-1)
  250.           send #Port, BS;" ";BS;
  251.         end if
  252.       case CR
  253.         GetLine = s
  254.         send #Port,
  255.         exit function
  256.       case ESC
  257.         ' esc handling
  258.       case is >= " "
  259.         s = s + c
  260.         if len(passchar) > 0 then
  261.           send #Port, passchar;
  262.         else
  263.           send #Port, c;
  264.         end if
  265.         if maxlen > 0 and len(s) >= maxlen then
  266.           GetLine = s
  267.           exit function
  268.         end if
  269.     end select
  270.   loop until TimeLeft < 0 or CallerHungUp
  271.   GetLine = ""
  272. end function
  273.  
  274. function DisplayFile(fn as string) as integer
  275.   dim f as integer, count as integer
  276.   DisplayFile = TRUE
  277.   f = freefile
  278.   open fn for input as #f
  279.   count = 0
  280.   do while not eof(f)
  281.     dim s as string
  282.     input #f, s
  283.     send #Port, s
  284.     count = count + 1
  285.     if count >= 24 then
  286.       if OemUpper(GetLine("-Pause- [C]ontinue, [S]top? ", 1)) = "S" then
  287.         exit do
  288.       end if
  289.       send #Port,
  290.       count = 0
  291.     end if
  292.   loop
  293.   close #f
  294. catch err_fileopen
  295.   DisplayFile = FALSE
  296. end function
  297.  
  298. sub SendModemString(s as string)
  299.   dim i as integer, c as string
  300.   i = 1
  301.   while i <= len(s)
  302.     c = mid(s, i, 1)
  303.     if c = "^" and i+1 <= len(s) then
  304.       i = i + 1
  305.       c = mid(s, i, 1)
  306.       if c = "~" then
  307.         delay 0.5
  308.         goto nextchar
  309.       else
  310.         c = chr(asc(c) and 0x3f)
  311.       end if
  312.     end if
  313.     send c;
  314. nextchar:
  315.     i = i + 1
  316.   wend
  317. end sub
  318.  
  319. sub InitModem
  320.   hostecho off  
  321.   ClosePort
  322.   if Setup.modem < GetModemCount then
  323.     AutoAnswer(GetModemName(Setup.modem))
  324.   else
  325.     dim s as string
  326.     s = "COM"+chr(asc("1")+Setup.modem-GetModemCount)
  327.     if not OpenSerialPort(s) then
  328.       MsgBox("Warning: Could not open serial port "+s)
  329.       exit sub
  330.     end if
  331.     dim result as string
  332.     if carrier then exit sub
  333.     timeout 5
  334.   tryagain:
  335.     delay 1
  336.     SendModemString ModemSetup.init
  337.     do
  338.       receive result
  339.     loop until result = ModemSetup.ok
  340.   end if
  341. catch err_timeout
  342.   goto tryagain
  343. end sub
  344.  
  345. function ProcessKeyboard(byval k as string)
  346.   ProcessKeyboard = False
  347.   select case OemUpper(k)
  348.     case "F1"
  349.       if ModemSetup.busy <> "" then
  350.         SendModemString ModemSetup.busy
  351.         delay 1
  352.         flush input
  353.       end if
  354.       Local = True
  355.       Port = 0
  356.       ProcessKeyboard = True
  357.     case "F7"
  358.       PackMessages
  359.     case "F8"
  360.       SetupHost
  361.     case "F9"
  362.       print "Host mode terminated, returning to normal operation."
  363.       end
  364.   end select
  365. end function
  366.  
  367. function WaitForCall as integer
  368.   WaitForCall = False
  369.   hostecho off
  370.   if carrier then
  371.     Local = False
  372.     Port = comm
  373.     WaitForCall = True
  374.     exit function
  375.   end if
  376.   if Setup.modem < GetModemCount then
  377.     do
  378.       select case WaitForEvent
  379.         case 1
  380.           if ProcessKeyboard(inkey) then
  381.             WaitForCall = True
  382.             exit function
  383.           end if
  384.         case 2
  385.           BaudRate = 19200
  386.           Local = False
  387.           Port = comm
  388.           WaitForCall = True
  389.           exit function          
  390.       end select
  391.     loop
  392.   else
  393.     do
  394.       dim rings as integer
  395.       rings = 0
  396.       dim result as string
  397.       do
  398.         dim c as string
  399.         c = inkey(comm)
  400.         if c = "" then
  401.           c = inkey
  402.           if ProcessKeyboard(c) then
  403.             WaitForCall = True
  404.             exit function
  405.           end if
  406.         elseif c = LF then
  407.           result = ""
  408.         else
  409.           result = result + c
  410.           if len(result) > len(ModemSetup.ring) then
  411.             result = right(result, len(result)-1)
  412.           end if
  413.           if result = ModemSetup.ring then
  414.             rings = rings + 1
  415.           end if
  416.         end if
  417.       loop until rings >= val(ModemSetup.ringcount)
  418.       delay 0.2
  419.       SendModemString ModemSetup.answer
  420.       timeout 60
  421.       do
  422.         receive result
  423.         if left(result, 7) = "CONNECT" then
  424.           ModemResult = result
  425.           BaudRate = val(right(ModemResult, len(ModemResult)-8))
  426.           Local = False
  427.           Port = comm
  428.           WaitForCall = True
  429.           exit function
  430.         end if
  431.       loop until result = "NO CARRIER"
  432.     loop
  433.   end if
  434. catch err_timeout
  435.   WaitForCall = False
  436. end function
  437.  
  438. function NextField(s as string, delim as string) as string
  439.   dim i as integer
  440.   i = instr(s, delim)
  441.   if i > 0 then
  442.     NextField = left(s, i-1)
  443.     s = right(s, len(s)-i)
  444.   else
  445.     NextField = s
  446.     s = ""
  447.   end if
  448. end function
  449.  
  450. function LookupUser(byval uname as string, user as TUser) as integer
  451.   dim f as integer, s as string
  452.   LookupUser = False
  453.   f = freefile
  454.   open UserFileName for input as #f
  455.   do while not eof(f)
  456.     input #f, s
  457.     dim i as integer
  458.     i = instr(s, ";")
  459.     if i > 0 then
  460.       s = rtrim(left(s, i-1))
  461.     end if
  462.     if OemUpper(uname)+"," = left(s, len(uname)+1) then
  463.       user.Name = NextField(s, ",")
  464.       user.Password = NextField(s, ",")
  465.       user.Level = val(NextField(s, ","))
  466.       user.Phone = NextField(s, ",")
  467.       close #f
  468.       LookupUser = True
  469.       exit function
  470.     end if
  471.   loop
  472.   close #f
  473. catch err_fileopen
  474. end function
  475.  
  476. function GetPassword as integer
  477.   GetPassword = True
  478.   if User.Password = "" then
  479.     exit function
  480.   end if
  481.   GetPassword = False
  482.   dim password as string, tries as integer
  483.   do
  484.     password = GetLine("Password? ", 0, "", "*")
  485.     if CallerHungUp then
  486.       exit function
  487.     end if
  488.     if OemUpper(password) = OemUpper(User.Password) then
  489.       send #Port, "Password ok"
  490.       GetPassword = True
  491.       exit function
  492.     end if
  493.     tries = tries + 1
  494.     if tries > 3 then
  495.       send #Port,
  496.       send #Port, "Sorry, access denied"
  497.       send #Port,
  498.       exit function
  499.     else
  500.       send #Port,
  501.       send #Port, "Incorrect password entered"
  502.       send #Port,
  503.     end if
  504.   loop
  505.   GetPassword = True
  506. end function
  507.  
  508. function CallUserBack as integer
  509.   CallUserBack = False
  510.   if User.Phone = "" then
  511.     send #Port, "Your phone number is not on file."
  512.     send #Port, "(click)"
  513.     exit function
  514.   end if
  515.   send #Port, "Hanging up now, type ATA and press Enter after you get a ring."
  516.   delay 1
  517.   hostecho off
  518.   hangup
  519.   delay 10
  520.   if Setup.modem < GetModemCount then
  521.     dial manual User.Phone
  522.     if not carrier then
  523.       error err_timeout
  524.     end if
  525.   else
  526.     send "ATDT"; User.Phone
  527.     timeout 60
  528.     dim result as string
  529.     do
  530.       receive result
  531.       if left(result, 7) = "CONNECT" then
  532.         ModemResult = result
  533.         BaudRate = val(right(ModemResult, len(ModemResult)-8))
  534.         exit do
  535.       end if
  536.     loop
  537.     timeout off
  538.   end if
  539.   hostecho on
  540.   delay 1
  541.   send #Port, "Welcome "; User.Name
  542.   send #Port,
  543.   if GetPassword then
  544.     CallUserBack = True
  545.   end if
  546. catch err_timeout
  547.   send
  548. end function
  549.  
  550. function GetCallerInfo as integer
  551.   dim uname as string
  552.   do
  553.     uname = OemUpper(GetLine("Please enter your full name? "))
  554.     if CallerHungUp then
  555.       GetCallerInfo = False
  556.       exit function
  557.     end if
  558.     if LookupUser(uname, User) then
  559.       if not GetPassword then
  560.         GetCallerInfo = False
  561.         exit function
  562.       end if
  563.       if Setup.modecallback and not Local then
  564.         if not CallUserBack then
  565.           GetCallerInfo = False
  566.           exit function
  567.         end if
  568.       end if
  569.       GetCallerInfo = True
  570.       exit function
  571.     elseif Setup.modeopen then
  572.       User.Name = uname
  573.       send #Port,
  574.       send #Port, "Your name ";chr(34);uname;chr(34);" was not found in the user list."
  575.       if OemUpper(left(GetLine("Is it spelled correctly? "), 1)) = "Y" then
  576.         exit do
  577.       end if
  578.       send #Port,
  579.     else
  580.       send #Port,
  581.       send #Port, "Sorry, you are not registered with this system."
  582.       send #Port, "(click)"
  583.       send #Port,
  584.       GetCallerInfo = False
  585.       exit function
  586.     end if
  587.   loop
  588.   send #Port,
  589.   do
  590.     dim password as string
  591.     User.Password = GetLine("Please select a password? ", 0, "", "*")
  592.     password      = GetLine("Type your password again? ", 0, "", "*")
  593.     if OemUpper(password) = OemUpper(User.Password) then exit do
  594.     send #Port,
  595.     send #Port, "The passwords you typed did not match.  Try again."
  596.     send #Port,
  597.   loop
  598.   User.Level = 0
  599.   open UserFileName for append as #1
  600.   print #1, User.Name;",";User.Password;",";User.Level
  601.   close #1
  602.   send #Port, "Welcome new user!"
  603.   GetCallerInfo = True
  604. catch err_fileopen
  605.   send "Fatal error - could not open user database"
  606.   GetCallerInfo = False
  607. end function
  608.  
  609. '$include 'hostfile.qsc'
  610. '$include 'hostmsg.qsc'
  611. '$include 'hostdos.qsc'
  612.  
  613. sub HelpScreen
  614.   if DisplayFile(HelpFileName) then
  615.     do
  616.       dim s as string
  617.       send #Port,
  618.       send #Port, "Type the letter of the command you would like more help with,"
  619.       s = OemUpper(GetLine("or press Enter to return to the main menu: "))
  620.       if s = "" or CallerHungUp then exit do
  621.       send #Port,
  622.       if not DisplayFile(ConfigScriptPath+"\host" + left(s, 1) + ".hlp") then
  623.         send #Port, "Sorry, no help is available for that item."
  624.       end if
  625.     loop
  626.   else
  627.     send #Port, "Sorry, no help information is available."
  628.   end if
  629. end sub
  630.  
  631. ' Page sysop
  632.  
  633. sub PageSysop
  634.   send #Port, "Paging sysop..."
  635.   print "(Sysop: Press F2 to enter chat mode)"
  636.   play "RINGIN"
  637.   send #Port,
  638.   GetLine "Press Enter to continue? "
  639. end sub
  640.  
  641. sub Shutdown
  642.   if User.Level = 0 or Setup.shutdownpass = "" then
  643.     send #Port, "Sorry, shutdown option not available."
  644.     send #Port,
  645.     exit sub
  646.   end if
  647.   if OemUpper(GetLine("Enter shutdown password: ", 0, "", "*")) <> OemUpper(Setup.shutdownpass) then
  648.     send #Port,
  649.     send #Port, "Wrong password entered."
  650.     send #Port,
  651.     exit sub
  652.   end if
  653.   hangup
  654.   end
  655. end sub
  656.  
  657. do
  658.   PrelogFileName    = ConfigScriptPath+"\"+PrelogFileNamePart
  659.   MenuFileName      = ConfigScriptPath+"\"+MenuFileNamePart
  660.   ProtocolFileName  = ConfigScriptPath+"\"+ProtocolFileNamePart
  661.   LogoffFileName    = ConfigScriptPath+"\"+LogoffFileNamePart
  662.   HelpFileName      = ConfigScriptPath+"\"+HelpFileNamePart
  663.   UserFileName      = ConfigScriptPath+"\"+UserFileNamePart
  664.   MsgHeaderFileName = ConfigScriptPath+"\"+MsgHeaderFileNamePart
  665.   MsgDetailFileName = ConfigScriptPath+"\"+MsgDetailFileNamePart
  666.   LoadConfig
  667.   InitModem
  668.   ReceivedFaxes = 0
  669.   do
  670.     cls
  671.     print "QmodemPro for Windows Host Mode"
  672.     print
  673.     print "Press F1 to log on locally"
  674.     print "Press F7 to pack the messages"
  675.     print "Press F8 to set up the host mode"
  676.     print "Press F9 to quit the host mode"
  677.     if ReceivedFaxes > 0 then
  678.       print
  679.       print "New faxes: "; ReceivedFaxes
  680.     end if
  681.     print
  682.     print "Modem ready for calls..."
  683.   loop until WaitForCall
  684.   timeout off
  685.   ForceLogoff = False
  686.   print "Call connected at "; BaudRate; " baud"
  687.   hostecho on
  688.   delay 1
  689.   send #Port, "Welcome to the Qmodem for Windows host mode!"
  690.   send #Port,
  691.   send #Port, "Modem result: "; ModemResult
  692.   send #Port, "Connected at "; BaudRate; " bps. ";
  693.   send #Port,
  694.   send #Port,
  695.   DisplayFile PrelogFileName
  696.   GetCurrentDateTime(LogonTime)
  697.   call IncDateTime(LogonTime, LogoffTime, 0, val(Setup.MaxTime)*60)
  698.   if GetCallerInfo then
  699.     do
  700.       send #Port,
  701.       DisplayFile MenuFileName
  702.       dim cmd as string
  703.       cmd = GetLine("("+str(TimeLeft)+" min. left) Command? ")
  704.       send #Port,
  705.       select case OemUpper(cmd)
  706.         case "?"
  707.           HelpScreen
  708.         case "D"
  709.           DownloadFile
  710.         case "E"
  711.           EnterMessage
  712.         case "F"
  713.           ListFiles
  714.         case "G"
  715.           DisplayFile LogoffFileName
  716.           send #Port, "Thanks for calling!"
  717.           exit do
  718.         case "P"
  719.           PageSysop
  720.         case "R"
  721.           ReadMessages
  722.         case "S"
  723.           DosShell
  724.         case "U"
  725.           UploadFile
  726.         case "Z"
  727.           Shutdown
  728.         case else
  729.           send #Port, "Unknown command, try again"
  730.       end select
  731.     loop until TimeLeft < 0 or CallerHungUp
  732.   end if
  733.   hostecho off
  734.   if not Local then
  735.     delay 1
  736.     hangup
  737.     delay 1
  738.   end if
  739. loop
  740.