[Fwd: Vgetty question]
Gert Doering (gert@greenie.muc.de)
Sun, 27 Jun 1999 17:06:16 +0200
Hi,
On Thu, Jun 24, 1999 at 11:37:31AM +0000, Vandoorselaere Yoann wrote:
> starting with a new blank message :-)
Not perfect, as quoting is lost - and concerning the amount of traffic on
the mgetty list (and in my personal mailbox) this sometimes leads to
confusion on my side what we're talking about. But better than quoting
everything.
[..]
> For the server question, and what difference between a process forking
> itself or inetd execing a new process, this is off topic ( at this time ).
Indeed. (Naturally there's a difference, in practice, but none
conceptually... what's the conceptual difference between a pipe and a
socket anyway?)
> What you said is I don't need vgetty to make what i want to make...
> You said that, when my program is running , it just had to lock the tty
> device,
> and so vgetty doesn't take the call...
Yes.
> Now how do i do if the user doesn't want to take the call & click on the
> answering machine button ?
Indeed, this is something that is not yet possible.
One could do this with the cnd-program, but that's ugly.
(Have vgetty call cnd-program, which in turn queries your GUI, which then
signals "ignore the call" or "take the call" - but the matter of
"how to arbitrate access to the tty device" is still open, yes).
It can't be done by the shell API either, right now. So one would need to
extend the shell API ("command ANSWER", "event RING"), or write a new
high-level program that uses the C API. (But that's no news either, I
think I wrote that already...?)
> I can remove the lock file, but vgetty will reinitialize itself and wait
> for
> the ring count defined in it's config file...
> The time it do this, the person who is calling probably hangup it's
> phone...
If you use cnd-program, pickup will be immediately, but signalling will be
fairly complex - and ugly.
vgetty sits on the phone
RING comes in
vgetty calls cnd-program
cnd-program signals GUI client "hey, call from number 12345"
(via a named pipe, or something like this)
GUI asks user "do you want this call"?
no:
GUI sends signal back to cnd-program
cnd-program returns 0 -> vgetty picks up the call.
yes:
GUI "steals" LCK..ttySx file (locks.c contains a function for that)
GUI accesses /dev/ttySx to send AT commands
<user talks to modem>
<call is finished>
GUI sends ATH+ATZ commands to hangup and reset modem
GUI signals cnd-program
cnd-program returns 1 -> vgetty ignores call and waits for next call
It would need slight modifications to vgetty (to reset the modem, right
now, "return 1" means "the modem is unchanged, wait for the next call,
do not reinitialize"). That could be done when I'm doing the cnd-program
rewrite anyway.
> Now the person don't hang up, and vgetty record a message...
> What about a way to stop the recording and take the call ?
This would be severely ugly, as you would have asynchronous communications
- *that* can not be done right now, you would need to write a new high
level C program, and also change the API somewhat.
> To do all of that, there 2 solutions :
> 1: Adding one or two feature to vgetty, which make it useable by other
> application...
That's done, see above.
> So please here is the following question :
> 1: How about adding SPEAKER_PHONE_MODE to *_set_device() ?
> ( Am i wrong or speaker phone mode is the same thing as local handset ?
> ).
I think that's already done, but wouldn't help - vm has no answering
functionality, and vgetty doesn't call the "voice shell" until *after*
already answering the phone.
> 2: How about making a *clean* way to talk to vgetty ( server or library
> or pipe,
> i don't care...) ?
Send suggestions, and workable patches :-)
gert
--
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany gert@greenie.muc.de
fax: +49-89-35655025 gert.doering@physik.tu-muenchen.de