From:	MERC::"uunet!CRVAX.SRI.COM!RELAY-INFO-VAX"  1-JUL-1992 16:27:37.23
To:	info-vax@kl.sri.com
CC:	
Subj:	Re: need autodial for BATCH JOB (!)

brodie@fps.mcw.edu writes:
> DOes anyone out there have a routine, program, or even dcl that
> will dial a phone number (presumably on a modem) automaticaly?
> 
> I'm looking for something like the DTE_HAYES.MAR that shows
> up here once in a while, *but*, it MUST work from a batch job
> or a detached process.   No interactive.

SET HOST/DTE (aka DTEPAD) won't run in batch (at least, not without some 
coercion, and then won't be useful), but DTE_HAYES itself has no qualms.  
I posted a dial back utility a little while ago that utilised a DTEPAD 
compatible dialler (eg DTE_HAYES), and ran "sort of" in batch (ie without 
using the controlling terminal).

The following code call a DTEPAD-compatible dialler to will dial a number:

--cut-here--
		.title dial	dial a number

modem:		.ascid "MODEM:"		; Device name of modem
number:		.word 0			; Empty dynamic string descriptor
		.byte DSC$K_DTYPE_T	; to receive phone number
		.byte DSC$K_CLASS_D
		.long 0
prompt:		.ascid "Number: "	; Prompt for phone number
chan:		.blkl

		.entry dial, ^M<>	; Start of code
		pushaq prompt		; Get number from command line
		pushaq number
		calls #2, g^LIB$GET_FOREIGN
		blbc R0, 99$

		$ASSIGN_S chan=chan, devnam=modem
		blbc R0, 99$		; Assign channel to modem

		pushl chan		; Call dialler
		pushl chan
		pushaq number
		calls #3, g^DIAL_ROUTINE

99$:		ret			; Come here on error

		.end dial
--cut-here--

To compile:
	$ MACRO DIAL.MAR
	$ MACRO DTE_HAYES
	$ LINK DIAL,DTE_HAYES

To run:
	$ DIAL :== $disk:[dir]DIAL
	$ DIAL phone-number


--
Don Stokes, ZL2TNM (DS555)                        don@zl2tnm.gen.nz (home)
Network Manager, Computing Services Centre            don@vuw.ac.nz (work)
Victoria University of Wellington, New Zealand              +64-4-495-5052

