#gprs-connect-chat - part of PGPRS and frisbee GPRS interfaces
#(Included in both packages; uninstall neither or both.)
#Please do not modify this file.
# 
# $Id: gprs-connect-chat,v 1.2 2004/02/02 23:19:28 mcfrisk Exp $
# 130812 Modification as pgprs version 1.5 by Richard Erwin for Puppy integration,
#  to obtain APN, PIN and dialup number from separate files in chatscripts
#  directory; changed name to gprs...chat and moved to chatscripts (without
#  "exec chat...").
#
# File: 
# /etc/ppp/chatscripts/gprs-connect-chat

#The PIN code is obtained from file /etc/ppp/chatscripts/gprs-cpin_command by way of the "@" technique.
#The APN code is obtained from file /etc/ppp/chatscripts/gprs-cgdcont_command by way of the "@" technique.
#
# Description: 
# chat script to open Radiolinjas GPRS service with GPRS phones. If ppp 
# negotiation stalls, try restarting the phone. To try with other GPRS 
# operator setting, change the PDP contex setting. The settings work with 
# most Ericsson models, but Nokia 8310 and 30 do not support QoS parameters 
# with AT commands, so just delete those lines and it'll work.
#
# Set PDP context CID=1, protocol=IP, APN=icecelular:
# AT+CGDCONT=1,"IP","icecelular","",0,0
#
# Set CID=1 QoS requirements from the network, not supported by Nokia:
# AT+CGQREQ=1,0,0,0,0,0
#
# Set CID=1 minimum acceptable QoS parameters, not supported by Nokia:
# AT+CGQMIN=1,0,0,0,0,0
#
# 'Call' CID=1 (activate PDP context one, perform GPRS attach):
# ATD*99***1#
#
# Some phones like the Orange SPV (yes, the Microsoft Smartphone) use this 
# dial string to start GPRS connection:
# ATD*99#
#
# The actual chat script:
	TIMEOUT		10
	ECHO 		ON
	ABORT		'\nBUSY\r'
	ABORT		'\nNO ANSWER\r'
	ABORT		'\nNO CARRIER\r'
	ABORT		'\nNO DIALTONE\r'
	ABORT		'\nRINGING\r\n\r\nRINGING\r'
	''			\rAT
	TIMEOUT		12
	SAY			"Press CTRL-C to close the connection at any stage!"
	SAY			"\ndefining PDP context...\n"
	OK			@/etc/ppp/chatscripts/gprs-cpin_command
	OK			@/etc/ppp/chatscripts/gprs-cgdcont_command
	OK			AT+CGQREQ=1,0,0,0,0,0
	OK			AT+CGQMIN=1,0,0,0,0,0
	ABORT		'\nERROR\r'
	OK			ATH
	OK			ATE1
	OK			AT+CSQ
	+CSQ       	@/etc/ppp/chatscripts/gprs-dial_command
	TIMEOUT		22
	SAY			"\nwaiting for connect...\n"
	CONNECT		""
	SAY			"\nConnected."
	SAY			"\nIf the following ppp negotiations fail,\n"
	SAY			"try restarting the phone.\n"
