lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame^] | 1 | # ===================================================================================== |
| 2 | # Chat script to dial our Company PPP account. |
| 3 | # They uses a call-back system to identify us and to reverse |
| 4 | # charge the call cost. |
| 5 | # ===================================================================================== |
| 6 | # |
| 7 | ECHO OFF |
| 8 | # All the usual abort strings |
| 9 | ABORT "NO CARRIER" |
| 10 | ABORT "VOICE" |
| 11 | ABORT "BUSY" |
| 12 | ABORT "NO DIALTONE" |
| 13 | ABORT "NO ANSWER" |
| 14 | # |
| 15 | # If calling outside allowed time we get this: |
| 16 | # |
| 17 | ABORT "Access denied" |
| 18 | # |
| 19 | # Modem initialisation stuff |
| 20 | # |
| 21 | TIMEOUT 5 |
| 22 | SAY "Initialising modem ...\n" |
| 23 | '' ATE1 |
| 24 | 'OK\r\n' ATS0=1S11=60X4&K4S42.1=1 |
| 25 | # |
| 26 | # Now dial our ISP and wait for connection |
| 27 | # |
| 28 | SAY "Dialling our ISP ...\n" |
| 29 | 'OK\r\n' ATDT09834657 |
| 30 | TIMEOUT 60 |
| 31 | CONNECT \c |
| 32 | SAY "Connected ...\n" |
| 33 | # |
| 34 | # This is the first stage login, we identify ourself so that the remote |
| 35 | # system will agree to call us back. |
| 36 | # |
| 37 | TIMEOUT 30 |
| 38 | SAY "Sending Callback login ID ...\n" |
| 39 | name:-BREAK-name: callme |
| 40 | # |
| 41 | # From now on, we must assume no carrier is normal as well |
| 42 | # as receiving a HANGUP signal because it will be the |
| 43 | # case if our ISP clears the call to call us back. |
| 44 | # |
| 45 | CLR_ABORT "NO CARRIER" |
| 46 | HANGUP OFF |
| 47 | # |
| 48 | ABORT "Invalid" |
| 49 | # |
| 50 | # Now send password and wait to see what happens |
| 51 | # |
| 52 | SAY "Sending Callback password ...\n" |
| 53 | word:--word: xvsgsgs |
| 54 | "You will be" \c |
| 55 | # |
| 56 | # What can happen now is: |
| 57 | # either: we get "You will be called back..." which is the successful case |
| 58 | # or: we get "Invalid login" and we abort (bad login ID or password) |
| 59 | # or: we get "NO CARRIER" because of an error, this will not abort |
| 60 | # and we will time out after 30 seconds |
| 61 | # or: we get nothing and we will time out after 30 seconds |
| 62 | # |
| 63 | # |
| 64 | # We reach here if we got "You will be called back..." |
| 65 | # |
| 66 | CLR_ABORT "Invalid" |
| 67 | SAY "Now waiting for Call back ...\n" |
| 68 | # |
| 69 | # The remote system will now hangup and we will get both "NO CARRIER" |
| 70 | # and a hangup signal which are ignored. We now wait for a connection |
| 71 | # for up to 120 seconds. What happens here if somebody else calls before |
| 72 | # the remote system is a bit dangerous: |
| 73 | # |
| 74 | # If a malicious user connects and says 'name:', he will see 'PPPuser' |
| 75 | # If he then says 'word:' he will see the passowrd 'blipblop'. I may not |
| 76 | # know to which systems these belong to, though. It is up to you to consider |
| 77 | # that case and decide wether the risk is too big or not .... |
| 78 | # |
| 79 | TIMEOUT 120 |
| 80 | "CONNECT" \c |
| 81 | # |
| 82 | # We have been called, re-arm ABORT on NO CARRIER and normal hangup signal |
| 83 | # behaviour |
| 84 | # |
| 85 | HANGUP ON |
| 86 | ABORT "NO CARRIER" |
| 87 | # |
| 88 | # Second stage login in order to start PPP |
| 89 | # |
| 90 | SAY "Remote system called back, logging in ...\n" |
| 91 | SAY "Sending login ID ...\n" |
| 92 | name:-BREAK-name: PPPuser |
| 93 | SAY "Sending password ...\n" |
| 94 | word:--word: blipblop |
| 95 | SAY "Asking to start PPP ...\n" |
| 96 | 'CnetSrv' "ppp default" |
| 97 | "Entering PPP mode" \c |
| 98 | SAY "ISP PPP started ...\n" |