Build a Twilio Hard Phone with SIP from Twilio, Raspberry Pi, and Asterisk

13 years ago (twilio.com)

So many moving parts and cables. Raspberry Pi, an old phone, FreePBX, Asterisk, Obi100. Let's outcomplex the POTS.

Seriously, how about you show us how to register an Android phone with your SIP service?

  • Good idea! This one was more of a proof of concept on how to interface with an older phone system using an ATA but I definitely want to do some soft phone tutorials in the future.

  • Don't think Twilio has SIP registration, but they do have Android SDK for Twilio Client that will do the trick.

    • So Twilio currently only offers SIP origination (DID/gateway from POTS -> IP/SIP), also known as inbound SIP trunking. I think this needs to be made more clear on their site.

      Android has a native SIP client (so do Nokia phones), which makes me wonder what purpose the Twilio Android SDK serves.

      And holy mackerel, 0.5c/minute for inbound. If I were running my own SIP enabled PBX I'd rather use Voxbone.com or one of their resellers. They have unlimited incoming minutes, charged per channel (concurrent calls).

      Edit: added bit about SIP trunking

Why is Asterisk in the mix? If you call a SIP URI directly from Twilio, can't you land it directly on the ATA?

  • Voicemail, 7-digit dial (most SIP providers only take 10), forwarding, filtering, etc.

    Twilio could theoretically handle these things for you, but they're typically handled in a PBX.

    • Hm, maybe I should have been more specific. Given that this is an interesting hack to get a PSTN call to an analogue set through Twilio, why did they bother with the SIP proxy?

      1 reply →

Now to figure out how to make this work with a rotary phone...

  • That would be hilarious.

    • Wouldn't it just work? The FXS port will generate the 90VAC/20Hz signal and the device plugged into it interprets that as an incoming call.

      You guys only support termination through SIP, not origination, so the dialling mechanism doesn't matter. And if you did want to do origination, the ATA just has to understand pulse dialling.

      2 replies →

awesome! I love seeing Twilio devs using "old" landline tech with the API. Way to go!

  • Thanks! It was so satisfying to make a physical phone ring!

    • Not to be pedantic, but what does Twilio help here? Aren't you kind of just Jerryrigging Twilio onto an Asterisk install?

      Not that this isn't cool, I just don't understand what benefit you get from having Twilio connected here. It seems like if you want to make a physical phone ring you could take a time machine back to 2004 and achieve the same thing using Asterisk, no?

      Can you explain the benefit of integrating with Twilio instead of using just plain ol' Asterisk?

      Disclaimer: I work at 2600hz, the open-source cloud telecom company.

      3 replies →

    • It's cool to see Rpi in the mix but you could get the same feeling of using old fashioned phone ringing without the land line using magic jack. So what's the recurring cost with the above solution?

What do you need twilio, raspi and asterisk for?

You just need an ATA and a sip account like callcentric.

  • SIP From Twilio will send to any SIP solution you have, this was just a neat hack with one of our favorite hardware platforms.

As a different configuration, I'm looking for a free solution that would let me dial 800 numbers from a VoIP connected home phone.

I dial into a lot of conference calls and this would be an awesome setup. Just wondering if anyone else has tackled such a config yet?

Where was this seven years ago when I had all the pieces of a decent Asterix server, minus the SIP provider? I had such plans then, but never got the last leg of the journey done. I wonder if my Sipura 1000 still works...

What would be slick is if you did a soft phone on the RPi and skipped the ATA. Then connect the speaker, mic, keypad directly to the phones old internals.

  • That's a great idea - perhaps for my next post! I liked the idea of the ATA though since it's more of a proof of concept on how to interface Twilio with an older phone system.

I thought the whole purpose of Twilio was to not use Asterisk. Just saying. Great tech.

This is ridiculously easy with Tropo. You plug in an ATA, register it and it works. We did this with an ATA to Rural India that forwarded local calls from a toll-free number to Tropo for an IVR. Works a treat. No computer needed.

What a waste of time with this Twilio garbage.

  • True that, Tropo just needs a marketing team like Twillio has and the this would be more obvious to others...