PiPhone+software

Key links


 * github repo:  @https://github.com/mrgriscom/payphone

Misc notes are below, roughly by date...


 * //Some notes from D. on Sept 2014: //**

**progress**: * wrote a library that handles all the events from andrew's PCB and lets you write classes that subscribe for notifications when certain events happen (phone goes off hook, button pressed, quarter inserted, etc.). i've made two of these handler classes so far:   - one listens for button presses and plays the standard DTMF tones through the handset speaker   - the other wraps a SIP client and turns the phone on/off hook events and button presses into meaningful VOIP actions (basically turning the phone into a phone) <span style="color: #222222; font-family: 'Times New Roman',serif; font-size: 12pt;"><span style="font-family: Arial,sans-serif; font-size: 10pt;"> <span style="color: #222222; font-family: 'Times New Roman',serif; font-size: 12pt;"><span style="font-family: Arial,sans-serif; font-size: 10pt;">* got the pi running a usb soundcard for mic-in <span style="color: #222222; font-family: 'Times New Roman',serif; font-size: 12pt;"><span style="font-family: Arial,sans-serif; font-size: 10pt;"> <span style="color: #222222; font-family: 'Times New Roman',serif; font-size: 12pt;"><span style="font-family: Arial,sans-serif; font-size: 10pt;">* set up a barebones asterisk server running on the pi that can talk to the SIP client (also running on the pi -- this took a while to understand properly) and do various things: <span style="color: #222222; font-family: 'Times New Roman',serif; font-size: 12pt;"><span style="font-family: Arial,sans-serif; font-size: 10pt;"> <span style="color: #222222; font-family: 'Times New Roman',serif; font-size: 12pt;"><span style="font-family: Arial,sans-serif; font-size: 10pt;"> - when you pick up the phone play a dialtone and dial to connect to an extension <span style="color: #222222; font-family: 'Times New Roman',serif; font-size: 12pt;"><span style="font-family: Arial,sans-serif; font-size: 10pt;"> <span style="color: #222222; font-family: 'Times New Roman',serif; font-size: 12pt;"><span style="font-family: Arial,sans-serif; font-size: 10pt;"> - play an audio file when you call a specific extension <span style="color: #222222; font-family: 'Times New Roman',serif; font-size: 12pt;"><span style="font-family: Arial,sans-serif; font-size: 10pt;"> <span style="color: #222222; font-family: 'Times New Roman',serif; font-size: 12pt;"><span style="font-family: Arial,sans-serif; font-size: 10pt;"> - play your own voice back to you when you call a different extension <span style="color: #222222; font-family: 'Times New Roman',serif; font-size: 12pt;"><span style="font-family: Arial,sans-serif; font-size: 10pt;"> <span style="color: #222222; font-family: 'Times New Roman',serif; font-size: 12pt;"><span style="font-family: Arial,sans-serif; font-size: 10pt;"> - call out to an actual phone using twilio as a gateway (set up as per this post: @http://stackoverflow.com/questions/19848222/how-can-i-use-twilio-as-a-sip-trunk-for-my-asterisk-to-make-and-receive-calls ). outgoing only; didn't set up incoming. <span style="color: #222222; font-family: 'Times New Roman',serif; font-size: 12pt;"><span style="font-family: Arial,sans-serif; font-size: 10pt;"> <span style="color: #222222; font-family: 'Times New Roman',serif; font-size: 12pt;"><span style="font-family: Arial,sans-serif; font-size: 10pt;">* made a repo: @https://github.com/mrgriscom/payphone <span style="color: #222222; font-family: 'Times New Roman',serif; font-size: 12pt;"><span style="font-family: Arial,sans-serif; font-size: 10pt;"> <span style="color: #222222; font-family: 'Times New Roman',serif; font-size: 12pt;"><span style="font-family: Arial,sans-serif; font-size: 10pt;">**future work:** <span style="color: #222222; font-family: 'Times New Roman',serif; font-size: 12pt;"><span style="font-family: Arial,sans-serif; font-size: 10pt;"> <span style="color: #222222; font-family: 'Times New Roman',serif; font-size: 12pt;"><span style="font-family: Arial,sans-serif; font-size: 10pt;">* replace the remainder of the phone's functionality with stuff controllable from the pi. this comprises: <span style="color: #222222; font-family: 'Times New Roman',serif; font-size: 12pt;"><span style="font-family: Arial,sans-serif; font-size: 10pt;"> <span style="color: #222222; font-family: 'Times New Roman',serif; font-size: 12pt;"><span style="font-family: Arial,sans-serif; font-size: 10pt;"> - ringer: i don't see any easy way to access the ringer on the phone's circuitboard. i couldn't even de-solder it off. but it looks like a standard, cheap piezo buzzer so we could just hook up our own. or maybe just get a tiny amplified speaker ( @http://www.amazon.com/dp/B0082E9K7U/ ) and run it off the usb sound card's currently unused line out. <span style="color: #222222; font-family: 'Times New Roman',serif; font-size: 12pt;"><span style="font-family: Arial,sans-serif; font-size: 10pt;"> <span style="color: #222222; font-family: 'Times New Roman',serif; font-size: 12pt;"><span style="font-family: Arial,sans-serif; font-size: 10pt;"> - coin release relay: right now inserted coins just get stuck in 'purgatory' forever. alternate option is just to remove this component and always send coins to the coin return. <span style="color: #222222; font-family: 'Times New Roman',serif; font-size: 12pt;"><span style="font-family: Arial,sans-serif; font-size: 10pt;"> <span style="color: #222222; font-family: 'Times New Roman',serif; font-size: 12pt;"><span style="font-family: Arial,sans-serif; font-size: 10pt;">* getting asterisk to do something useful like an IVR. asterisk looks ridiculously complicated and i barely scratched the surface. looks like twilio could do some cool stuff too that bypasses asterisk entirely and will probably be easier to program, but requires the phone have constant internet connection and costs $$ <span style="color: #222222; font-family: 'Times New Roman',serif; font-size: 12pt;"><span style="font-family: Arial,sans-serif; font-size: 10pt;"> <span style="color: #222222; font-family: 'Times New Roman',serif; font-size: 12pt;"><span style="font-family: Arial,sans-serif; font-size: 10pt;">* letting asterisk applications be aware of coin events. perhaps by sending the rarely-used DTMF tones A-D?