[unix-pc.general] phone lines and obm

vern@zebra.UUCP (Vernon C. Hoxie) (06/05/89)

	I am trying to put together a program which will be run
by 'cron' and which will use the obm.  When I detect that line 1 is set
to VOICE, I want to switch it to DATA then carry on.  I can use
"system("/usr/bin/phtoggle"); except that when it detects and error, it
throws up a window which needs a response.  Not too good when run by 'cron'!

	o Is there a way to run "/usr/bin/phtoggle" so that I can get
	  the error and handle it myself?

	o Is there some other mystical way to switch the phone line?
	  (My interpretation of 'phone(7)' says that a 'struct updata'
	  won't do it.  If I'm wrong, please elucidate.)

	o What is a legitimate 'arg' for ioctl(2) when using the commands
	  on phone(7) pg. 5?  I have a 'struct updata' reflecting the
	  call out parameters.  The call:
		ioctl( fd, PIOCOFFHOOK. &my_updata);
	  produces EFAULT (Bad address) perror messages sometimes then
	  sometimes it goes off hook and dials the number. ???

	I have tried using the 'dial(3C)' routine but got the following
response from the compiler:

	undefined		first referenced
	 symbol  		    in file
	tgetent             		//lib/libc.a
	tgetstr             		//lib/libc.a
	tgetnum             		//lib/libc.a

	o Apparently it needs another library but which one?

	o Is there an easy way to find out what functions are
	  defined in a given library?

Thanks for any help.
-- 
Vernon C. Hoxie		       {ncar,nbires,boulder,isis}!scicom!zebra!vern
3975 W. 29th Ave.					voice: 303-477-1780
Denver, Colo., 80212					 uucp: 303-455-2670

jbm@uncle.UUCP (John B. Milton) (06/09/89)

In article <165@zebra.UUCP> vern@zebra.UUCP (Vernon C. Hoxie) writes:
[ wants to do phtoggle from cron ]

Well, what you really want to do is tell the phone manager to do it's thing
and switch the lines. Although you COULD switch them with your own ioctl(2)
calls, the phone manager would just switch it back, or crash. What the
phtoggle progam does, is write a command to a file in /usr/lib/ua, then send
a signal to ph, who's pid can be found in another file in /usr/lib/ua. You
could replace phtoggle with your own program, but I don't think that would
solve the window problem, because it is probably coming from the phone manager.

I am being vague about details because I haven't run the phone manger in some
time. I found that I am rarely at the machine when the phone rings, a grep
of a file in my home dir works ok, and I don't want to run a 200k+ program
(ph from the fix disk)

John
-- 
John Bly Milton IV, jbm@uncle.UUCP, n8emr!uncle!jbm@osu-cis.cis.ohio-state.edu
(614) h:294-4823, w:466-9324; N8KSN, AMPR: 44.70.0.52; Don't FLAME, inform!