Hacker News new | comments | show | ask | jobs | submit login
Build a Twilio Hard Phone with SIP from Twilio, Raspberry Pi, and Asterisk (twilio.com)
125 points by jonmarkgo on Mar 20, 2013 | hide | past | web | favorite | 42 comments

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.

Yeah, this would definitely be the way to go for an Android device. Use the SDK examples to build a little dialer and use the ACTION_CALL intent, and it works great for outbound as well.

Docs and download are here - http://www.twilio.com/docs/client/android

Rob, are you guys looking to do SIP Reggie soon? I imagine it's gotta be coming at some point (I don't know why you guys don't do it now except for the obvious pain point of network overhead from all that registration traffic).

We're pretty stoked on what we have planned for our SIP roadmap, but staying true to our discipline of announcing features only when they ship.

SIP From Twilio is all we have to report right now.

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?

I'm not sure I understand your question, but I think it's because the ATA (like most modern/cheap ATAs) only speaks SIP.

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.

Yeah - I think it would. Going to eBay a fierce looking red one from the sixties and going to give it a spin.

Keep it under a glass cake cover by a bust of William Shakespeare. Next up: installing firepoles DIY.

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.

Great question Josh. Big benefit here is being able to keep your voice application logic in your own code instead of in Asterisk. Often we find in business telephony applications, the really important information you want to get to and from the user isn't in the phone server, but in the CRM app or help desk app or support app that the phone server is trying to get to and from the user. The closer data like account numbers or service tags or support tickets is to the logic that directs your IVR tree or call queue, the easier it is to build experiences that delight users. Siloed telephony and business software manifest themselves in ugly ways like having to repeat information to multiple agents or waiting on hold while your account information is retrieved.

We think if the code that makes your customers happy and the code that makes your phones ring can finally live in the same place, some pretty magical stuff can happen.

As always Rob, great answer :).

I think the part that made me scratch my head was the line where Jon said "It was so satisfying to make a physical phone ring!" which is funny when you take it out of context for a multitude of reasons. I hope you appreciated my quip about time travel ;).

Having the logic separate from the delivery may make sense for some applications and might not for others. We wrestle with clients all the time that want various elements of the platform either directly under their control or as far away as humanly possible. There's usually little rhyme or reason to understanding which components are supposed to go where or for what reason, but that's Telecom in a nutshell. When dealing with large carriers, the question of what goes in the firewall, and what stays out, is a complete mystery until right before you ink the contract.

To be fair, your point about siloed telephony and business software does ring a tad hollow when you talk about Twilio which is essentially a silo for business logic of a different color, right?

Once again, I do really enjoy these chats :D. I also admire the hard work your team does writing these blogs which I point to as a great example of developer evangelism. Your team does a great job of getting out there and showing off the tech. I especially like the edge case stuff, like jamming Asterisk onto a Raspberry pi and connecting it to an obihai ;).

I'm not sure the answers I have are always great, but really appreciate your praise of the devangel crew at Twilio. I'm very lucky to work with them.

Re: silos - You know, when it comes to all this cloud buzzword stuff, it definitely can feel like a shell game. Like you are moving a headache from one area to another for the sake of staying technologically trendy. But, I think a lot like you in the sense that the technical details matter.

In the case of an API play like Twilio, your logic stays in your app and that logic instructs how the call or SMS through a very simple interface. We don't host or hold anything for you - we just make the process of you telling us what to do as easy as we possibly can using the tools you already have.

APIs that are thoughtfully designed and carefully crafted are silobusters - they erase the painful demarcation lines of our software making the limits on what is possible less about how one piece of code talks to another, but why.

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.

What's with this on the blog background?

"SECURITY WARNING: Please treat the URL above as you would your password and do not share it with anyone."

Weird, I have no idea. Thanks for pointing it out...will check into it

Seems to be a Facebook thing.

It was - bug with our social widget. Corrected now.

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?

I'm pretty sure sipgate supports free 800 calls

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.

Could this be deployed using OpenVBX?

Potentially, though you may need to hack up a SIP module yourself.

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...

Can't wait to resurrect my SI football phone!

I have an old Lego phone collecting dust somewhere that sprang instantly to mind when reading this. Great post!

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact