! DIAL.MICROCOM - Microcom AX/2400c dial script
! by Javier Henderson, henderson@hamavnet.com
!    Hamilton Avnet
!    10950 W Washington Blvd
!    Culver City, CA 90230
!
	zero
	flush

! Wake up the modem. The setup string below defines the following
! features:
! 
! Echo commands, result codes, extended result codes, line condition
! detection, autorelible connection, compression enabled, bidirectional
! hardware flow control, fixed interface speed.
!

wakemodem:
	count
	ifgtr	cantwake	4
	send			ATQ0E1\N3\V1V1X4\L0%C1\J0\Q3\r
	timeout	wakemodem	2000
	expect	dialnumber	OK


! Modem is dead...get out

cantwake:
	logerr	Can't wake modem
	failed

! Modem is alive...dial the number!

dialnumber:
	send			ATDT
	dial
	flush
	send			\r
	timeout	timeout		0
	ifcarr	connected
	expect  reliable	CONNECT/REL
	expect	connected	CONNECT
	expect	nocarrier	NO CARRIER
	expect	notone		NO DIALTONE
	expect	voice		VOICE
	expect	busy		BUSY


! We're in business...

connected:
	log	AX/2400c dialed ok
	success


! Obtained a reliable connection...

reliable:
	log	AX/2400c dialed ok with reliable connection
	success


! Phone line is dead

timeout:
	logerr	Timeout awtg response or carr after dial string
	failed


! Never got an answer

nocarrier:
	logerr	Modem reported NO CARRIER
	failed


! The other line is busy

busy:
	logerr	Modem reported BUSY
	failed


! Never got dial tone

notone:
	logerr Modem reported NO DIALTONE
	failed


! Got voice answer

voice:
	logerr Modem got voice answer
	failed
