Raspberry Pi as Night Ringer OR Intercom

Update: Since this post we started using USB Audio dongles for better quality over the internal audio ports, removing the need to use the loopback driver /sbin/modprobe snd-aloop Thanks Ed for the reminder!

So I absolutely hate adapting ATA’s or whatever to use with old intercom systems, and Valcom’s solution is way over priced for what most people need.

This costs about $100 in equipment, and you should know how to install raspian (or google how).

Once you have a good install of raspian and have ran rpi-update, here’s the setup.

Update repo’s and install linphone

sudo apt-get update 
sudo apt-get install linphone-nogtk

Then create the script in /usr/local/sbin/picom.sh

linphonecsh init
sleep 6
linphonecsh register --host <ip address> --username <Ext>  --password <password>
linphonecsh status register
linphonecsh generic 'autoanswer enable'
linphonecsh soundcard ring 0
linphonecsh soundcard playback 0
linphonecsh soundcard capture 2
linphonecsh generic 'codec enable 8'

If you want to use the night ringer, simply remove

linphonecsh generic 'autoanswer enable'

make the file an executable.

chmod +x /usr/local/sbin/picom.sh

And either create a cron job OR init script (crontab -e or /etc/rc.local)

/sbin/modprobe snd-aloop
chmod 666 /dev/null

if you need to adjust the volume, run this command.

amixer set PCM -- 100%

Say Something Nice