home *** CD-ROM | disk | FTP | other *** search
- !
- ! Copyright (c) 1995
- ! by CompuServe Incorporated, Columbus, Ohio
- !
- ! The information in this software is subject to change without
- ! notice and should not be construed as a commitment by CompuServe.
- !
- ! CSERVE:
- ! Connect to CIS.
- ! First argument is %TRUE if direct connect and %FALSE otherwise
- ! Success: returns %Success
- ! Failure: saves error msg in %FailureMsg and returns %Failure
- ! or %Fatal (depending on severity).
- !
- !+V
- ! "3.8"
- !-V
-
- DirectConnect = Arg1;
- Internet = 25;
- ifndef %HostName = "CPS";
- Plus = "+";
- Wait_Time = 80;
- ifndef %Scanned = "";
- Msg = "Verbindungsaufbau mit dem CompuServe-Netzwerk";
- if %Network <> Internet goto NotInternet;
- Msg = "Anmelden bei CompuServe . ";
- define %HostName = "CISAGREE";
- Wait_Time = 30;
-
- NotInternet:
- show Msg;
- Tries = 7;
- SecureTries = 3;
- FirstTry = %TRUE;
- FailStr = "";
- Sent_Host_Name = %FALSE;
- ifndef %X121Address = "";
- ifndef %OKCmd = "";
- ifndef %StopAtHost = "";
- ifndef %AccountID = "";
- ifndef %BreakChar = "#";
- ifndef %MicroChallenge = "";
- ifndef %App = "";
- on cancel goto Return_Cancel;
-
- Start_Connect:
- if Tries = 0 goto CIS_Error;
- Tries = Tries - 1;
-
- Connect_Wait:
- wait
- "UIC:" goto Send_ETX,
- "Host Name:" goto Send_Host_Name,
- "User ID:" goto Send_ID,
- "Password:" goto Send_Password,
- "XPAD:" goto Send_XPAD,
- "ITI:" goto Send_XPAD,
- "? LOG" goto Process_Log_Msg,
- "??LOG" goto Process_Log_Msg,
- "% IPN" goto Process_IPX_Msg,
- "? IPX" goto Process_IPX_Msg,
- "? ICD" goto Process_Net_Msg,
- "??ICD" goto Process_Net_Msg,
- "RA:" goto Handle_Secure_Login,
- "0, OFF):" goto Send_Baud_Rate,
- %mdm_Failure goto CIS_No_Carrier
- until Wait_Time;
-
- if %Network <> Internet goto Send_Break;
- Wait_Time = 200;
- if not Sent_Host_Name goto Send_CR;
- goto Start_Connect;
-
- Send_Break:
- if not DirectConnect goto Send_CR;
- sendm %BreakChar;
- sendm %BreakChar;
- sendm %BreakChar;
-
- Send_CR:
- send %CR;
- goto Start_Connect;
-
- Send_Baud_Rate:
- send %BaudRate;
- send "^M";
- goto Connect_Wait;
-
- Send_ETX:
- send "^C";
- goto Connect_Wait;
-
- Send_Host_Name:
- if Arg2 goto No_Wait;
- wait until 10;
- No_Wait:
- if Sent_Host_Name goto Reset_Host_Name;
- Sent_Host_Name = %TRUE;
-
- Wait_Time = 200;
- if %StopAtHost = "1" goto Return_Success;
- send %HostName & "^M";
- if %StopAtHost = "" goto Connect_Wait;
- goto Return_Success;
-
- !
- ! Only send Host Name response on 1st, 3rd, & 5th attempts
- ! to guard against unintended double host name prompts resulting
- ! from sending "^M". On even attempts, eat the Host Name: prompt.
- !
- Reset_Host_Name:
- Sent_Host_Name = %FALSE;
- Tries = Tries - 1;
- goto Connect_Wait;
-
- Send_ID:
- if %StopAtHost = "1" goto GetHost;
- define %ErrorCode = 0;
- if %App = "CID" goto No_Msg1;
- show "Anmelden bei CompuServe . . ";
- No_Msg1:
- if %MicroChallenge = "" goto No_Secure_Login;
-
- send Plus & %UserID & %LogonParams & "/INT:60 /secure:1^M";
- Plus = "";
- goto Connect_Wait;
-
- No_Secure_Login:
- send %UserID & %LogonParams & "/INT:60^M";
- goto Connect_Wait;
-
- GetHost:
- send "/HOST^M";
- exit %Success;
-
- Send_Password:
- send %Password & %CR;
- goto Logon_Wait;
-
- Send_XPAD:
- if %X121Address = "" goto Missing_XPAD;
- send %X121Address & %CR;
- goto Connect_Wait;
-
- Missing_XPAD:
- define %FailureMsg = "X.121 Adresse fehlt";
- define %ErrorCode = 21;
- exit %Fatal;
-
- Logon_Wait:
- wait
- "Account ID:" goto Send_AccountID,
- "CompuServe" goto Return_Success,
- "^[[>" goto Return_Success,
- "^F" goto Return_Success,
- "? LOG" goto Process_Log_Msg,
- "??LOG" goto Process_Log_Msg,
- "? IPX" goto Process_IPX_Msg,
- " NTW" goto Logon_Failure,
- "? ICD" goto Process_Net_Msg,
- "??ICD" goto Process_Net_Msg,
- "800 Direct Dial access " goto Process_800,
- "OK^M" goto Send_OK_Cmd,
- "^[I" goto Send_Response,
- "PPP:" goto Connect_PPP,
- %mdm_Failure goto CIS_No_Carrier
- until 200;
-
- define %ErrorCode = 22;
- goto CIS_Failure;
-
- Connect_PPP:
- if %App <> "CID" goto Logon_Wait;
- define %PPP = "1";
- exit %Success;
-
-
- Process_Log_Msg:
- wait
- "INE" goto Bad_ID,
- "ISX" goto Bad_ID_Syntax,
- "CAI" goto Cannot_Auto_Irun,
- "SIL" goto System_Unavailable,
- "SIU" goto System_Unavailable,
- "SNA" goto System_Unavailable,
- "STU" goto Check_User_ID,
- "INS" goto Bad_ID_Syntax,
- "UTL" goto Too_Many_Users
- until 50;
-
- goto Try_Again;
-
- Process_IPX_Msg:
- define %ErrorCode = 23;
- define %FailureMsg = "InfoPlex nicht verfⁿgbar, spΣter versuchen";
- exit %Fatal;
-
- Process_Net_Msg:
- define %ErrorCode = 31;
- FailStr = "PPP-Verbindungsfehler, bitte erneut versuchen";
-
- wait
- "^M" goto Found_Error
- until 10;
-
- goto Return_Fail_Msg;
-
- Found_Error:
- if %Scanned = "" goto Return_Fail_Msg;
- FailStr = %Scanned;
- goto Return_Fail_Msg;
-
- Send_AccountID:
- send %AccountID & %CR;
- goto Logon_Wait;
-
- Too_Many_Users:
- if Tries = 0 goto Users_Failure;
- show "Zuviele User gleichzeitig, neuer Versuch";
- goto Start_Connect;
-
- Users_Failure:
- define %FailureMsg = "Zuviele User gleichzeitig";
- define %ErrorCode = 29;
- exit %Fatal;
-
- Cannot_Auto_Irun:
- define %FailureMsg = "Konnte 'Auto Irun HMI server' nicht starten";
- exit %Fatal;
-
- Bad_ID:
- define %ErrorCode = 24;
- FailStr = "User-ID oder Passwort ungⁿltig";
- goto Try_Again;
-
- Bad_ID_Syntax:
- define %ErrorCode = 25;
- FailStr = "User-ID Syntax ungⁿltig";
- goto Try_Again;
-
- System_Unavailable:
- define %ErrorCode = 23;
- define %FailureMsg = "Host nicht verfⁿgbar, spΣter versuchen";
- exit %Fatal;
-
- Check_User_ID:
- define %ErrorCode = 26;
- define %FailureMsg = "System nicht verfugbar, bitte User-ID uberprufen";
- exit %Fatal;
-
- Process_800:
- wait
- "is not" goto No_800,
- "rates" goto Access_Rates
- until 20;
- goto Logon_Wait;
-
-
- No_800:
- define %FailureMsg = "Fⁿr dieses Konto ist das WΣhlen einer 800-Nummer nicht erlaubt";
- define %ErrorCode = 4;
- exit %Fatal;
-
- Access_Rates:
- show "Zugangsgebⁿhren fⁿr Direktwahl einer 800-Nummer aktiviert";
- goto Logon_Wait;
-
- Try_Again:
- if not FirstTry goto CIS_Fatal;
- send "^C";
- FirstTry = %FALSE;
-
- wait
- "User ID" goto Send_ID,
- %mdm_Failure goto CIS_No_Carrier
- until 140;
-
- goto CIS_Fatal;
-
- Logon_Failure:
- define %ErrorCode = 27;
- define %FailureMsg = "Host ist vorⁿbergehend nicht verfⁿgbar";
- exit %Fatal;
-
- Send_OK_Cmd:
- if %OKCmd = "" goto Logon_Wait;
- send %OKCmd & %CR;
- goto Logon_Wait;
-
- Send_Response:
- sendi %ESCIResponse;
- exit %Success;
-
- CIS_Error:
- define %ErrorCode = 20;
- CIS_Failure:
- if FailStr <> "" goto Return_Fail_Msg;
- define %FailureMsg = "Konnte Verbindung mit dem Host nicht aufbauen";
- exit %Failure;
-
- CIS_No_Carrier:
- define %ErrorCode = 28;
- if FailStr <> "" goto Return_Fail_Msg;
- define %FailureMsg = "Modemverbindung wurde abgebrochen";
- exit %Failure;
-
- CIS_Fatal:
- if FailStr <> "" goto Return_Fatal_Msg;
- define %FailureMsg = "Konnte Verbindung mit dem Host nicht aufbauen";
- exit %Fatal;
-
- Return_Fail_Msg:
- define %FailureMsg = FailStr;
- exit %Failure;
-
- Return_Fatal_Msg:
- define %FailureMsg = FailStr;
- exit %Fatal;
-
- Return_Success:
- exit %Success;
-
- Return_Cancel:
- exit %Cancel;
-
-
- Handle_Secure_Login:
- if %MicroChallenge = "" goto Connect_Wait;
-
- call %Dir & "seclog.scr" () : FailCode;
-
- if FailCode = %Success goto Logon_Wait;
- if FailCode = %Cancel goto Return_Cancel;
- if FailCode = %Fatal goto CIS_No_Carrier;
-
- ! Failure condition.
- FailStr = %SecFailTemp;
- SecureTries = SecureTries - 1;
- if SecureTries = 0 goto CIS_Failure;
-
- show %SecFailTemp & ", neuer Versuch...";
- goto Start_Connect;
-