home *** CD-ROM | disk | FTP | other *** search
/ NetComm Communications 5 / NetComm.iso / resource / support / scriptpa / netmodem.dat / AM56IN56.MDM < prev    next >
Encoding:
Text File  |  1997-05-13  |  14.6 KB  |  632 lines

  1. ;**************************************************************************
  2. ;       Microsoft Mail Script File
  3. ;
  4. ;       Filename: AM56IN56
  5. ;       Date    : 08/05/97
  6. ;       Script  : For NetComm Roadster56/InModem56
  7. ;
  8. ;     This script file contains the standard modem setup strings used by
  9. ;  the External, Transmit and Listen programs.  There are five procedures
  10. ;  defined in this script file for setting up the modem and for connecting
  11. ;  to a remote External machine.
  12. ;
  13. ;     The modem setup strings used here will be adequate for most people
  14. ;  but there may be some changes required if you are dialing overseas and
  15. ;  require a longer wait for Carrier Detect (S7 register) or if you wish
  16. ;  to change the speaker volume.  Note that if you used the -Innn option 
  17. ;  in version 1.0 or 2.0 that you will have to modify the S7 register and
  18. ;  recompile this script file.
  19. ;
  20. ;     Consult your modem manual for more information on setup options.
  21. ;
  22. ;  Script procedures defined:
  23. ;       INITIALIZE
  24. ;       RESET
  25. ;       CALL
  26. ;       ANSWER
  27. ;       DISCONNECT
  28. ;
  29. ;  Return codes for External, Transmit, Listen:
  30. ;       0  - OK
  31. ;       1  - CONNECT 300
  32. ;       3  - NO CARRIER
  33. ;       4  - ERROR
  34. ;       5  - CONNECT 1200
  35. ;       6  - NO DIAL TONE
  36. ;       7  - BUSY
  37. ;       8  - NO ANSWER
  38. ;      10  - CONNECT 2400
  39. ;      11  - CONNECT 4800
  40. ;      12  - CONNECT 9600  (high speed connection)
  41. ;      14  - CONNECT 19200 (Very high speed connection)
  42. ;
  43. ;**************************************************************************
  44.  
  45. INITIALIZE:
  46.  
  47.    title "NetComm Roadster56/InModem56"
  48.    baud 57600
  49.    display "Baud Rate set to 57600"
  50.    display " "
  51.    $attempts = 5
  52.  
  53. init_retry:
  54.    echo 0
  55.    sendln "ATV0"  ; single digit responses
  56.    wait 1
  57.    clearrsp
  58.    sendln "ATE0"  ; no local echo
  59.    wait 1
  60.    clearrsp
  61.    sendln "AT"    ; Are you alive
  62.    wait 2
  63.    waitrsp 2
  64.    echo 1
  65.    if ("0^M" isin response)
  66.       goto reset_okay
  67.    if ("OK^M" isin response)
  68.       {
  69.       reset_okay:
  70.          echo 0
  71.          sendln "AT&FB0E0V0"
  72.          wait 1
  73.          waitrsp 3
  74.          echo 1
  75.          sendln "AT&A1&B1&H1&K1&N0&R2&S1E0M1L0Q0V0X4"
  76.             
  77.             ; &A1 - Return ARQ result codes
  78.             ; &B1 - set fixed serial port rate
  79.             ; &H1 - use hardware CTS transmit flow control
  80.             ; &K1 - auto-enable data compression
  81.             ; &N0 - variable bps rate  -modem to modem speed
  82.             ; &R2 - activate RTS  -data is passed only when RTS is high
  83.             ; &S1 - activate DSR
  84.             ; E0  - local echo OFF
  85.             ; M1  - speaker on until carrier established
  86.             ; L0  - shhhhh
  87.             ; Q0  - result codes displayed
  88.             ; V0  - single digit responses 
  89.             ; X4  - set responses to most 
  90.          
  91.          waitrsp 4
  92.          if ("0^M" isin response)
  93.             {
  94.             echo 0
  95.             sendln "ATS0=0S10=5S11=50"
  96.                
  97.                 ; S0   - don't answer the phone
  98.                 ; S10  - half-second before hangup
  99.                 ; S11  - speed dial
  100.  
  101.             echo 1
  102.             waitrsp 3
  103.             if (response = "0^M")
  104.                return 0
  105.             }
  106.          }
  107.          dec $attempts
  108.          if ($attempts > 0)
  109.             goto init_retry
  110.          return 4
  111.  
  112. RESET:
  113.  
  114.    baud 38400
  115.    display "Resetting Roadster56/InModem56 "   
  116.    display "Answer Baud Rate: 57600"
  117.    clearrsp
  118.    echo 0
  119.    sendln "ATV0"
  120.    wait 1
  121.    sendln "ATE0"
  122.    wait 1
  123.    clearrsp 
  124.    sendln "AT"
  125.    waitrsp 3
  126.    sendln "ATE0V0"
  127.    echo 1
  128.    return 0
  129.  
  130. reset_modem:
  131.          sendln "AT&F"
  132.          wait 1
  133.          waitrsp 3
  134.          sendln "AT&A1&B1&H1&K1&N0&R2&S1E0M1L0Q0V0X4"
  135.             ; &A1 - Return ARQ result codes
  136.             ; &B1 - set fixed serial port rate
  137.             ; &H1 - use hardware CTS
  138.             ; &K1 - auto-enable data compression
  139.             ; &N0 - variable bps rate
  140.             ; &R2 - activate RTS
  141.             ; &S1 - activate DSR
  142.             ; E0  - local echo OFF
  143.             ; M1  - speaker on until carrier established
  144.             ; L0  - shhhhh
  145.             ; Q0  - result codes displayed
  146.             ; V0  - single digit responses
  147.             ; X4  - set responses to most verbose
  148.          
  149.          waitrsp 4
  150.          if ("0^M" isin response)
  151.             {
  152.             sendln "ATS0=0S10=5S11=50"
  153.                 ; S0   - don't answer the phone
  154.                 ; S10  - half-second before hangup after loss of carrier
  155.                 ; S11  - speed dial
  156.             waitrsp 3
  157.             if (response = "0^M")
  158.                return 0
  159.             }
  160.          
  161.          return 4
  162.  
  163. CALL:
  164.  
  165.    $ret = 8
  166.    waitrsp 2
  167.    if (response = "2^M") {
  168.       display "Incoming Call Detected"
  169.       return $ret
  170.    }
  171.    clearrsp
  172.    baud 38400
  173.    display "Dialing..."
  174.    echo 0
  175.    sendln "ATD" + dial_mode + phone_number
  176.    echo 1
  177.    waitrsp 90
  178.    if (response = "1^M")
  179.       {
  180.       display ">>> CONNECT 300 <<<"
  181.       $ret = 1
  182.       }
  183.    else if (response = "3^M")
  184.       {
  185.       display ">>> NO CARRIER <<<"
  186.       }
  187.    else if(response = "4^M")
  188.       {
  189.       display ">>> ERROR <<<"
  190.       }
  191.    else if (response = "5^M")
  192.       {
  193.       display ">>> CONNECT 1200 <<<"
  194.       $ret = 5
  195.       }
  196.    else if (response = "6^M")
  197.       {
  198.       display ">>> NO DIALTONE <<<"
  199.       }
  200.    else if (response = "7^M")
  201.       {
  202.       display ">>> BUSY <<<"
  203.       $ret = 7
  204.       }
  205.    else if(response = "8^M")
  206.       {
  207.       display ">>> NO ANSWER <<<"
  208.       }
  209.    else if (response = "10^M")
  210.       {
  211.       display ">>> CONNECT 2400 <<<"
  212.       $ret = 10
  213.       }
  214.    else if (response = "13^M")
  215.       {
  216.       display ">>> CONNECT 9600 <<<"
  217.       $ret = 12
  218.       }
  219.    else if (response = "14^M")
  220.       {
  221.       display ">>> CONNECT unknown/ARQ <<<"
  222.       $ret = 12
  223.       }
  224.    else if (response = "15^M")
  225.       {
  226.       display ">>> CONNECT 1200/ARQ <<<"
  227.       $ret = 12
  228.       }
  229.    else if (response = "16^M")
  230.       {
  231.       display ">>> CONNECT 2400/ARQ <<<"
  232.       $ret = 12
  233.       }
  234.    else if (response = "17^M")
  235.       {
  236.       display ">>> CONNECT 9600/ARQ <<<"
  237.       $ret = 12
  238.       }
  239.    else if (response = "18^M")
  240.       {
  241.       display ">>> CONNECT 4800 <<<"
  242.       $ret = 12
  243.       }
  244.    else if (response = "19^M")
  245.       {
  246.       display ">>> CONNECT 4800/ARQ <<<"
  247.       $ret = 12
  248.       }
  249.    else if(response = "20^M")
  250.       {
  251.       display ">>> CONNECT 7200 <<<"
  252.       $ret = 12
  253.       }
  254.    else if(response = "21^M")
  255.       {
  256.       display ">>> CONNECT 12000 <<<"
  257.       $ret = 12
  258.       }
  259.    else if (response = "22^M")
  260.       {
  261.       display ">>> CONNECT 12000/ARQ <<<"
  262.       $ret = 12
  263.       }
  264.    else if (response = "24^M")
  265.       {
  266.       display ">>> CONNECT 7200/ARQ <<<"
  267.       $ret = 12
  268.       }
  269.    else if(response = "25^M")
  270.       {
  271.       display ">>> CONNECT 14400 <<<"
  272.       $ret = 12
  273.       }
  274.    else if (response = "26^M")
  275.       {
  276.       display ">>> CONNECT 14400/ARQ <<<"
  277.       $ret = 12
  278.       }
  279.    else if (response = "47^M")
  280.       {
  281.       display ">>> CONNECT 16800 <<<"
  282.       $ret = 12
  283.       }
  284.    else if (response = "57^M")
  285.       {
  286.       display ">>> CONNECT 16800/ARQ <<<"
  287.       $ret = 12
  288.       }
  289.    else if (response = "85^M")
  290.       {
  291.       display ">>> CONNECT 19200 <<<"
  292.       $ret = 14
  293.       }
  294.    else if (response = "88^M")
  295.       {
  296.       display ">>> CONNECT 19200/ARQ <<<"
  297.       $ret = 14
  298.       }
  299.    else if (response = "91^M")
  300.       {
  301.       display ">>> CONNECT 21600 <<<"
  302.       $ret = 14
  303.       }
  304.    else if (response = "94^M")
  305.       {
  306.       display ">>> CONNECT 21600/ARQ <<<"
  307.       $ret = 14
  308.       }
  309.    else if (response = "99^M")
  310.       {
  311.       display ">>> CONNECT 24000 <<<"
  312.       $ret = 14
  313.       }
  314.    else if (response = "100^M")
  315.       {
  316.       display ">>> CONNECT 24000/ARQ <<<"
  317.       $ret = 14
  318.       }
  319.    else if (response = "103^M")
  320.       {
  321.       display ">>> CONNECT 26400 <<<"
  322.       $ret = 14
  323.       }
  324.    else if (response = "104^M")
  325.       {
  326.       display ">>> CONNECT 26400/ARQ <<<"
  327.       $ret = 14
  328.       }
  329.    else if (response = "107^M")
  330.       {
  331.       display ">>> CONNECT 28800 <<<"
  332.       $ret = 14
  333.       }
  334.    else if (response = "108^M")
  335.       {
  336.       display ">>> CONNECT 28800/ARQ <<<"
  337.       $ret = 14
  338.       }
  339.    else if (response = "151^M")
  340.       {
  341.       display ">>> CONNECT 31200 <<<"
  342.       $ret = 14
  343.       }
  344.    else if (response = "152^M")
  345.       {
  346.       display ">>> CONNECT 31200/ARQ <<<"
  347.       $ret = 14
  348.       }
  349.    else if (response = "155^M")
  350.       {
  351.       display ">>> CONNECT 33600 <<<"
  352.       $ret = 14
  353.       }
  354.    else if (response = "156^M")
  355.       {
  356.       display ">>> CONNECT 33600/ARQ <<<"
  357.       $ret = 14
  358.       }
  359.    else if (response = "168^M")
  360.       {
  361.       display ">>> CONNECT 56000/V120 <<<"
  362.       $ret = 14
  363.       }
  364.    else if (response = "169^M")
  365.       {
  366.       display ">>> CONNECT 64000/V120 <<<"
  367.       $ret = 14
  368.       }
  369.    else if (response = "162^M")
  370.       {
  371.       display ">>> CONNECT 56000 <<<"
  372.       $ret = 14
  373.       }
  374.    else if (response = "165^M")
  375.       {
  376.       display ">>> CONNECT 64000 <<<"
  377.       $ret = 14
  378.       }
  379.   else
  380.       {
  381.       display ">>> CONNECT FAILED <<<"
  382.       }
  383.    return $ret
  384.         
  385. ANSWER:
  386.  
  387.    $ret = 8
  388.    waitrsp 1
  389.    baud 38400
  390.    if (response = "2^M")
  391.       {
  392.  
  393.  
  394.       echo 0
  395.       if (listen = 1)
  396.          sendln "ATD"
  397.       else
  398.          sendln "ATA"
  399.       echo 1
  400.       waitrsp 90
  401.       if (response = "1^M")
  402.          {
  403.          display ">>> CONNECT 300 <<<"
  404.          $ret = 1
  405.          }
  406.       else if (response = "3^M")
  407.          {
  408.          display ">>> NO CARRIER <<<"
  409.          }
  410.       else if(response = "4^M")
  411.          {
  412.          display ">>> ERROR <<<"
  413.          }
  414.       else if (response = "5^M")
  415.          {
  416.          display ">>> CONNECT 1200 <<<"
  417.          $ret = 5
  418.          }
  419.       else if (response = "6^M")
  420.          {
  421.          display ">>> NO DIALTONE <<<"
  422.          }
  423.       else if (response = "7^M")
  424.          {
  425.          display ">>> BUSY <<<"
  426.          $ret = 7
  427.          }
  428.       else if(response = "8^M")
  429.          {
  430.          display ">>> NO ANSWER <<<"
  431.          }
  432.       else if (response = "10^M")
  433.          {
  434.          display ">>> CONNECT 2400 <<<"
  435.          $ret = 10
  436.          }
  437.       else if (response = "13^M")
  438.          {
  439.          display ">>> CONNECT 9600 <<<"
  440.          $ret = 12
  441.          }
  442.       else if (response = "14^M")
  443.          {
  444.          display ">>> CONNECT unknown/ARQ <<<"
  445.          $ret = 12
  446.          }
  447.       else if (response = "15^M")
  448.          {
  449.          display ">>> CONNECT 1200/ARQ <<<"
  450.          $ret = 12
  451.          }
  452.       else if (response = "16^M")
  453.          {
  454.          display ">>> CONNECT 2400/ARQ <<<"
  455.          $ret = 12
  456.          }
  457.       else if (response = "17^M")
  458.          {
  459.          display ">>> CONNECT 9600/ARQ <<<"
  460.          $ret = 12
  461.          }
  462.       else if (response = "18^M")
  463.          {
  464.          display ">>> CONNECT 4800 <<<"
  465.          $ret = 12
  466.          }
  467.       else if (response = "19^M")
  468.          {
  469.          display ">>> CONNECT 4800/ARQ <<<"
  470.          $ret = 12
  471.          }
  472.       else if(response = "20^M")
  473.          {
  474.          display ">>> CONNECT 7200 <<<"
  475.          $ret = 12
  476.          }
  477.       else if(response = "21^M")
  478.          {
  479.          display ">>> CONNECT 12000 <<<"
  480.          $ret = 12
  481.          }
  482.       else if (response = "22^M")
  483.          {
  484.          display ">>> CONNECT 12000/ARQ <<<"
  485.          $ret = 12
  486.          }
  487.       else if (response = "24^M")
  488.          {
  489.          display ">>> CONNECT 7200/ARQ <<<"
  490.          $ret = 12
  491.          }
  492.       else if(response = "25^M")
  493.          {
  494.          display ">>> CONNECT 14400  <<<"
  495.          $ret = 12
  496.          }
  497.       else if (response = "26^M")
  498.          {
  499.          display ">>> CONNECT 14400/ARQ <<<"
  500.          $ret = 12
  501.          }
  502.       else if (response = "47^M")
  503.          {
  504.          display ">>> CONNECT 16800 <<<"
  505.          $ret = 12
  506.          }
  507.       else if (response = "57^M")
  508.          {
  509.          display ">>> CONNECT 16800/ARQ <<<"
  510.          $ret = 12
  511.          }
  512.       else if (response = "85^M")
  513.          {
  514.          display ">>> CONNECT 19200 <<<"
  515.          $ret = 14
  516.          }
  517.       else if (response = "88^M")
  518.          {
  519.          display ">>> CONNECT 19200/ARQ <<<"
  520.          $ret = 14
  521.          }
  522.       else if (response = "91^M")
  523.          {
  524.          display ">>> CONNECT 21600 <<<"
  525.          $ret = 14
  526.          }
  527.       else if (response = "94^M")
  528.          {
  529.          display ">>> CONNECT 21600/ARQ <<<"
  530.          $ret = 14
  531.          }
  532.       else if (response = "99^M")
  533.          {
  534.          display ">>> CONNECT 24000 <<<"
  535.          $ret = 14
  536.          }
  537.       else if (response = "100^M")
  538.          {
  539.          display ">>> CONNECT 24000/ARQ <<<"
  540.          $ret = 14
  541.          }
  542.       else if (response = "103^M")
  543.          {
  544.          display ">>> CONNECT 26400 <<<"
  545.          $ret = 14
  546.          }
  547.       else if (response = "104^M")
  548.          {
  549.          display ">>> CONNECT 26400/ARQ <<<"
  550.          $ret = 14
  551.          }
  552.       else if (response = "107^M")
  553.          {
  554.          display ">>> CONNECT 28800 <<<"
  555.          $ret = 14
  556.          }
  557.       else if (response = "108^M")
  558.          {
  559.          display ">>> CONNECT 28800/ARQ <<<"
  560.          $ret = 14
  561.          }
  562.       else if (response = "151^M")
  563.          {
  564.         display ">>> CONNECT 31200 <<<"
  565.         $ret = 14
  566.         }
  567.       else if (response = "152^M")
  568.         {
  569.         display ">>> CONNECT 31200/ARQ <<<"
  570.         $ret = 14
  571.         }
  572.       else if (response = "155^M")
  573.         {
  574.         display ">>> CONNECT 33600 <<<"
  575.         $ret = 14
  576.         }
  577.       else if (response = "156^M")
  578.         {
  579.         display ">>> CONNECT 33600/ARQ <<<"
  580.         $ret = 14
  581.         }
  582.       else if (response = "168^M")
  583.         {
  584.         display ">>> CONNECT 56000/V120 <<<"
  585.         $ret = 14
  586.         }
  587.       else if (response = "169^M")
  588.         {
  589.         display ">>> CONNECT 64000/V120 <<<"
  590.         $ret = 14
  591.         }
  592.       else if (response = "162^M")
  593.         {
  594.         display ">>> CONNECT 56000 <<<"
  595.         $ret = 14
  596.         }
  597.       else if (response = "165^M")
  598.         {
  599.         display ">>> CONNECT 64000 <<<"
  600.         $ret = 14
  601.         }
  602.       else
  603.         {
  604.         display ">>> CONNECT FAILED <<<"
  605.         }
  606.         }
  607.         return $ret
  608.  
  609. DISCONNECT:
  610.  
  611.    display "Disconnecting..."
  612.    echo 0
  613.    wait 5
  614.    send "+++"
  615.    wait 5
  616.    clearrsp
  617.    sendln "ATH0"
  618.    waitrsp 5
  619.    DTR 0
  620.    wait 3
  621.    DTR 1
  622.    echo 1
  623.    if (response != "0^M")
  624.       {
  625.       DTR 0
  626.       wait 2
  627.       DTR 1
  628.       clearrsp
  629.       }
  630.    return 0
  631.  
  632.