home *** CD-ROM | disk | FTP | other *** search
/ IBM Presents OS/2 Software Hits 1995 / OS-2_SW_HITS_2ND_EDITION_1995.ISO / i02 / imbte.sct < prev    next >
Text File  |  1994-08-31  |  11KB  |  469 lines

  1. {
  2.                         IBMPAD.SCT
  3.  This is a temporary script for the thinkpad modems. A new script will be provided
  4.  once the 19.2K issue is resolved.
  5.  
  6. }
  7.  
  8. {Account Variables}
  9. { 76211086 is pad number for France }
  10. { 76311043 is pad number for Germany }
  11. { 76611097 is pad number for Netherlands }
  12. { 77111458 is pad number for UK }
  13.  
  14. set cid "76211086";
  15. set uid "banylon";
  16. set pwd "banyan";
  17.  
  18.  
  19. {changeable pad parameters}
  20.  
  21. {change this value ------|  }
  22. set forward_timer "set 4:4\015";
  23.  
  24.  
  25. {Save the speed so we can use it later!}
  26.  
  27. if speed=1200: set config_speed "1200";
  28. if speed=2400: set config_speed "2400";
  29. if speed=4800: set config_speed "4800";
  30. if speed=9600: set config_speed "9600";
  31. if speed=19200: set config_speed "19200";
  32.  
  33.  
  34.  
  35. {
  36. Define escape key string, used throughout.
  37. }
  38. set ESCKEYSTR "\033\033";
  39.  
  40. set erecovery 0;
  41.  
  42.  
  43.  
  44. {
  45. Reset the modem.
  46. }
  47. prompt "Resetting the modem.\015\012";
  48. set dtr 0;
  49.  
  50. pause 1;
  51.  
  52. set dtr 1;
  53. set rts 1;
  54.  
  55.  
  56.  
  57. {
  58. Talk to the modem using set speed . Reset the modem then use the value set
  59. in setdial.
  60. }
  61.  
  62. set rbuf "";
  63.  
  64.  
  65. send "ATV1\015";
  66.  
  67.  
  68. waitfor max 2 seconds
  69.  
  70.     keystr=ESCKEYSTR: goto userescape;
  71.  
  72.     timeout:
  73.         prompt "No response from modem.\015\012";
  74.         prompt "Please confirm that COM port has been set to COM2.\015\012";
  75.         exit 1;
  76.  
  77.     response="OK":
  78.         break;
  79.  
  80. endwaitfor;
  81.  
  82.  
  83.  
  84. {
  85. Send the soft reset command and pull up config saved in profile 1.
  86. }
  87. send "ATZ1\015";
  88. pause 1;
  89.  
  90. prompt "Serial port speed is: ";
  91. prompt config_speed;
  92. prompt "\015\012";
  93.  
  94.  
  95. pause 1;
  96.  
  97.  
  98.  
  99. {   Set the modem so it will:                           }
  100. {                                                       }
  101. {                -not echo commands                     }
  102. {                -will return result codes              }
  103. {                -will return full word result codes    }
  104.  
  105. send "ATEQV1\015";
  106. pause 1;                     {wait 1 second}
  107. set rbuf "";                 {clear out the echo}
  108.  
  109.  
  110. {   Issue an interrogate command to the modem so we can try   }
  111. { and detect which type of modem it is.  Any modem which does }
  112. { not respond, or which sends back a result code we do  not   }
  113. { recognize, will be assumed to be Hayes 1200 compatible.  If }
  114. { a 9600 baud modem is detected, we must differentiate        }
  115. { between the telebit modems other 9600 baud modems.  The     }
  116. { Telebit modems have an internal register, number 52, that   }
  117. { the others do not.  If the modem returns an error result    }
  118. { code when we try to write the contents of this register, we }
  119. { assume it is not a Telebit modem.                           }
  120.  
  121. send "ATI\015";              {interrogate command}
  122.  
  123. waitfor max 5 seconds
  124.  
  125.     keystr=ESCKEYSTR: goto userescape;
  126.  
  127.  
  128.     response="14400":
  129.         prompt "\015\012";
  130.         prompt "IBM V.32bis modem detected.";
  131.         prompt "\015\012";
  132.         set mtype 4;
  133.         pause 1;
  134.         send "ATV1EW1\015";
  135.         pause 1;
  136.         send "AT&C1&D3L1\015";
  137.         pause 1;
  138.  
  139.  
  140.  
  141.         break;
  142.  
  143.     timeout:  prompt "\015\012";
  144.         prompt "Modem not found.\015\012";
  145.         prompt "Please confirm modem type.\015\012";
  146.         exit 1;
  147.  
  148. endwaitfor;
  149.  
  150.  
  151. {
  152. Tell the modem to wait longer for carrier
  153. }
  154. send "ATS7=210\015";
  155. pause 1;
  156.  
  157.  
  158.  
  159. {   Dial the phone using the current value of number.  }
  160. { Wait for a modem result code.  If a connect code is  }
  161. { received, set the baud rate to the proper value.  If }
  162. { the line is busy tell the user to try again later.   }
  163. { If a connection cannot be established, suggest       }
  164. { appropriate action.                                  }
  165.  
  166.  
  167. set rbuf "";
  168.  
  169. {
  170. Turn speaker on/off according to call_monitor variable.
  171. }
  172. if call_monitor: goto speakeron;
  173.  
  174. speakeroff:
  175.     send "ATM\015";
  176.     prompt "Call monitoring off";
  177.     prompt "\015\012";
  178.     goto sdone;
  179.  
  180. speakeron:
  181.     send "ATM1\015";
  182.     prompt "Call monitoring on\015\012";
  183.  
  184. sdone:
  185. pause 2;
  186.  
  187. {
  188. Send command to not wait for dial tone if blind dial set
  189. }
  190. if !blind_dial: goto nobd;
  191. send "ATX1\015";
  192. nobd:
  193.  
  194. send "AT\015";                                                                                                                                  {Telebit internal modem does not understand last command.}
  195. pause 2;
  196.  
  197.  
  198. {
  199. If number does not begin with touch tone or pulse code,
  200. default to touch tone.
  201. }
  202. {if number "T";}
  203.  
  204. {
  205. Clear response buffer.
  206. }
  207. set rbuf "";
  208.  
  209. send "ATDT,";                  {dial the phone}
  210. prompt "Dialing ";
  211. prompt number;
  212. prompt "\015\012";
  213. send number;
  214. send "\015";
  215. pause 1;
  216.  
  217. wait_for_connect:
  218.  
  219. waitfor max call_timeout seconds
  220.  
  221.     keystr=ESCKEYSTR: goto userescape;
  222.  
  223. {See what carrier speed has been negotiated}
  224.  
  225.     response="CARRIER 1200":
  226.         prompt "Carrier established at 1200\015\012";
  227.         goto wait_for_connect;
  228.         break;
  229.  
  230.     response="CARRIER 2400":
  231.         prompt "Carrier established at 2400\015\012";
  232.         goto wait_for_connect;
  233.         break;
  234.  
  235.     response="CARRIER 4800":
  236.         prompt "Carrier established at 4800\015\012";
  237.         goto wait_for_connect;
  238.         break;
  239.  
  240.     response="CARRIER 9600":
  241.         prompt "Carrier established at 9600\015\012";
  242.         goto wait_for_connect;
  243.         break;
  244.  
  245.  
  246.  
  247. {Now the modem will tell what protocol has been established}
  248.  
  249.     response="PROTOCOL: LAP-M":
  250.         set erecovery 1;
  251.         prompt "Connection established using LAP-M \015\012";
  252.         goto wait_for_connect;
  253.         break;
  254.  
  255.     response="PROTOCOL: NONE":
  256.         set erecovery 0;
  257.         prompt "NO error protocol has been established.\015\012";
  258.         goto wait_for_connect;
  259.         break;
  260.  
  261. {Now find out if compression has been negotiated}
  262.  
  263.     response="COMPRESSION: V.42BIS":
  264.         prompt "V.42BIS Compression has been negotiated.\015\012";
  265.         goto wait_for_connect;
  266.         break;
  267.  
  268.     response="COMPRESSION: NONE":
  269.         prompt "NO Compression has been negotiated.\015\012";
  270.         goto wait_for_connect;
  271.         break;
  272.  
  273. {Now see if it connects using the right serial speed}
  274.  
  275.  
  276.     response="CONNECT 2400":
  277.         prompt "\015\012";
  278.         prompt "Connection established at 2400 baud.";
  279.         prompt "\015\012";
  280.         break;
  281.  
  282.     response="CONNECT 4800":
  283.         prompt "\015\012";
  284.         prompt "Connection established at 4800 baud.";
  285.         prompt "\015\012";
  286.         break;
  287.  
  288.     response="CONNECT 9600":
  289.         prompt "\015\012";
  290.         prompt "Connection established at 9600 baud.";
  291.         prompt "\015\012";
  292.         break;
  293.  
  294.  
  295.     response="BUSY":
  296.         prompt "\015\012";
  297.         prompt "The line is busy.";
  298.         prompt "\015\012";
  299.         prompt "Please try again later.";
  300.         exit 20;
  301.         break;
  302.  
  303.     response="NO DIALTONE":
  304.         prompt "\015\012";
  305.         prompt "The modem has detected no dialtone";
  306.         prompt "\015\012"9
  307.         prompt "Please make sure that the modem is plugged into a phonejack\015\012";
  308.         exit 20;
  309.         break;
  310.  
  311.     timeout:
  312.         prompt "\015\012Connection could not be established.";
  313.         prompt "\015\012Check cabling and phone line.";
  314.         set dtr 0;                              {clean up on the way out}
  315.         pause 2;
  316.         send "ATZ\015";
  317.         exit 21;
  318.         break;
  319.  
  320. endwaitfor;
  321.  
  322. pause 1;
  323. set rbuf "";
  324. send "@";
  325. pause 1;
  326. send "H";
  327. pause 1;
  328. send "\015";
  329.  
  330. wait_for_pad:
  331.  
  332. waitfor max call_timeout seconds
  333.  
  334.     keystr=ESCKEYSTR: goto userescape;
  335.  
  336.     response="US Sprint":
  337.         prompt "\015\012";
  338.         prompt "Connection Established with US Sprint PAD";
  339.         prompt "\015\012";
  340.         break;
  341.  
  342.     response="TELENET":
  343.         prompt "\015\012";
  344.         prompt "Connection Established with Telenet PAD";
  345.         prompt "\015\012";
  346.         break;
  347.  
  348.     timeout:
  349.         prompt "\015\012Connection could not be established with PAD.";
  350.         prompt "\015\012Please check for proper number.";
  351.         set dtr 0;                              {clean up on the way out}
  352.         pause 2;
  353.         send "ATZ\015";
  354.         exit 21;
  355.         break;
  356.  
  357. endwaitfor;
  358.  
  359. {answer <cr> for terminal}
  360.  
  361. pause 1;
  362. send "\015";
  363.  
  364.  
  365. {set up the PAD parameters for proper operation}
  366.  
  367. prompt "\015\012Setting up PAD for call\015\012";
  368.  
  369. pause 1;
  370. send "set 1:0,3:0\015";   {disable escape and fowarding characters}
  371. pause 1;
  372. send "set 7:0,15:0,16:0\015";  {disable  break, editing, and del char }
  373. pause 1;
  374. send "set 17:0,18:0\015";    {disable editing chars}
  375. pause 1;
  376. send "set 0:0,57:1\015";     {enable virtual terminal no escape mode}
  377. pause 1;
  378. send "set 0:0,63:0\015";     {enable transparent mode}
  379. pause 1;
  380. send forward_timer;
  381. prompt "\015\012Calling Banyan X.25 server at CID ";
  382. prompt cid;
  383. prompt "\015\012";
  384. pause 1;
  385. set rbuf "";
  386. send "c ";
  387. send cid;
  388. send ",";
  389. send uid;
  390. send ",";
  391. send pwd;
  392. send "\015";
  393. prompt rbuf;
  394.  
  395. waitfor max call_timeout seconds
  396.  
  397.     keystr=ESCKEYSTR: goto userescape;
  398.  
  399.  
  400.     response="CONNECTED":
  401.         prompt "\015\012";
  402.         prompt "Connection Established with CID ";
  403.         prompt cid;
  404.         prompt "\015\012\015\012";
  405.         passport;
  406.         break;
  407.  
  408.     response="NOT OPERATING":
  409.         prompt "\015\012Connection CID ";
  410.         prompt cid;
  411.         prompt " is NOT OPERATING";
  412.         prompt "\015\012";
  413.         set dtr 0;                              {clean up on the way out}
  414.         pause 2;
  415.         send "ATZ\015";
  416.         exit 21;
  417.         break;
  418.  
  419.     response="NOT AVAILABLE":
  420.         prompt "\015\012Connection CID ";
  421.         prompt cid;
  422.         prompt " is NOT AVAILABLE";
  423.         prompt "\015\012";
  424.         set dtr 0;                              {clean up on the way out}
  425.         pause 2;
  426.         send "ATZ\015";
  427.         exit 21;
  428.         break;
  429.  
  430.     response="NOT RESPONDING":
  431.         prompt "\015\012Connection CID ";
  432.         prompt cid;
  433.         prompt " is NOT RESPONDING";
  434.         prompt "\015\012";
  435.         set dtr 0;                              {clean up on the way out}
  436.         pause 2;
  437.         send "ATZ\015";
  438.         exit 21;
  439.         break;
  440.  
  441.  
  442.     timeout:
  443.         prompt "\015\012Connection could not be established with CID (timeout)";
  444.         prompt cid;
  445.         prompt "\015\012";
  446.         set dtr 0;                              {clean up on the way out}
  447.         pause 2;
  448.         send "ATZ\015";
  449.         exit 21;
  450.         break;
  451.  
  452. endwaitfor;
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460. {
  461. User Escape
  462. }
  463.  
  464. userescape:
  465.     prompt "\015\012";
  466.     prompt "User Escape.";
  467.     prompt "\015\012";
  468.     exit 22;
  469.