Menu system with vgetty

Jan Kasprzak (kas@informatics.muni.cz)
Tue, 8 Jun 1999 10:44:35 +0200


[Cc to the mgetty list]

	Nick,

	thanks for your suggestions. I have looked at it, and I have
fixed something. I would like to ask you to test it as well as to give
me a general advice on how the higher-level interfaces should look like.

Nick Phillips wrote:
: readnum is broken. After the first play of the message, it gets into an
: endless loop waiting for something to happen, and never either replays the
: message or quits.
:
	My fault. Fixed.

: The init function needs to wait for the "READY" (the line that is commented
: out is actually correct).

	Yes. Fixed.

: After a DTMF has been received, you will usually get a "READY". However, if
: someone keys two tones in quick succession, you will get another
: "RECEIVED_DTMF" first.

	I have not been able to verify this. I have ten USR Sportsters
on a multiport serial card in my Linux box. I have several times tried
to dial in and in the readnum() routine and type DTMF tones as fast as I can,
and it got all the keypresses correctly (one exception was that it sometimes
merged two same subsequent tones into one, but I think it is a vgetty's
part, not Modem::Vgetty's). Maybe we should look into vgetty or ask at
mgetty list.

: I don't quite know what's happening yet (haven't spent long enough on it),
: but however I try, I can't seem to get more than 3 DTMFs read in quick
: succession - I get two or three, then the next thing is a message like
: <VOICE DATA 32584> or something (from memory) in the vgetty log, and it
: appears that vgetty talks to the modem a bit, before the play stops, and
: it times out waiting for another DTMF.

	It appears to me as vgetty (or modem driver) bug. I was not able
to verify it with my USR sportsters. Well, I am on 1.1.8 as well.

: I was thinking that something more like an FSM would be a better
: fit to this application than using an event-driven system. Still, if you
: are working on extending/improving the current module, I'd be happy to
: give you any help I can. In the end, I just need something that works.

	Well. It seems we need more higher-level routines similar to readnum.
What interface do you suggest? I think about something like this:

$status = $v->wait_for_one($dtmf, $msg, $repeat, $timeout);
# plays a $msg, waiting until $dtmf is pressed (or until $timeout or maximum
# $repeat is reached. Returns undef if timeout or max. # of cycles is reached.

$num = $v->read_one($msg, $repeat, $timeout);
# plays a $msg, waiting for one keypress (or until $timeout or $repeat
# cycles is reached). Returns the DTMF keypress or undef.

$string = $v->read_keys($num, $msg, $repeat, $timeout);
# generalized version of previous one. Reads exactly $num keypresses
# instead of exactly one keypress.

$string = $v->read_string($separator, $msg, $repeat, $timeout);
# Similar to current readnum(), with $separator instead of "#".

	What do you think about it? Anything else?

	I have made the 0.04 release, available at
http://www.fi.muni.cz/~kas/vgetty/Modem-Vgetty-0.04.tar.gz.
Please test it - if it is correct I will upload it to PAUSE.

	Thanks for your suggestions.

-Yenya

-- 
\ Jan "Yenya" Kasprzak <kas at fi.muni.cz>       http://www.fi.muni.cz/~kas/
\\ PGP: finger kas at aisa.fi.muni.cz   0D99A7FB206605D7 8B35FCDE05B18A5E //
\\\             Czech Linux Homepage:  http://www.linux.cz/              ///
||||   > Where do the -- MARK --s  come from ?                          ||||
||||   It is the sound of Tux the penguin chewing on your system logs.  ||||