[Asterisk-Users] calleridname.agi patch to only overwrite name if it is missing

BerkHolz, Steven StevenBerkHolz at TESCOGroup.com
Tue Jun 13 12:02:41 MST 2006


 
 I edited the calleridname.agi patch to only overwrite the name if it is
missing.
The asteridex option still overwrites the name since it is our master
list for known numbers.

-- 

Steven


calleridname.agi.patch:
--- C:\Documents and Settings\steveb\Desktop\calleridname.agi-orig Tue
Jun 13 14:37:09 2006
+++ C:\Documents and Settings\steveb\Desktop\calleridname.agi Tue Jun 13
14:37:09 2006
@@ -16,6 +16,7 @@

 my $callerid = $input{'calleridnum'};
 my $calleridfull = $input{'callerid'};
+my $calleridname = $input{'calleridname'};

 if($callerid eq ''){
 $callerid=$input{'callerid'};
@@ -31,7 +32,8 @@

 $calleridfull =~ s/[\,\"\']+/ /g;

-$AGI->verbose("CALLERID IS: $calleridfull\n");
+$AGI->verbose("CALLERID IS: $calleridfull\n");
+$AGI->verbose("CALLERID Name IS: $calleridname\n");

 if ($callerid =~ /^(\d{3})(\d{3})(\d{4})$/) {
 $npa = $1;
@@ -54,7 +56,7 @@
 #$nxx='892';
 #$station='8019';

-if ($Fonetastic > '0') {
+if (($Fonetastic > '0') && ($calleridname != 'unknown')){
 $AGI->verbose("Ready for Fonetastic.US lookup... \n");
 if ($name = &fonetastic_lookup ($npa, $nxx)) {
  $newcallerid = "\"$name <$npa$nxx$station>\"";
@@ -68,7 +70,7 @@
 $AGI->verbose("Fonetastic.US lookup disabled.");
 }

-if ($AnyWho > '0') {
+if (($AnyWho > '0') && ($calleridname != 'unknown')){
 $AGI->verbose("Ready for AnyWho lookup... \n");
 if ($name = &anywho_lookup ($npa, $nxx, $station)) {
 $newcallerid = "\"$name <$npa$nxx$station>\"";
@@ -82,7 +84,7 @@
 $AGI->verbose("AnyWho lookup disabled.");
 }

-if ($Google > '0') {
+if (($Google > '0') && ($calleridname != 'unknown')){
 $AGI->verbose("Ready for Google lookup... \n");
 if ($name = &google_lookup ($npa, $nxx, $station)) {
 $newcallerid = "\"$name <$npa$nxx$station>\""; 





More information about the asterisk-users mailing list