print's archive
CNAM (CallerID with Name) on Asterisk using Reverse Phone number lookup
CallerID is cool, but CallerID with Name (CNAM), — also known as Calling NAMe — is where it’s at.
When you go with a traditional phone provider (non-VoIP) they’ll often offer you CallerID with Name for an additional fee. But penny-pinching Asterisk & VoIP fans want CallerID with Name too. Unfortunately, too often the SIP trunks or traditional PSTN trunks (analog, T1/E1) connected to your Asterisk IP-PBX don’t provide CallerID with Name - just regular CallerID (number only). So how do we solve this dilemma?
Well, Asterisk sits on an IP network, which of course means it can access the Internet. With access to the Internet, “in theory” a special Asterisk script can take the CallerID number, perform a reverse lookup on AnyWho, Google, and 411.com and then change the CallerID data string before it gets passed to the Asterisk extension.
Well, theory is all well and good, but has it been done? Oh yes it has!
Check out this Perl script I found on Team Forrest’s website that leverages AGI (Asterisk Gateway Interface), a powerful interface that lets your programmatically control Asterisk.
Calling the CallerID with Name Perl script (calleridname.pl) is as simple as calling this single line of code:
exten => s,n(getname),AGI(calleridname.pl,${CALLERID(NUM)})
Here’s the calleridname.pl script:
#!/usr/bin/perl -w
use strict;
use LWP::UserAgent;
$|=1;
sub trim($);
my %AGI; my $tests = 0; my $fail = 0; my $pass = 0; my $result = “”; my $cidnum = “”; my $cidname = “”;
my $npa = “”; my $nxx = “”; my $station = “”; my $name = “”;
$cidnum = $ARGV[0];
while(<STDIN>) {
chomp;
last unless length($_);
if (/^agi_(\w+)\:\s+(.*)$/) {
$AGI{$1} = $2;
}
}
my $AnyWho = ‘1′ ;
my $Google = ‘1′ ;
my $www411 = ‘1′ ;
if(substr($cidnum,0,1) eq ‘1′){
$cidnum=substr($cidnum,1);
}
if(substr($cidnum,0,2) eq ‘+1′){
$cidnum=substr($cidnum,2);
}
if ($cidnum =~ /^(\d{3})(\d{3})(\d{4})$/) {
$npa = $1;
$nxx = $2;
$station = $3;
}
elsif($cidnum =~/\<(\d{3})(\d{3})(\d{4})\>/){
$npa = $1;
$nxx = $2;
$station = $3;
}
else {
print qq(VERBOSE “ERROR: unable to parse caller id” 2\n);
exit(0);
}
if ($AnyWho > ‘0′) {
print qq(VERBOSE “STATUS: checking AnyWho for name lookup” 2\n);
if ($name = &anywho_lookup ($npa, $nxx, $station)) {
$cidname = $name;
print qq(SET VARIABLE CALLERID\(name\) “$cidname”\n);
print qq(VERBOSE “STATUS: AnyWho said name was $cidname ” 2\n);
exit(0);
}
else {
print qq(VERBOSE “STATUS: unable to find name with AnyWho” 2\n);
}
}
else {
print qq(VERBOSE “STATUS: AnyWho lookup disabled” 2\n);
}
if ($Google > ‘0′) {
print qq(VERBOSE “STATUS: checking Google for name lookup” 2\n);
if ($name = &google_lookup ($npa, $nxx, $station)) {
$cidname = $name;
print qq(SET VARIABLE CALLERID\(name\) “$cidname”\n);
print qq(VERBOSE “STATUS: Google said name was $cidname ” 2\n);
exit(0);
}
else {
print qq(VERBOSE “STATUS: unable to find name with Google” 2\n);
}
}
else {
print qq(VERBOSE “STATUS: Google lookup disabled” 2\n);
}
if ($www411 > ‘0′) {
print qq(VERBOSE “STATUS: checking www411 for name lookup” 2\n);
if ($name = &www411_lookup ($npa, $nxx, $station)) {
$cidname = $name;
print qq(SET VARIABLE CALLERID\(name\) “$cidname”\n);
print qq(VERBOSE “STATUS: www411 said name was $cidname ” 2\n);
exit(0);
}
else {
print qq(VERBOSE “STATUS: unable to find name with www411″ 2\n);
}
}
else {
print qq(VERBOSE “STATUS: www411 lookup disabled” 2\n);
}
print qq(SET VARIABLE CALLERID\(name\) “$cidnum”\n);
print qq(VERBOSE “STATUS: Unknown name for $cidnum ” 2\n);
exit(0);
sub anywho_lookup {
my ($npa, $nxx, $station) = @_;
my $ua = LWP::UserAgent->new( timeout => 45);
my $URL = ‘http://www.anywho.com/qry/wp_rl’;
$URL .= ‘?npa=’ . $npa . ‘&telephone=’ . $nxx . $station;
$ua->agent(’AsteriskAGIQuery/1′);
my $req = new HTTP::Request GET => $URL;
my $res = $ua->request($req);
if ($res->is_success()) {
if ($res->content =~ /<!– listing –>(.*)<!– \/listing –>/s) {
my $listing = $1;
if ($listing =~ /<B>(.*)<\/B>/) {
my $clidname = $1;
return $clidname;
}
}
}
return “”;
}
sub google_lookup {
my ($npa, $nxx, $station) = @_;
my $ua = LWP::UserAgent->new( timeout => 45);
my $URL = ‘http://www.google.com/search?rls=en&q=phonebook:’ . $npa . $nxx . $station . ‘&ie=UTF-8&oe=UTF-8′;
$ua->agent(’AsteriskAGIQuery/1′);
my $req = new HTTP::Request GET => $URL;
my $res = $ua->request($req);
if ($res->is_success()) {
if ($res->content =~ /<font size=-2><br><\/font><font size=-1>(.+)<font color=green>/) {
my $temp = $1;
my $clidname = “”;
if ( $temp =~ /(.+)<font color=green>/o ) {
$clidname = substr($1, 0, -3);
} else {
$clidname = substr($temp, 0, -3);
}
if ($clidname =~ /<a href(.+)\//) {
$clidname = $1 ;
if ($clidname =~ />(.+)</) {
$clidname = $1 ;
}
}
return $clidname;
}
}
return “”;
}
sub www411_lookup {
my ($npa, $nxx, $station) = @_;
my $ua = LWP::UserAgent->new( timeout => 45);
my $URL = ‘http://www.411.com/search/Reverse_Phone?phone=’ . $npa . $nxx . $station;
$ua->agent(’AsteriskAGIQuery/1′);
my $req = new HTTP::Request GET => $URL;
my $res = $ua->request($req);
if ($res->is_success()) {
if ($res->content =~ /Location: <strong>(.*)<\/strong>/s) {
my $temp = $1;
my $clidname = “”;
$temp =~ s/&\;/&/g;
$temp =~ s/%20/ /g;
$clidname = $temp;
return $clidname;
}
}
return “”;
}
For more details, head on over here.
Tags: AGI, asterisk, CallerID, CNAM, perl, reverse phone number lookup
- Related Entries
- Private Caller Hack - Jun 01, 2007
- VONaLink softphone uses SIP to capture CallerID - Nov 15, 2006
- trixbox CE vs. Asterisk Downloads - Dec 23, 2008

