");
$value = substr($value,$start+24);
$end=strpos($value, " | (");
$value = substr($value,0,$end);
if (strlen($value)>1):
echo $value.' ['.$thename.']';
system('/usr/sbin/calleridfix.sh '.$thenumber.' "'.$value.'">/dev/null ');
exit;
endif;
endif;
endif;
if ($AnyWho=='1'):
$npa=substr($thenumber,0,3);
$telephone=substr($thenumber,3,7);
$fd = fopen("http://www.anywho.com/qry/wp_rl?npa=$npa&telephone=$telephone", "r"); // can change to "rb", on NT/2000 servers, if problems.
if (!$fd):
echo "AnyWho Error";
else:
$value = "";
while(!feof($fd)){
$value .= fread($fd, 4096);
}
fclose($fd);
$start= strpos($value, "Reverse Telephone Listings");
$value = substr($value,$start+30);
$start=strpos($value, "");
$value = substr($value,$start+3);
$end=strpos($value, "");
$value = substr($value,0,$end);
if ($value=="You searched for:"):
$value="";
endif;
if (strlen($value)>1):
echo $value.' ['.$thename.']';
system('/usr/sbin/calleridfix.sh '.$thenumber.' "'.$value.'">/dev/null ');
exit;
endif;
endif;
endif;
endif;
// Not found - enter into database any Bell provided info
if (strlen($thename)>1):
system('/usr/sbin/calleridfix.sh '.$thenumber.' "'.$thename.'">/dev/null ');
endif;
// not found so find city/prov(state) of npa
if (strlen($valueCity)>2):
echo '['.$thename.']'.$valueCity.", ".$Country;
exit;
endif;
$value="Unk";
echo $value.' ['.$thename.']';
exit;
?>
lookupcid/extensions_custom.conf 0000644 0000000 0000000 00000011511 10770711660 016211 0 ustar root root ; This file contains example extensions_custom.conf entries.
; extensions_custom.conf should be used to include customizations
; to AMP's Asterisk dialplan.
; All custom context should contain the string 'custom' in it's name
; Extensions in AMP have access to the 'from-internal' context.
; The context 'from-internal-custom' is included in 'from-internal' by default
#include extensions_trixbox.conf
#include extensions_hud.conf
[from-internal-custom]
[ext-local-custom]
include => ext-group
#include extensions_custom_extra.conf
; house based calls
exten => 600,1,NoOp("********* Start incoming house call ***************
; drop calls to junk status if not standard dial plan
exten => 600,n,GotoIf($[${LEN(${CALLERID(num)})}<10]?deadbox)
; drop callerid leading 1 if applicable
exten => 600,n,GotoIf($[${LEN(${CALLERID(num)})}<11]?start)
exten => 600,n,GotoIf($[${LEN(${CALLERID(num)})}>11]?start)
exten => 600,n,Set(CALLERID(num)=${CALLERID(num):1})
; Blacklist check
exten => 600,n,Gosub(app-blacklist-check,s,1)
; check callerid info against various databases
exten => 600,n(start),NoOp("*************Pre Lookup CID Info*********")
exten => 600,n,NoOp("${CALLERID(num)})
exten => 600,n,NoOp("${CALLERID(name)})
exten => 600,n,Gosub(cidlookup,cidlookup_1,1)
exten => 600,n,NoOp("Post Lookup CID Info")
exten => 600,n,NoOp("${CALLERID(num)})
exten => 600,n,NoOp("${CALLERID(name)})
exten => 600,n,NoOp("*****************************************")
; check incoming home calls for routing via Asteridex...if listed, route accordingly
exten => 600,n,NoOp("Dave Friends")
exten => 600,n,Set(Parm="D:")
exten => 600,n,GotoIf($["${CALLERID(name):0:${LEN(${Parm})}}" = "${Parm}" ]?davefriend)
exten => 600,n,NoOp("Blocked CallerID")
exten => 600,n,Set(Parm="[]")
exten => 600,n,GotoIf($["${CALLERID(name):0:${LEN(${Parm})}}" = "${Parm}" ]?likelydeadbox)
exten => 600,n,GotoIf($["${CALLERID(name):1:${LEN(${Parm})}}" = "${Parm}" ]?likelydeadbox)
exten => 600,n,NoOp("Bogus Telemarketing")
exten => 600,n,Set(Parm="ONTARIO)
exten => 600,n,GotoIf($["${CALLERID(name):0:${LEN(${Parm})}}" = "${Parm}" ]?likelydeadbox)
exten => 600,n,GotoIf($["${CALLERID(name):1:${LEN(${Parm})}}" = "${Parm}" ]?likelydeadbox)
exten => 600,n,NoOp("800 Notes Error - likely something dead")
exten => 600,n,Set(Parm="800")
exten => 600,n,GotoIf($["${CALLERID(name):0:${LEN(${Parm})}}" = "${Parm}" ]?likelydeadbox)
exten => 600,n,GotoIf($["${CALLERID(name):1:${LEN(${Parm})}}" = "${Parm}" ]?likelydeadbox)
exten => 600,n,NoOp("Collection")
exten => 600,n,Set(Parm="Coll")
exten => 600,n,GotoIf($["${CALLERID(name):0:${LEN(${Parm})}}" = "${Parm}" ]?likelydeadbox)
exten => 600,n,GotoIf($["${CALLERID(name):1:${LEN(${Parm})}}" = "${Parm}" ]?likelydeadbox)
exten => 600,n,NoOp("Telemarker/Telephone Survey")
exten => 600,n,Set(Parm="Tele")
exten => 600,n,GotoIf($["${CALLERID(name):0:${LEN(${Parm})}}" = "${Parm}" ]?deadbox)
exten => 600,n,GotoIf($["${CALLERID(name):1:${LEN(${Parm})}}" = "${Parm}" ]?deadbox)
exten => 600,n,NoOp("Charity")
exten => 600,n,Set(Parm="Char")
exten => 600,n,GotoIf($["${CALLERID(name):0:${LEN(${Parm})}}" = "${Parm}" ]?deadbox)
exten => 600,n,GotoIf($["${CALLERID(name):1:${LEN(${Parm})}}" = "${Parm}" ]?deadbox)
exten => 600,n,Set(Parm="Non-Profit")
exten => 600,n,GotoIf($["${CALLERID(name):0:${LEN(${Parm})}}" = "${Parm}" ]?deadbox)
exten => 600,n,GotoIf($["${CALLERID(name):1:${LEN(${Parm})}}" = "${Parm}" ]?deadbox)
exten => 600,n,NoOp("Complaint")
exten => 600,n,Set(Parm="Complaint")
exten => 600,n,GotoIf($["${CALLERID(name):0:${LEN(${Parm})}}" = "${Parm}" ]?likelydeadbox)
exten => 600,n,GotoIf($["${CALLERID(name):1:${LEN(${Parm})}}" = "${Parm}" ]?likelydeadbox)
exten => 600,n,NoOp("Commercial")
exten => 600,n,Set(Parm="Commercial")
exten => 600,n,GotoIf($["${CALLERID(name):0:${LEN(${Parm})}}" = "${Parm}" ]?likelydeadbox)
exten => 600,n,GotoIf($["${CALLERID(name):1:${LEN(${Parm})}}" = "${Parm}" ]?likelydeadbox)
exten => 600,n,NoOp("No Match")
; checking incoming home calls for 800,866,877,888 and dump to deadbox
exten => 600,n,GotoIf($["${CALLERID(num):0:3}" = "800"]?likelydeadbox)
exten => 600,n,GotoIf($["${CALLERID(num):0:3}" = "866"]?likelydeadbox)
exten => 600,n,GotoIf($["${CALLERID(num):0:3}" = "877"]?likelydeadbox)
exten => 600,n,GotoIf($["${CALLERID(num):0:3}" = "888"]?likelydeadbox)
exten => 600,n,GotoIf($["${CALLERID(num):0:3}" = "900"]?deadbox)
exten => 600,n,GotoIf($["${CALLERID(num):0:1}" = "P"]?likelydeadbox)
exten => 600,n,GotoIf($["${CALLERID(num):0:1}" = "O"]?likelydeadbox)
; pass call normally
exten => 600,n(notblacklisted),Goto(ext-group,601,1)
exten => 600,n,Hangup
; dave friends handling
exten => 600,n(davefriend),Goto(ext-group,599,1)
exten => 600,n,Hangup
; likelydeadbox handling
exten => 600,n(likelydeadbox),Goto(ext-group,699,1)
exten => 600,n,Hangup
; deadbox handling
exten => 600,n(deadbox),Macro(exten-vm,609,609)
exten => 600,n,Hangup
|