Create get-opencnam.pl

OpenCNAM for Asterisk cidnam lookup

ong ago, in a world much different from today, one could check 411.com, anywho, and even google for Caller ID names. Those days are gone my friends. It’s slowly becoming a pay to play world…

I just played with a solution from OpenCNAM that was pretty freaking simple. There’s a negative — it ain’t free. The cost is nominal… $0.004/lookup. That means that $10 will get you 2500 lookups.

Before you get all crazy on me — yes, there is a free “hobbyist” version. I think it’s worthless, since all the cellphones I tried returned the cidnam value of “currently unavailable for Hobbyist Tier users.”

I digress.

I chose Perl to integrate opencnam into my Asterisk dialplan. Why? Because I like Perl. Yes, I’ve heard of Python, and Lua, and Ruby, and when it comes down to it… I like Perl.

Here’s how I chose to integrate the lookup:

Asterisk Dialplan

exten => _X.,1,Verbose(3,Look an incoming call. Yay.)
exten => _X.,n,AGI(get-opencnam.pl,${CALLERID(num):-10})
exten => _X.,n,Verbose(3,result: ${OPENCNAM})