With all the parts of this project up and running; when you receive a Google Voice call the red and green LEDs on the LaunchPad alternate flashing on and off. Then if you press the on-board button the call will be answered. This is an interesting experiment in itself, but there is also value in each of the independent parts.
Details
A dedicated phone line is a staple for any presidents desk. And now that Google is giving away phone numbers anyone can have a single use line for free. Using a TI Launchpad to interact with it is just fun.
Components
1×
Cortelco 8211 Single Line VoIP Analog Terminal Adapter ($10.99@Amazon)
Check this out if you want to use Google Voice and your new Yate server to get free home phone service.
1×
Cortelco 2500 desk phone in fire engine red ($35.00)
Unnecessary but awesome.
In the photo attached you can see the telephone handset I wanted to use with this project. The handset was sonic welded completely around the edge and on the supports. Ended up having to slice it in half with a hack saw, not my finest work. I connected the microphone to a double A battery and a stereo headphone jack. Then using the displayed splitter I separated the microphone singal out to a sound card. At this point the signal is so weak as to be unusable. I had intended to use the battery to amplify the signal to the speaker as well, but when I discovered that the circuit wasn't powerful enough to drive the microphone I lost interest.
import serial
import subprocess
ser = serial.Serial()
ser.port = "/dev/ttyACM0"
ser.baudrate = 9600
ser.open()
value = 0
blinkcount = 10
while 1:
p = subprocess.Popen(["linphonecsh", "status", "hook"], stdout=subprocess.PIPE)
result = p.communicate()[0]
if "hook" in result :
continue
else :
if blinkcount > 9 :
ser.write("n")
blinkcount = 0
else :
blinkcount = blinkcount + 1
continue
value = ser.read();
if value == "[":
p = subprocess.Popen(["linphonecsh", "generic", "answer"], stdout=subprocess.PIPE)
This project is very portable. It could be used to signal a results from any program that can be poled from the command line. Or execute any designated command on a button press.
3
Step 3
Yate(Yet Another Telephony Engine):
Answering Google Voice calls that are forwarded to Google chat is tricky if you don't want to use the Gmail chat application. I found the most functional results were achieved by using Yate, to create an SIP server that handles the communication with Googles servers.
These tutorial will get you up and running with your own SIP server. The first tutorial shows a fuller installation, but the second is a little newer so they are both useful. Google Voice Calls Through Yate server - using your SIP account & Yate Server: Free Google Voice Calling. On Ubuntu 12.04 you will need a newer version of Yate then is in the repositories. Check out this PPA ppa:vpol/yate. Make sure you install all the packages; yate, yate-qt4, yate-core, yate-openh323, libyate4.3.0.
At the end of the first tutorial there is a section "SIP account logged in YateClient". For some extra explanation on this section. Run Yate Client then in the setting menu select accounts. Now click new and fill out the form like this.
use provider = none protocol = -sip- username = username password = something server = 192.168.0.5
These same settings can be used to register your SIP server with Empathy to send and receive calls, or with other softphones.