Voicemail on FreeBSD
I've built vgetty (mgetty+sendfax) solutions since 2001, and it hasn't
changed much over the years. There isn't much to improve upon when
something just works. The most difficult part of the
process is finding a good modem, with internal hardware modems becoming extinct with the phase out of the
ISA bus, the best bet is purchasing a relatively expensive external modem.
Modem: Cirrus Logic 56k ISA Fax/Voice/Modem
FreeBSD 9.0 minimal-install.
General system setup:
portsnap fetch update
portsnap extract
make install /usr/ports/comms/mgetty+sendfax
Now vgetty is installed, but getting it to work takes a few more steps..
Making vgetty work:
The Cirrus Logic modem looks like vgetty supports it,
but it actually doesn't, the easiest way to hack vgetty
modem detection is to issue an ATI command to your modem
in minicom and see what the result code is, the modem
used here responds with "1.0", so here we go:
vi /usr/ports/comms/mgetty+sendfax/work/mgetty-1.1.28/voice/libvoice/detect.c
Add:
{"1.0", &Multitech_2834ZDXv},
under the line
{"1.04", &Cirrus_Logic},
If the correct modem type isn't specified, your modem will play back
the voice files garbled or not at all. Interesting that the Multitech
works with the Cirrus Logic chipset.
In the voice directory run a "make install" to recompile detect.c
vi /etc/ttys
Modify:
cuad1 "/usr/local/sbin/mgetty" unknown on insecure
to
cuad1 "/usr/local/sbin/vgetty" unknown on insecure
After a reboot vgetty will be running, but all that really does is pick up the phone
and record messages so let's go grab a cool perl module by the guys over at
sourceforge, VOCP-0.8.1.tar.gz will turn your vgetty setup into a multiple box
voicemail system with message retrieval, command shells, and email notification.
VOCP on FreeBSD:
convert all the pvf files to your modem's rmd format using pvftormd
pw groupadd vocp
pw groupmod vocp -M root
vi /usr/local/etc/mgetty+sendfax/voice.conf
set 'rec_max_len' to 0 to disable vgetty recording
set 'dtmf_wait' to 1 for the impatient
vi /usr/local/etc/mgetty+sendfax/vocp.conf
set 'pause' to 1 for the impatient
Setting up vocpweb:
apache complained "can't do setuid" so..
chmod u+s /usr/bin/suidperl
Performance:
Although vgetty is written in C and runs lightning
fast, the vocp perl module is noticeably slower on
older machines, to check performance, time the vocp
script: time perl -c vocp.pl