whitepages cid lookup US only
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15018 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
094bd97456
commit
978c6bdebe
|
@ -0,0 +1,26 @@
|
||||||
|
#!/usr/bin/perl
|
||||||
|
#
|
||||||
|
# see http://developer.whitepages.com/ for details
|
||||||
|
#
|
||||||
|
|
||||||
|
use Data::Dumper;
|
||||||
|
use Net::WhitePages;
|
||||||
|
use CGI qw/:standard/;
|
||||||
|
|
||||||
|
my $wp = Net::WhitePages->new(TOKEN => "API_TOKEN");
|
||||||
|
|
||||||
|
|
||||||
|
$caller_id = param('caller_id');
|
||||||
|
|
||||||
|
print header("text/plain");
|
||||||
|
my $res = $wp->reverse_phone(phone => $caller_id);
|
||||||
|
foreach $entry (@{$res->{listings}}) {
|
||||||
|
if($entry->{business}) {
|
||||||
|
print uc("$entry->{business}->{businessname}");
|
||||||
|
} elsif ($entry->{displayname}) {
|
||||||
|
print uc("$entry->{displayname}");
|
||||||
|
} else {
|
||||||
|
print uc("$entry->{address}->{city}, $entry->{address}->{state}");
|
||||||
|
}
|
||||||
|
last;
|
||||||
|
};
|
Loading…
Reference in New Issue