Anonymous Call Rejection + How?

How do I set up anonymous call rejection? Link me to any step by step instructions or write some here please.

I’d really appreciate it and can pay a little money too!


The one way you could do this is to check the value of the variable CALLERID(NUM). So if CALLERID(NUM) is blank or empty then it is anonymous call.

exten => _X.,1,GotoIf($[${CALLERID(NUM)} = “”] ? 10)

exten => _X.,10,NoOp(Blocking Anonymous Call)
exten => _X.,11,Hangup()

There area also builtin Applications that something like this. On cli do
’show application PrivacyManager’

Thanks - I understand what you are saying; however, I’m new to Asterisk and I don’t know where I would put those scripts or even how to run them.

Is there anyway you can be more specific?

If you’re that new, I’d recommend using trixbox, not rolling your own. It already has all that built in (ACR and such…)

Yeah I’m using TrixBox - how do I add it in there?

Under “Inbound Routes”, you can click “Privacy Manager”. Note: this is less than 100% useful, since a lot of telemarketers make calls with CID name of anonymous, unavailable, etc… And privacy manager only blocks calls if there is NO CID at all. What I ended up doing was to send the inbound DID to a custom app (custom-voipstreet), and then, in extensions_custom.conf, I do this:

exten => s,1,Macro(fixup-cid)

exten => s,1,Answer
exten => s,n,AGI(fixup-cidname)
exten => s,n,NoOp(${CALLERID(all)})
exten => s,n,Zapateller(nocallerid)
exten => s,n(pm_fail),PrivacyManager
exten => s,n,Goto(timeconditions,1,1)
exten => s,pm_fail+101,Congestion

And the AGI script, fixup-cidname is this:

#!/usr/bin/php -q

<?php // // This script makes sure that the callerid name is in all // uppercase format. We do this because the telco can present // various strings as 'anonymous', 'unknown', etc with various // combinationf of lower case, upper case, or first letter uppercase define("AGIBIN_DIR", "/var/lib/asterisk/agi-bin"); include(AGIBIN_DIR."/phpagi.php"); $agi = new AGI(); $r = $agi->get_variable("CALLERID(name)"); if ($r["result"] == 0) { exit(1); } $cidname = $r["data"]; $cidname = strtoupper($cidname); switch($cidname) { case "ANONYMOUS": case "UNAVAILABLE": case "UNKNOWN": case "RESTRICTED": case "OUT OF AREA": $agi->set_variable("CALLERID(all)", ""); break; default: break; } If any of the bogus values is present, we nuke the cid info, which will result in zapateller playing the disconnected tone and privacy manager asking them for their real number. The main point here is zapateller, since that tone will usually cause the telemarketer's computer dialer to disconnect then and there (and your phone won't ever ring.)

Do you have AIM or a method of contact so I can ask you some questions about it?