- TMC & Digium Announce Educational program for Digium|Asterisk World - Dec 15, 2008

- Fonality Launches PBXtra Unified Agent on Salesforce.com’s Force.com AppExchange - Dec 09, 2008

- Digium Responds to FBI Vhishing Security Warning about Asterisk - Dec 09, 2008

- Asterisk-based VPN in a Flash Mobile Telephony Appliance - Dec 08, 2008

- Sangoma Launches B600 Series of Analog Voice Cards - Dec 04, 2008

- PIKA WARP Appliance Adds FreePBX Support - Nov 18, 2008

- Bandwidth.com invests in FreePBX - Nov 14, 2008

TrackBacks
| Comments | Tag with del.icio.us | VoIP & Gadgets Blog Home | Permalink: CNAM (CallerID with Name) on Asterisk using Reverse Phone number lookup
Copyright VoIP & Gadgets Blog
PC Magazine Stops the Presses - Online Only
I grew up reading PC Magazine and I looked forward each couple weeks to picking up my copy of PC Magazine at the local grocery store. But today, Ziff Davis has announced that the legendary PC Magazine print publication is shutting down its print publication and focusing exclusively on online content. This is truly a sad day…
Hold on while I grab some tissues…
PC Magazine started the whole in-depth comparative reviews of PCs and Microsoft software. They expanded later to including gadgets, MP3 players, mobile phones, GPS, and other technology. PC Magazine offered insightful tech tips and great columnists like John C. Dvorak. Back in the 80s and 90s the print publication was 400-500 pages, making for hours of tech- reading pleasure. Today, it’s down to 150 pages and soon to be 0 (January 2009).
Well, I guess it’s “greener” that way. But I for one will miss my print copy of PC Magazine.
Tags: John C. Dvorak, PC Magazine
- Related Entries
- Moto Goes Soy for Cell? -
Nov 22, 2006 - How About a Mobile Phone without the Keys? Read On … -
Aug 23, 2006 - Apple Delays; Too Much Secrecy? -
Jun 29, 2006 - The Robot Hall of Fame -
Jul 12, 2006 - Robot Dog: New Fido on Its Way! -
May 04, 2006 - Back from the Gloom: V Chip Resurrection -
Mar 08, 2006 - A Really Useful Digital Camera Evaluation Guide -
Mar 01, 2006 - Nintendo DS Adds Web & TV? -
Feb 16, 2006
TrackBacks
| Comments | Tag with del.icio.us | VoIP & Gadgets Blog Home | Permalink: PC Magazine Stops the Presses - Online Only
Copyright VoIP & Gadgets Blog
TMC Launches NGN (Next Generation Networks) Magazine
Today, TMC announced the launch of NGN Magazine focused on next generation networks and how service providers and carriers can build these networks and what they will need to know to maximize savings and ARPU (average revenue per user).
“We’re in an interesting time,” says TMC President and Group Publisher, Rich Tehrani. No, he’s not referring to the American political scene or the chaotic American economy. Rich is referring to Next Generation Networks, which Rich believes will be critical to the future of service providers and carriers. Certainly, in these tough economic times, squeezing the most efficiency and most value-add services is critical. Verizon is probably the best example of that. They’ve been investing billions in their fiber-based FiOS service which supports high-speed Internet, voice, and TV/video/HDTV. They are no doubt also looking to tie in their considerable wireless/cellular network with their FiOS network to offer customers a competitive advantage over competing solutions.
In his video interview with TMCnet Group Managing Editor Erik Linask, Rich discusses NGN Magazine. [click to visit video link]
The topics TMC’s NGN magazine will address, some of which Rich mentions in the video interview:
» How do you deploy new services and applications ?
» What technology should you consider ?
» How do you integrate new technologies with legacy elements?
Erik points out that a lot of publishing companies have been cutting down on staff and even folding print publications. Rich addresses this point by pointing out that 2-3 million executives visit tmcnet.com to read the content digitally. He also discusses how TMC offers digital (PDF) versions of the print magazines which greatly reduces costs. Thousands of people subscribe to the digital PDF format.
While all facets of the economy seem to be slowing down, TMC continues to grow — not only launching a new magazine, but recently adding new telecom/wireless industry talent such as Carl Ford, Scott Kargman, and more. Newspapers may die, print magazines may fold, but good information and news will always be needed. And where there is a need for good information, people will pay for it. Publishing companies which are nimble enough to adjust to the trend towards online news dissemination will survive, while those that can’t will die.
Case in point is the NY Times, which must deliver $400 million to lenders in May of 2009 or face bankruptcy. But if you’re a New York Times fan, don’t worry. I’m sure President-elect Barrack Obama will add them to the $700+ billion bailout. Can’t have the NY Times go bankrupt, can we? Don’t answer that question…
Tags: ARPU, Erik Linask, networks, next generation networks, NGN Magazine, NY Times, Rich Tehrani, service providers, voip
- Related Entries
- AudioCodes enters IP Phone arena with 300HD Series -
Nov 05, 2008 - Internet Telephony Expo Preview -
Sep 10, 2008 - Interviews with Top 60 VoIP Movers and Shakers… -
Sep 05, 2008 - Skype Backdoor? -
Jul 25, 2008 - ITEXPO 90% Sold Out - IP Communications industry looks strong -
Jul 21, 2008 - Shoretel Rumors -
May 01, 2008 - VoIP Pioneer Slams Sprint -
Jan 25, 2008 - Rich Liveblogging Microsoft UC Launch -
Oct 16, 2007 - VoIP Tradeshow Testimonials -
Sep 26, 2007 - Another VoIP Provider Bites the Dust -
Sep 26, 2007
TrackBacks
| Comments | Tag with del.icio.us | VoIP & Gadgets Blog Home | Permalink: TMC Launches NGN (Next Generation Networks) Magazine
Copyright VoIP & Gadgets Blog
Dymo DiscPainter Review
Printing CD and DVD labels can be a chore. It often requires special labels and only certain printers can accept CD/DVD labels. Certainly burning CDs and DVDs has become more popular so users are looking for quick, easy, and fun ways to label and decorate their CD/DVD collections. I have an Epson printer at home that doesn’t print the size labels I need, so I resort to using a black Sharpie pen and hand scribbling on the CD or DVD. And when I had “scribbling” I mean scribbling!
I have the worst handwriting. One other problem with the various label stickers you can run though a printer, is you have to align them perfectly, they look cheap and they can gum up CD drives if the label starts to bubble or fray. Further, sticky labels are quick to print, but they take forever to peel off, and stick on (even with a stomper), and would often jam in the disc drive.
Well, to the DVD/CD labelling rescue comes the Dymo DiscPainter, a pint-sized printer that you simply stick in your CD or DVD media into the drive, use their software to add graphics & text, hit print, and the DiscPainter spins the DVD/CD as it prints. It’s pretty cool how it prints in a circular fashion starting from the inner ring outward. I found myself staring at the spinning media through the clear windows as it was being printed just to watch the image grow outwards. I guess I’m easily amused.
As it spins it prints an amazingly good 600dpi, a pretty decent resolution.
Below is a shot of the printer sitting on my desktop PC with two printed CDs. The one in the printer is one of my with my daughter Megan and the other is a promotional photo of the new Toy Story Mania! Disney World attraction. Now when you do go to Disney World and take some home videos you can burn the video to a DVD and have a pretty graphic printed on top - perhaps using one of the photos from the vacation trip itself.
The Discus for DYMO software was very easy to use. Adding graphics and text was a snap. Here’s a sample of me adding the Dark Knight poster image:
The software gives you fine control over the image, including the size, the rotation, and even the opacity. Essentially, you can also control the “opacity” of the image so that it fades into the background with the text more prominent. You can also draw freehand, add shapes, and more.
Here’s another sample showing the Toy Story Mania image:
The software lets you set the print quality (draft, normal, best) and the ink density (matte1 - matte5, glossy 6 & 7, and color 8 and color 9). Dymo’s DiscPainter CD/DVD software makes printing fun and easy. The DiscPainter includes a USB 2.0 cable, AC power supply, three inkjet printable discs, and a full-color ink cartridge.
Currently, the DiscPainter resolution is around 600dpi, and not 1200dpi as some reviews have reported. DYMO told me they are working on updated drivers and firmware so that the ‘Best’ print quality is even more crisp and clear. That will be available for people who want it probably by the end of summer (probably as a download online)
Dymo states that the DiscPainter’s ink cartridge is good for about 100-CDs. A full cartridge is included in the box, and spares are priced at $39.95 or basically $0.39 cents per print. Perhaps a wee-bit on the high side for ink, but it’s fair price to pay for have the coolest looking DVD/CD collection on the block! Just three printable CD-Rs are included (no DVD+R or DVD-RW) with the DiscPainter to get you started — but you can buy more inkjet-printable media online. Surprisingly printable discs aren’t that much more expensive than non-printable discs.
Pros:
- Small footprint and no accessories or trays to keep track of
- Easy to use software
- Very quiet
- Fast print speeds 1-2 ,minutes per CD/DVD
- Ink dries quickly (some printers require 24 hour long drying times.)
Cons:
- It’s only a 4 color system not 6
- Single cartridge system even for black, the most common color used. So if black runs out you throw out the entire cartridge.
- Bit pricey - $279 retail. Though it has come down in price. Amazon has it <a href=”http://www.amazon.com/Dymo-DiscPainter-Color-Printer-1738260/dp/B000OSLHFK%3FSubscriptionId%3D151BWK97V0S8BGYJ8F02%26tag%3Dtechstuff01-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB000OSLHFK” title=”Buy now at amazon.com-only !” onmouseover=”return overlib(’
Click for Amazon price:
Dymo DiscPainter CD/DVD Color Printer (1738260)
Buy Now‘, STICKY, TIMEOUT, 6000);” onmouseout=”return nd();”>listed for $249.88
Conclusion
Overall, I was very impressed with the Dymo DiscPainter. I liked its speed, easy-to-use software, and its small footprint - easily fitting on top of any computer. Users looking for near-professional looking CDs and DVDs will enjoy the results of this printer. Several online retails carry the Dymo DiscPainter, including Amazon, which <a href=”http://www.amazon.com/Dymo-DiscPainter-Color-Printer-1738260/dp/B000OSLHFK%3FSubscriptionId%3D151BWK97V0S8BGYJ8F02%26tag%3Dtechstuff01-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB000OSLHFK” title=”Buy now at amazon.com-only !” onmouseover=”return overlib(’Click for Amazon price:
Dymo DiscPainter CD/DVD Color Printer (1738260)
Buy Now‘, STICKY, TIMEOUT, 6000);” onmouseout=”return nd();”>currently lists the DiscPainter for $249.88
| Ratings | Score |
| Installation | |
| Price/Value | |
| Features | |
| Usability | |
| Performance | |
| Overall |
Tags: CD, DiscPainter, DVD, Dymo DiscPainter, label, printer, review
- Related Entries
- Blu-ray Buy 2 DVDs, Get 1 Free Promotion -
Jul 15, 2008 - Blu-ray in Your Plans? -
May 05, 2008 - Blu-ray DVD - Buy 2 Blu-ray DVDs Get 1 Free on Amazon -
Apr 09, 2008 - Sprint Novatel Wireless Ovation U727 Review -
Jan 11, 2008 - R2-D2 Home Theater System DLP projector -
Dec 11, 2007 - Philips VOIP841 Review -
Dec 11, 2007 - Logitech Quickcam Orbit AF Review -
Dec 04, 2007 - Star Trek Season One Boxed Set on HD DVD -
Nov 21, 2007 - Microsoft Response Point Review -
Nov 12, 2007 - SanDisk 4GB microSDHC card -
Feb 12, 2007
TrackBacks
| Comments | Tag with del.icio.us | VoIP & Gadgets Blog Home | Permalink: Dymo DiscPainter Review
Copyright VoIP & Gadgets Blog
Subscribes
Archives
-
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- November 1999
- January 1970
Sipy...
-
News, opinions and announcements about fast changing communication tools and technologies, from various blogs and ezine.

