Neils VGetty Servlet
Working with a Firewall
Latest News (v.1.0.5)
The ease by which I could update the interface to something very
different than what it was is a testament to the decoupling of
view and model/controller that both Velocity and Turbine provide.
Great stuff if you ask me. Took me about 5 hours, including re-aquainting
myself with the TDK and making the necessary changes (and fidling lots with the HTML).
- Updated to a completely alternative look and feel.
- Fixed a couple of bugs.
What is is then?
This servlet allows you to listen to answerphone messages (which are recorded
through something like vgetty). It provides the following features:
Note: Currently, in order to be able to hear messages through
your browser (i.e: Netscape) you require some other plugin. I personally use
RealPlayer. Seems to work fine for me. Other browsers seem to have various other
ways to play .WAV files, so, as always Jim, Y.M.M.V.
- View waiting voice messages (date, has been heard?, length of message).
- Delete voice messages.
- Email zero or more people when new voice messages are recorded.
- Maintain the available greetings (add, remove).
- Install new greetings from WAV files, either from disk or from HTTP URL.
- Maintain misc. settings (paths to conversion utilities etc).
- Maintain the list of people who are to be notified by email.
I began by wanting to do a "useful" project with Servlets, to further
my understanding of them. I already had a Perl script that ran my
answerphone at home (using mgetty+sendfax+vgetty), and thought ... why not
re-write that? I also wanted a 'real' project to which I could apply
my 'Velocity and Turbine' experiment to.
And why not? I've got a number of machines at home (yes, sad, I know)
and it's somewhat useful to be able to use any of them without first having
to install software in order to do so... ra ra ra. <Typical sales
pitch for web based interface goes here> ... I might even install a 15inch LCD
X based unit near the phone :-)
I started by creating a basic Servlet/JSP application. Although
I already knew how to do this, I wanted to have something to
"convert" from, so that I could see the changes that occured when
migrating to Velocity and Turbine.
This project is the result of about 2 weeks work (while I was
looking for work), on and off. I guess I did about 6 hours per day on it.
This time includes learning 'the way of Turbine' and to a far lesser
Getting Your Mits on It (aka Download)
Currently, the source code and a few packages are available from
I've chosen to distribute the servlet in the standard WAR file format.
As such, you should not have any problem installing it, provided that you
both have a relatively up to date container. All required JAR's are included
in the WAR file.
To install (based primarily on a apache/resin combination):
If you are wanting to install the servlet where you have a) a firewall [with a modem], b)
an application server [where you are running vgetty-servlet], then see these instructions.
- Copy the .WAR file to the servlet 'deploy location' (that's servlet dependent. On resin, it is /webapps)
- At this point the servlet is deployed, and should work. However; before you get carried away and try to use it:
- Create a directory within the servlet directory (which should be automatically created by the container) called
'messages'. This would normally be created by the servlet, however you need to set the permissions of a file in this
directory if you want to be able to head Greetings files via the servlet properly.
- Create a file in the 'messages' directory named 'tmpWavFile.wav'. To do this, you might do 'touch messages/tmpWvaFile.wav'.
- Change the ownership and/or permissions of that file such that your web server is able to read it. On my system, I use
a mixture of apache/resin, therfore I did: 'chown apache.apache messages/tmpWavFile.wav' && chmod u+r messages/tmpWavFile.wav'
- Setup your web server <-> servlet stuff if not already done. For example: I use apache for serving everything other than the
servlets. Apache is setup to simply pass servlet requests to srun (which is the resin servlet runner). However; apache does
handle the requests for messages in .wav format.
Building the servlet
This step is optional. I've included a .war file in the distribution.
However if you want to build the servlet, this should not pose a significant problem
- however I've no idea what kind
of environment you have (and the current build.xml is somewhat tailored to my environment).
My environment consisted of:
You will probably see this reflected in the build.xml file. Of course, you will
need to change the properties [at the top of build.xml] before you will be able to
get the build to work.
- Velocity 1.1 rc1
- Resin 1.2 and Resin 2.0
Here are a list of dependencies that I know of (packages required
other than those that are in the distribution). You will need to have the
packages listed here installed. If you don't ... then it won't work, will it?
- mgetty+sendfax, and the voice extensions (vgetty). My server is an old Mandrake
7.2 box - hence it runs version 1.1.22-2mdk RPM's. Obviously your's may be different.
Whatever mgetty+sendfax distro you have must also include the following tools:
rmdtopvf, pvftormd, wavtopvf, pvftowav.
- Java V 1.3.0 (or above) - I make use of some objects in the
This should get the servlet itself working. You should now be able to access
voice.conf file is only looked for in
thus far. If
there are alternate locations for this file, please let me know and I will add
them to the code. In the meantime, you can just put a symlink in there which
will get around this for the present.
- On my system at least, you need to be
root in order to read the voice.conf
file. My servlet container runs as root (which may be a bad idea), so I'm OK.
Making the link from vgetty to the servlet
Obviously, in order to be able to listen to answerphone messages, they must
make their way from vgetty, to a directory managed by this servlet. You
can do this via the script:
- Modify the script above. You MUST MODIFY THIS SCRIPT FOR YOUR ENVIRONMENT, otherwise
no messages will ever appear! The script contains a couple of environment variables
that need to be modified. Nothing hard really.
- Next, Modify your
voice.conf file. Find the line "message_program"
and change it to point to this script. Example:
message_program /usr/local/resin/webapps/vgetty/bin/convertIncommingMessage (on one line)
I've not performed any testing under Windows. I don't even know if the mgetty+sendfax package
is available on that platform or not. Please don't ask me if it is. I don't know,
and I don't really want to either :-). I'm not a "I hate Windows" nutter - just
I prefer linux, and have other things to do with my time than find that kind of thing
- Testing was performed on a box running the Blackdown 1.3.0-FCS VM.
- Deployment of WAR into Resin 1.2. No problems at all. Just dropped it into webapps/ and it worked.
- Deployment of WAR into Resin 2.0. As above, worked right off the bat.
- Deployment of WAR into Turbine TDK v2.1. No probs.
You can reach me via email at email@example.com.
Feel free to submit commants and/or bug
reports (please include some relevant information, such as the servlet container
being used, the version of vgetty, and things like that) - can't promise I'll
do anything with them. Better yet - get in there and fix it yourself! It's
really not that hard. I've even commented the code.
Kindly hosted by