Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > media > main-release > by-pkgid > d3516bf0f0e855cd3070a62e1768a14c > files > 38

uucp-1.07-5mdv2008.1.x86_64.rpm

#!xchat
# @(#) modified from dial.hayes V1.1 Tue Sep  1 13:59:58 1992 (Bob Denny)
#      modification by prye@picu-sgh.demon.co.uk (Peter Rye) 
#      Fri May 15 18:46:06 BST 1998
#
# xchat script for using "ringback" with a vanilla Hayes modem
#
# Usage:
#	xchat Hayes.Ringback telno
#
# where telno is the telephone number, subject to pause and wait
# character modification. 
#
# Uncomment the first two lines after "start:" to get debugging
# in file "Dial.Log"
#
# Flush input, zero counter, set telephone number if supplied,
# else fail if no telephone number given.
#
start:
	##dbgfile 		Dial.Log
	##dbgset  		15 
	zero
	flush
	ifnstr	notelno		0
	telno			0
	goto	initmodem
#
# Missing telephone number.
#
notelno:
	logerr	No telephone number given
	failed
#
# Reset the modem to nonvolatile profile. 
# Allow 3 sec. for response, as some modems are slow to reset.
#
initmodem:
	count
	ifgtr	cantinit	4
	send	ATZ\r
	timeout	initmodem	3000
	expect	setupmodem	OK
#
# No response from modem
#
cantinit:
	logerr	Can't wake modem
	failed
#
# Send the stuff needed to initialize the modem to the modes
# needed for the particular modem flavor. The string below
# is provided as a vanilla example. Allow 2 sec. for the
# modem to respond to this command.
#
setupmodem:
	sleep	1000
	send	ATZ\r
	timeout	setupfail	2000
	expect	setupfail	ERROR
	expect	dialnumber	OK
#
# Modem barfed or died on setup command.
#
setupfail:
	logerr	Error in modem setup string
	failed
#
# Dial the supplied number. Handle the various errors that
# can come back from the modem by logging the error.
#
dialnumber:
	sleep	1000
	send	ATDT
	dial
	send	\r
	flush
	timeout	hangup	4000
	expect	errconnect	CONNECT
	expect	busy		BUSY
	expect	nocarrier	NO CARRIER
	expect	noanswer	NO ANSWER
	expect	nodialtone	NO DIALTONE

hangup:
	hangup
	sleep	4000
	send	+++
	sleep	4000
	send	\r
	sleep	1000
	send	ATZ\r
	timeout	resetup		2000
	expect	resetup		OK

resetup:	
	sleep	8000
	send	ATZ\r
	expect	redial	OK

redial:
	sleep	1000
	send	ATDT
	dial
	send	\r
	flush
	timeout	timeout		30000
	expect connected	CONNECT
	expect	busy		BUSY
	expect	nocarrier	NO CARRIER
	expect	noanswer	NO ANSWER
	expect	nodialtone	NO DIALTONE
	
#
# Success!
#
connected:
	success
#
# Handle modem dial failures
#
timeout:
	logerr	Modem or carrier timeout.
	failed
errconnect:
	logerr	Connected on first call.
	failed
busy:
	logerr	BUSY
	failed
nocarrier:
	logerr	NO CARRIER
	failed
noanswer:
	logerr	NO ANSWER
	failed
nodialtone:
	logerr	NO DIALTONE
	failed
#
# end
#