Shadowmage.org
Login
» Menu
» Home
» About
» To Do
» Projects
» Photos
» Themes
» Technical Notes
» Schoolwork
» /images/
» /webcam/
» Desktop Pics
» Contact
» Chat

» Pals
Andrew
» Gavin
» GraphicV
» IQpierce
» Jbond64
» JonoD
» JustinW
» Kevyn
» Lakitu7
» Samantha
» Schroe
» Steph
» TFB
» Tiger
» Troy
» Wala

» Archives
» April 2006 (2)
» February 2006 (1)
» January 2006 (2)
» December 2005 (2)
» November 2005 (1)
» October 2005 (1)
» August 2005 (3)
» July 2005 (1)
» June 2005 (1)
» February 2005 (1)
» January 2005 (1)
» October 2004 (3)
» September 2004 (3)
» August 2004 (2)
» July 2004 (4)
» June 2004 (5)
» May 2004 (4)
» April 2004 (4)
» March 2004 (3)
» February 2004 (2)
» 2003
» 2002
» 2001

» Telecom Voicemail
Summary
Modem is plugged into computer
mgetty-voice answers phone and takes messages, calls new_voice or new_fax depending.
new_voice and new_fax process files out of /var/spool and deposit into /home/mage/voicemail
voicemail/index.php Lists voice messages and faxes and lets users listen to/view. Also lets users desribe voice messages.

Software
the script that lets users use the output is 16kb so I'm not posting as part of this.

cat /etc/mgetty/new_voice
####
#!/bin/bash
#
# new_voice
#
OWNERSHIP=mage:users
VOICEMAILSTO=root
telecomdir=/home/mage/voicemail
VOICE_NAME=$1
echo `date +%F-%H.%M` $@ >> /tmp/voice_variables.txt

TIMESTAMP=`date +%F-%H.%M`
#rmdtopvf v-27004-1062727301.rmd | pvfspeed -s 8000 | pvftowav > v-27004-1062727301.wav
# v-$PID-$unixtimestamp.rmd
rmdtopvf $VOICE_NAME | pvfspeed -s 8000 | pvftowav > /home/mage/voicemail/$TIMESTAMP.wav
chown $OWNERSHIP /home/mage/voicemail/$TIMESTAMP.wav
rmdtopvf $VOICE_NAME | pvfspeed -s 11000 | pvftowav | lame - $telecomdir/$TIMESTAMP.mp3
chown $OWNERSHIP $telecomdir/$TIMESTAMP.mp3
chown $OWNERSHIP $VOICE_NAME
mv $VOICE_NAME $telecomdir/$TIMESTAMP.rmd
#GSM_NAME=/tmp/`basename $VOICE_NAME .rmd`.gsm

#cp $VOICE_NAME $GSM_NAME

#/usr/local/bin/mutt -F /dev/null -s "New voice message `date`" \
# -a $GSM_NAME $VOICEMAILSTO < #New voice message on `date`
#EOF
#rm -f $GSM_NAME
exit 0
##########################################################


I very recently added mp3 playback via a flash movie to the web portion of this, so I had to make mp3s, I converted from the rmd files that mgetty outputs instead of from the wav files because I had to change the sample rate. With the wav's I used 8kHz which is how many samples the modem kicked out, and flash requires a multiple of 11kHz. Lame actually resamples it to 11.025kHz so maybe I should change the value in the pvfspeed command. It took my P3 533 17 minutes 22 seconds to encode 371 mp3's

cat make-mp3s.sh
#!/bin/bash
for ITEM in `ls /home/mage/voicemail/*.rmd`; do

FILE=`basename $ITEM .rmd`
if [ ! -e $FILE.mp3 ] ; then
#echo $FILE.mp3
rmdtopvf $ITEM | pvfspeed -s 11000 | pvftowav | lame - $FILE.mp3
fi
done


Heres a script I used to change the resolution of the images available to web browsers. It doesn't check if the gif is already there like the make-mp3s script does. 18 fax pages took 3 minutes and 24 seconds to be processed which is an average of 26 seconds.

cat make-fax-gifs.sh
#!/bin/bash
for ITEM in `ls /home/mage/voicemail/g3.dump/ | grep -v txt | grep -v gif | grep -v pbm | grep -v xwd`; do
echo $ITEM
#g3toxwd -aspect 2.0 g3.dump/$ITEM | convert - $ITEM.gif

g32pbm g3.dump/$ITEM | convert -resize 800x2400 - $ITEM.gif
DIMENSIONS=`identify $ITEM.gif | cut -d " " -f 3`
HEIGHT=`echo $DIMENSIONS | cut -d "x" -f 2`

if [ $HEIGHT -ge 1100 ]; then
#echo its too big
convert -sample 100%x50% $ITEM.gif $ITEM.gif
fi
echo `ls -l --time-style=+%y%m%d%H%M g3.dump/$ITEM `
echo `ls -l --time-style=+%y%m%d%H%M g3.dump/$ITEM | cut -d " " -f 7`
touch -t `ls -l --time-style=+%y%m%d%H%M g3.dump/$ITEM | cut -d " " -f 7` $ITEM
.gif
#echo h=$HEIGHT
done


Hardware
Hardware is very simple and boring, I use an external USRobotics 56k Voice/Fax modem hooked up to COM1 (/dev/ttyS0) This modem has served me well since 1999


Random row (37/127) from rand_thought
"Diplomacy is the art of letting the other party have things your way." -- Daniele Vare
All trademarks and copyrights on this page are owned by their respective owners. Comments are owned by the Poster. The Rest (c) 2001-2005 Kyle Kienapfel.