mpd.conf:default:
load skylink
startup:
# set user foo bar admin
# set web self 127.0.0.1 5006
# set web open
skylink:
create link static L1 modem
set link accept chap-md5 acfcomp protocomp
set link enable incoming acfcomp protocomp
set link no pap chap-msv1 chap-msv2 eap
set link action bundle B1
set link bandwidth 921600
set link max-redial 0
set link keep-alive 10 60
set modem device /dev/cuaU0
set modem watch -cd
set modem script SkyLinkDial
set modem speed 921600
set auth authname mobile
create bundle static B1
set iface up-script /usr/local/etc/mpd5/skylink-up.sh
set iface down-script /usr/local/etc/mpd5/skylink-down.sh
# set iface down-script /_conf/mpd/link-down
set bundle links L1
set bundle yes compression
set iface addrs 1.1.1.1 89.253.1.17
# set iface addrs 1.1.1.1 2.2.2.2
set iface enable nat
# set iface route default
# set iface route 85.249.74.76
set iface enable tcpmssfix on-demand
# set iface enable tcpmssfix
# set iface disable on-demand
set iface idle 900
set ccp disable pred1 deflate
set ccp deny pred1 deflate
set ccp accept mppc
set ccp enable mppc
# set mppc accept compress
# set mppc enable compress
# set mppc deny e40 e56 e128 stateless
# set mppc disable e40 e56 e128 stateless
# set ipcp enable req-pri-dns req-sec-dns
set ipcp yes vjcomp
open iface
mpd.script:
SkyLinkDial:
log "Starting modem script"
call ModemInit
call CheckPPP
#Reset to default configuration.
set $sendstring "Z"
call SendString
#Echo commands in command state or online command state.
set $sendstring "E1"
call SendString
#Return result codes.
set $sendstring "Q0"
call SendString
#Display result codes as words.
set $sendstring "V1"
call SendString
#Enable additional result code CONNECT <rate>. Disable dial tone and busy detection.
set $sendstring "X1"
call SendString
#Circuit 109 (CF) always on except wink on channel disconnect.
set $sendstring "&C2"
call SendString
#Disable automatic answering.
set $sendstring "S0=0"
call SendString
#Set Rm interface protocol
# 0 - Asynchronous Data or Fax
# 1 - Packet data service, Relay Layer,Rm interface
# 2 - Packet data service, Network Layer Rm interface, PPP
# 3 - Packet data service, Network Layer Rm interface, SLIP
# 4 - STU-III Service
# 127 - Mobile-to-Mobile data(only supported in LG Telecom, Korea)
# 130 - Packet data service using built-in TCP/IP protocol stack (AnyDATA.NET proprietary)
set $sendstring "+CRM=2"
call SendString
call ModemDial
call CheckPPP
failure
AutoLogin:
log "Initiating auto-login..."
# At any time if we see an LCP frame (not our own echo) then we're done
match "\x7e\xff\x03\xc0\x21" AutoLoginFrame
match "\x7e\xff\x7d\x23\xc0\x21\x7d\x21" AutoLoginFrame
match "\x7e\xc0\x21" AutoLoginFrame
# Now send a "fake" PPP frame (this is an empty config-reject with id# 172).
# This should trigger any auto-detecting servers to jump into PPP mode,
# which is good because it's faster (by avoiding human readable messages)
# and more reliable (PPP framing).
print "\x7e\xff\x7d\x23\xc0\x21\x7d\x24\xac\x7d\x20\x7d\x24\x2e\x2b\x7e"
log "Send \x7e\xff\x7d\x23\xc0\x21\x7d\x24\xac\x7d\x20\x7d\x24\x2e\x2b\x7e to modem :)"
wait 5
if $ppp != "Ok" goto AutoLoginTimeout
return
AutoLoginFrame:
log "Detected PPP frame."
set $ppp "Ok"
return
AutoLoginTimeout:
log "Auto-login timeout."
return
ModemDial:
log "ModemDial"
log "Call to ISP(#777)."
print "ATDT#777\r\n"
log "Try to connect"
match "CONNECT" AutoLogin
wait 7
if $ppp != "Ok" log "No response from the modem after dialing."
return
SendString:
log "SendString"
log "Type AT${sendstring}"
set $modemCmd $sendstring
call ModemCmd
if $modemCmdResult != "Ok" call CheckPPP
return
ModemInit:
log "ModemInit"
print "\x7e\xff\x7d\x23\xc0\x21\x7d\x24\xac\x7d\x20\x7d\x24\x2e\x2b\x7e"
log "Send \x7e\xff\x7d\x23\xc0\x21\x7d\x24\xac\x7d\x20\x7d\x24\x2e\x2b\x7e to modem :)"
set $modemCmd ""
call ModemCmd
if $modemCmdResult != "" log "Init Result - $modemCmdResult"
if $modemCmdResult != "Ok" call CheckPPP
if $modemCmdResult == "Ok" return
return
ModemCmd:
match "\x7e\xff\x03\xc0\x21" AutoLoginFrame
match "\x7e\xff\x7d\x23\xc0\x21\x7d\x21" AutoLoginFrame
match "\x7e\xc0\x21" AutoLoginFrame
set $modemCmdResult ""
print "AT$modemCmd\r\n"
match "\x7e\xff\x03\xc0\x21" AutoLoginFrame
match "\x7e\xff\x7d\x23\xc0\x21\x7d\x21" AutoLoginFrame
match "\x7e\xc0\x21" AutoLoginFrame
match "OK\r\n" ModemCmdOk
match "NO CARRIER" ModemCmdNoCarrier
match "ERROR" ModemCmdErr
wait 3
call CheckPPP
if $modemCmdResult != "" log "$modemCmdResult"
if $modemCmdResult == "" log "The modem is not responding."
return
ModemCmdOk:
set $modemCmdResult "Ok"
return
ModemCmdErr:
set $modemCmdResult "Error"
return
ModemCmdNoCarrier:
set $modemCmdResult "The modem did not connected to CDMA network"
return
CheckPPP:
if $ppp == "Ok" success
return
mpd.secret:
mobile "internet"