|
ru.linux- RU.LINUX --------------------------------------------------------------------- From : Andrew Kant 2:469/83.1 04 May 2001 14:30:59 To : Andrew Bgorets Subject : PPP callback - how ? -------------------------------------------------------------------------------- Wednesday April 25 2001 01:08, Andrew Bgorets wrote to All: AB> Mgetty тоже может перезванивать, но пока мне удается только получить AB> терминальный логин таким образом. AB> РРР-сервер в обычном режиме работает нормально. AB> Можно пускать ppp после обычного входа в систему, но как научить винду AB> пускать AB> ппп без звонка ? AB> В общем, как организовать на линуксе соединение по PPP с AB> перезваниванием, если звонить с виндовой машины ? В этом случае можно использовать скрипт на винде, а в нем включить CD у модема принудительно. === Begin CALLBACK.SCP === ; callback.scp ; Win95 dialer script to be used to handle exec callback for PPP ; note: the modem's nonvolatile config should be set to ; &C1 - CD follows carrier state ; S0=0 - do not autoanswer ; &D3 - reset (ATZ) on DTR drop ; ; the modem properties (Control Panel -> Modems -> ; Modem Properties -> Properties -> Connection -> Advanced -> Extra ; Settings) ; should be set to ; &C0 - CD always on ; S0=1 - autoanswer ; &D3 - reset on DTR drop ; Q0 - display result codes ; V1 - verbal (not numeric) result codes ; ; This file should go into /Program Files/Accessories/ ; ; Note well: this file MUST be a plain ASCII (text) file. ; It's best to edit this with Notepad or DOS Edit; if using ; a word processor, be sure to save as plain text. proc main string cbLOGIN = "???????" ; You CallBack Login string szLogin = "ogin:" ; the username prompt integer nLoginTimeout = 10 ; sec to await username prompt string szPW = "assword:" ; the password prompt integer nPWTimeout = 10 ; set to await pw prompt string szDisconnect = "background" ; message from NAS before ; callback integer nDisconnectTimeout = 10 ; sec to await hangup string szModemAnswer = "CONNECT" ; string we see when our modem ; answers callback integer nModemAnswerTimeout = 90 ; sec to await callback string szResetModem = "ATS0=0&C1O^M" ; autoanswer off, normal CD, go ; back online ; we start off once DUN has established the call. So handle the ; initial Username/Password dialog. transmit "^M" ; kick the comm server loose delay 2 waitfor szLogin until nLoginTimeout ; starts script when Username if FALSE == $SUCCESS then goto BailOut endif DoLogin: transmit cbLOGIN, raw transmit "^M" ; waitfor szPW until nPWTimeout ; if FALSE == $SUCCESS then ; goto BailOut ; endif ; transmit cbPASS, raw ; transmit "^M" waitfor szDisconnect until nDisconnectTimeout if FALSE == $SUCCESS then goto BailOut endif ; Now carrier will drop. But, since we have &C0 in effect, ; DUN should not give up. Then we should get a callback and (since ; S0=1 is in effect) answer. Then we should get a Username: prompt ; again waitfor szModemAnswer, matchcase until nModemAnswerTimeout if FALSE == $SUCCESS then goto BailOut ; didn't get a callback - just give up. endif ; now break back to modem command mode and set the modem back out ; of autoanswer mode transmit "^M" ; kick the comm server loose delay 2 waitfor szLogin until nLoginTimeout ; starts script when Username if FALSE == $SUCCESS then goto BailOut endif transmit $USERID, raw transmit "^M" waitfor szPW until nPWTimeout if FALSE == $SUCCESS then goto BailOut endif transmit $PASSWORD, raw transmit "^M" delay 2 transmit "+++" delay 2 transmit szResetModem goto Done BailOut: ; here on fatal error delay 2 transmit "+++" delay 2 transmit szResetModem set screen keyboard on halt Done: endproc ; === End CALLBACK.SCP === AB> Подскажите направление и где почитать.А может хаутунчик какой есть AB> по AB> этому поводу... Этот скрипт с действующей системы, вот только от модема к модему команды инициализации могут меняться Good bye! Andrew --- GoldED/386 3.00.Beta5+ * Origin: * KAA * (2:469/83.1) Вернуться к списку тем, сортированных по: возрастание даты уменьшение даты тема автор
Архивное /ru.linux/22893af2ccb9.html, оценка из 5, голосов 10
|