FreeOS.com logo

FreeOS Most Popular
* Most Read stories
* Commented Stories
* Active Categories
* Non Linux Section
* User Submitters
* Top Polls
* Top Authors
* Top Reviews
* Top Rated
* Top Search Terms

Top Articles
* Writing a Linux device driver
* The Linux filesystem explained
* Samba NT Domain Controller
* Setting up Squid as your caching HTTP/FTP proxy
* Web server tutorial - Part 1

FreeOS Highlights
* Howtos (72)
* Reviews (20)
* Opinions (18)
* Interviews (8)
* News (3)

My FreeOS

Nick:
Pass:
Register

Forgot your password?

Contact Us
Contact Us

       

Project: Linux triangle Howtos triangle

Answering machine on your Linux box

By Mayank Sarup <mayank@freeos.com>
Posted: ( 2001-02-27 10:08:09 EST by )

Just about every modem these days comes with voice capability. Given the right tools, your modem can double as an answering machine too. Linux doesn't leave your modem out in the cold. There is a very good utility that can be used to setup your modem to provide the same functionality.

We'll be using Vgetty, part of the mgetty package. The official site is http://alpha.greenie.net/vgetty. You probably not have to visit the site because just about every distribution carries it. We grabbed the mgetty package off our SuSE CD. The version used is 1.1.12. Alternatively, you can download the release along with the mgetty source package from http://aplha.greenie.net/mgetty. The latest version on site that we saw on the site was 1.1.25. Grab the source if you like.

Installation from source is easy.

Untar the source

tar zxvf mgetty1.1.25-Feb01.tar.gz

Change into the new directory

cd mgetty1.1.25

cp policy.h-dist policy.h

We need to edit the Makefile to change some of the default settings.

vim Makefile

Look for CONFDIR. Remove the $(PREFIX) bit so that the configuration files reside in /etc/mgetty+sendfax. Look around at the other defaults and customize if you like.

Compile

make

Enter the voice sub-directory and compile the necessary programs.

cd voice
make
make install

For RPM fans all you need to do is rpm -Uvh mgetty-1.1.21-91.i386.rpm

The default configuration directory should be /etc/mgetty, or /etc/mgetty+sendfax as in our SuSE installation. For those installing from source, you will need to copy the sample voice.conf-dist file into your configuration directory.

cp voice.conf-dist /etc/mgetty+sendfax/voice.conf

Open this file and read through it. The file is very well commented and you should definitely spend some time reading through.

Search for the following parameters and customize your installation.

voice_dir - Point this to the directory that holds your answering machine message as well as your incoming messages.

rings 3 - Replace the 3 with the number of rings after which the phone is picked up.

voice_devices - Add the device where your modem is connected. COM1 would be ttyS0, COM2 would be ttyS1, and so on.

port ttyS0 - Put in the port on where your modem connects.

Now open /etc/inittab and add the following line to it. Check for and comment out any lines that invoke mgetty.

S1:23:respawn:/usr/local/sbin/vgetty ttyS0

Now you need to record the message that you want to be played when the phone is picked up.

If you have a microphone that you can plug into the mic port on the modem then all you need is this command.

vm record standard.rmd

Or you could use a pre-recorded file. Record your message and save it as wav format. Make sure that the file is mono and not stereo. Now you need to run it through a few programs ( included in the vgetty distribution ) to get the final output in the rmd format.

wavtopvf filename.wav filename.pvf

Convert the wav to pvf format

pvfspeed -s 7200 filename.pvf filename2.pvf

Change the sampling rate of the pvf file to 7.2Khz. Each modem supports a particular sampling rate and our Rockwell based modem required this sampling rate. The command below will not work if the input pvf file is not in the correct sampling rate. Pvftormd will fail and also tell you what the desired sampling rate is for your modem.

pvftormd Rockwell 4 filename2.pvf filename.rmd

Pvttormd again needs to know what modem to create the rmd file for because the encoding is modem specific. Use pvfspeed -L to see the list of supported modem types. The modem type is case sensitive. The next parameter that can be seen here is 4, which is the number of bits per sample. Possible values for your modem will be shown in the list of supported modem types. More bits means larger rmd files but better sound quality.

The above series of commands can be compressed into a single command line as given below.

wavtopvf filename.wav | pvfspeed -s 7200 | pvftormd Rockwell 4 > filename.rmd

Copy the output rmd file to /var/spool/voice/messages as standard.rmd. Vgetty offers you the option of using multiple greeting files. Create any number of files and place them in the messages directory. Then create or edit the file named Index ( watch the case! ) and put the filenames of the greeting files here. Only one filename per line. Vgetty will now use any of the files specified in there as the greeting message.

That's the setup of vgetty. Now you should start it by giving the command init q. Vgetty will now be running and ready to receive your phone calls.

After picking up the phone vgetty will play the greeting message and then send a beep through the line. Then it switches to recording mode to save the incoming messages. These are saved in the incoming messages folder under /var/spool/voice/incoming.

The files can be played over the phone using the following command.

vm play filename

You can also play it over your sound card using the following command.

rmdtopvf filename.rmd | pvfspeed -s 8000 | pvftobasic > /dev/audio

This was just a basic single voicemail boxmachine setup. There's a lot of customization that can be done here, including multiple voicemail boxes. There's a very good solution that gives you all this. Check out VOCP at http://vocp.sourceforge.net.

Mgetty Home
Vgetty
VOCP

Other articles by Mayank Sarup

Current Rating: [ 8.15 / 10 ] Number of Times Rated: [ 39 ]

More Howtos
* Kernel Compilation & Avoiding ‘Unresolved Symbol’
* Configuring CVS and CVSUP on Linux
* Knoppix installation tips
* Maximum Mount
* A WebServer Guide -- Help Using Apache

Contents
Articles
  Howtos
  Interviews
  News
  Opinions
  Reviews
Comparison
Links
  Articles
  Howtos
  Interviews
  Opinions
  Reviews
  Websites
News

Linux
About Linux

Print It!
Printer Friendly Version