perl

Asterisk for Web Developers

Tom's picture
Tags: 

You've probably heard of Asterisk before. It's one of those buzzed-about open source projects that keeps popping up on O'Reilly and Slashdot. Take our word for it: it's fun stuff. At EchoDitto we run our office phone system on it, have built client applications around it, and even made a version of Tetris for our lobby monitors that runs on it (more on that later).

But getting into Asterisk can seem more intimidating than it really is. There's plenty of documentation around, but a lot of it seems to assume that the reader has just come home from his or her job managing AT&T's fiberoptic backbone and is now hoping to screw around with some open-source fun. In other words, it's written for an audience of VoIP engineers.

Well, none of us are VoIP engineers. If you're like us, you're a general technologist who builds stuff on the web, knows that in five years your toaster will have Ruby bindings, and realizes that There Is No Spoon. You've used Skype and heard of Vonage, but you don't know much about VoIP besides that. And now you'd like to use Asterisk to recreate the final scene in The Lawnmower Man (the director's cut) — or maybe just have your website talk to people over the phone.

We can do that! In fact, it's probably easier than you think. In this post I'll outline how to get up and running with Asterisk, how to connect it to the Plain Ol' Telephone System (POTS) and how to connect it to your programs. From there it's up to you.

Flickr? Ruby Hardly Knows 'Er

Tom's picture
Tags: 

To borrow a phrase from the execrable band Linkin Park, I'm breaking the habit... tonight! Or I was planning to, anyway. The habit in question? Perl.

I was powerless even as it strengthened its hold on me. It's not that I love the syntax — different operators for strings and scalars? A vast collection of frequently-unintuitive file test flags? No thanks. And the procedure for passing parameters to functions is frankly inexcusable.

But it's installed everywhere, and it's got bindings for everything. Yes, it's slow and unglamorous, but Perl reliably gets the job done.

Still, the cool kids were leaving it behind just as I was discovering the full, terrifying power of a scripting language and a well-stocked package manager. I tried to follow those cool kids, but a flirtation with Python went nowhere. I hated tying whitespace to logic, and when I realized how cumbersome its regex syntax was I threw in the towel.

So now I'm giving Ruby a shot, and I'm cautiously optimistic. I worked through the downright-awesome Try Ruby interactive tutorial and liked what I saw. Getting the language installed on my OS X and Linux machines was a snap, and Gems broke in ways that didn't seem outrageously worse than CPAN. Still, tonight hasn't been encouraging.

How can you have a scripting language with Flickr API bindings that are this bad? Of the three Ruby projects that claim to talk to Flickr, one is a partial implementation that is now outdated and broken; another got folded into a larger project that's never actually released anything; and the third is completely undocumented and doesn't work unless you authenticate with Flickr — a step that's complex and should be completely unnecessary for many operations.