One thing I did was change when whocalled.us would flag a number as spam, that not only would it change the name to '=S=' but it would also append the name that who called us would supply. I found this very useful. For example:
http://pbx/callerid.php?thenumber=4144625902
Would return: =S=Warranty Solutions
Hi fellas,
I'm using v.1.1.1 from here But I'm still getting "," with whitepages checked, but I get the city and state if I remove whitepages. What am I doing wrong?
Also what should the threshold be for spam?
I am using the Orgasmatron II Everex version ... installed via the .iso downloads.
PIAF 1.3
(see my signature).
<?php
/*** Original script by Nerd Vittles. (Google for Caller Id Trifecta)
whitepages.ca "Submitted by taiter on Mon, 03/12/2007 - 9:55pm"
M Joyner updated the whitepages.ca to account for apparent changes
they have made over time. (2008-06-22-18-20) mjoyner _at_ vbservices *dot* net
***/
$thenumber=$_REQUEST['thenumber'];
if (strlen($thenumber)<>10) :
exit ;
endif;
// Setting the variables below to 1 activates each of the respective searches.
// The phonebook searches are executed in the order shown.
// When a match is bound during a search, the callerid script ends with that result.
// E.g. if there is a match in AsteriDex, then the Google and AnyWho searches aren't executed.
$AsteriDex = '1' ;
$Google = '1' ;
$AnyWho = '1' ;
$WhitePagesCAD = '1';
// ---------- Don't fiddle around below this line --------------------
$value="" ;
if ($AsteriDex=='1') :
$link = mysql_connect("localhost", "root", "passw0rd")
or die("AsteriDex connection failed");
mysql_select_db("asteridex")
or die("AsteriDex data base open failed");
$query = "SELECT * FROM `user1` where `out` LIKE '$thenumber'";
$result = mysql_query($query)
or die("AsteriDex query failed");
if (mysql_num_rows($result)>0) :
$row = mysql_fetch_array($result);
$value=$row["name"];
// else :
// $query = "SELECT * FROM user1 where id>0";
// $result = mysql_query($query)
// or die("AsteriDex query failed");
// $row = mysql_fetch_array($result);
// $value=$row["name"];
// $value="";
endif ;
mysql_close($link);
if (strlen($value)>0) :
echo $value;
exit ;
endif ;
endif ;
if ($Google=='1') :
$fd = fopen("[URL]http://www.google.com/search?rls=en&q=phonebook:$thenumber&ie=UTF-8&oe=UTF-8[/URL]", "r"); // can change to "rb", on NT/2000 servers, if problems.
if (!$fd) {
echo "Google Error";
exit;
}
$value = "";
while(!feof($fd)){
$value .= fread($fd, 4096);
}
fclose($fd);
$start= strpos($value, "Phonebook</b>");
$value = substr($value,$start+13);
$start=strpos($value, "<tr bgcolor=#e5ecf9><td>");
$value = substr($value,$start+24);
$end=strpos($value, "<td>(");
$value = substr($value,0,$end);
if (strlen($value)>1) :
echo $value;
exit ;
endif;
endif ;
if ($AnyWho=='1') :
$npa=substr($thenumber,0,3);
$telephone=substr($thenumber,3,7);
$fd = fopen("[URL]http://www.anywho.com/qry/wp_rl?npa=$npa&telephone=$telephone[/URL]", "r"); // can change to "rb", on NT/2000 servers, if problems.
if (!$fd) {
echo "AnyWho Error";
exit;
}
$value = "";
while(!feof($fd)){
$value .= fread($fd, 4096);
}
fclose($fd);
$start= strpos($value, "Reverse Telephone Listings</B>");
$value = substr($value,$start+30);
$start=strpos($value, "<B>");
$value = substr($value,$start+3);
$end=strpos($value, "</B>");
$value = substr($value,0,$end);
if ($value=="You searched for:") :
$value="";
endif;
if (strlen($value)>1) :
echo $value;
exit ;
endif;
endif ;
if ($WhitePagesCAD=='1') :
$fd = fopen("[URL]http://www.whitepages.com/search/ReversePhone?full_phone=$thenumber[/URL]", "r");
if (!$fd) {
echo "Whitepages.com Error";
exit;
}
$value = "";
while(!feof($fd)){
$value .= fread($fd, 32768);
}
fclose($fd);
$notfound = strpos($value, "PHONE_USER_ERROR");
$patternFirst = "/FIRST.*?\"(.*?)\",/";
$patternLast = "/LAST.*?\"(.*?)\",/";
$patternCity = "/CITY.*?\"(.*?)\",/";
$patternState = "/STATE.*?\"(.*?)\",/";
$patternType = "/Type: *(.*?)<\/span>/";
preg_match($patternFirst, $value, $first);
preg_match($patternLast, $value, $last);
$name = $first[1]." ".$last[1];
if ($name==" "):
preg_match($patternCity, $value, $city);
preg_match($patternState, $value, $state);
preg_match($patternType, $value, $type);
$name = $city[1].", ".$state[1]." ".$type[1];
endif;
if ($notfound):
$name="";
endif;
if (strlen($name)>1) :
echo $name;
exit ;
endif;
endif ;
$value=$thenumber;
echo $value;
exit ;
?>
Can I uninstall it and install yours ?
Is it OK I am only on 1.3 ?
I am having a real hard time keeping my mouth shut - I'm so excited about the next update to the Caller ID Superfecta Module.
-tshif
if ($WhitePagesCAD=='1' && $TFnpa=='0' && $validnpa=='1') :
if ($debug=='1') :
echo "<br />WhitePagesCAD lookup ....", "\n" ;
endif ;
$url = "http://www.whitepages.com/search/ReversePhone?full_phone=$thenumber";
$value = UrlGetContentsCurl($url, $timeout, $debug);
if ($value) :
$notfound = strpos($value, "PHONE_USER_ERROR");
$patternFirst = "/FIRST.*?\"(.*?)\",/";
$patternLast = "/LAST.*?\"(.*?)\",/";
$patternCity = "/CITY.*?\"(.*?)\",/";
$patternState = "/STATE.*?\"(.*?)\",/";
$patternType = "/Type: *(.*?)<\/span>/";
// added/modified by MageMinds
$patternCie = "/Company: <\/strong><span class=\"org\">(.*?)<\/span>/";
preg_match($patternCie, $value, $cie);
$name = $cie[1];
if ($name==""):
preg_match($patternFirst, $value, $first);
preg_match($patternLast, $value, $last);
$name = $first[1]." ".$last[1];
endif;
// end of MageMinds addition/modification
if (trim($name)==""):
preg_match($patternCity, $value, $city);
preg_match($patternState, $value, $state);
preg_match($patternType, $value, $type);
// $type = str_replace( "<strong>", "", $type );
// $type = str_replace( "</strong>", "", $type );
$name = $city[1].", ".$state[1]." ".$type[1];
endif;
if ($notfound):
$name="";
endif;
if (strlen($name)>1) :
echo strip_tags($name);
if ($debug<>'1') :
exit ;
endif;
endif;
endif ;
endif ;
Link up your team and customers Phone System Live Chat Video Conferencing
Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.
Check your inbox!
We’ve sent you an email. Click on the button in the email body to verify your email address – (if you can not find it, check your spam folder).
Upon verification you will be directed to the 3CX setup wizard.