Here is some of my spam filtering logic. For each filtered DID, there is a little custom dialplan in extensions_custom.conf :
;Stewreno
[custom-stewreno]
exten => s,1,NoOp(CID:${CALLERID(num)})
exten => s,n,GotoIf(${DB_EXISTS(cidname/${CALLERID(num)})}?wl)
exten => s,n,Set(CDR(userfield)=F)
exten => s,n,Goto(ivr-4,s,1)
exten => s,n(wl),Set(CDR(userfield)=W)
exten => s,n,Set(CALLERID(name)=${DB(cidname/${CALLERID(num)})})
exten => s,n,Goto(from-did-direct,1001,1)
[custom-stewreno-pass]
exten => s,1,Set(CDR(userfield)=P)
exten => s,n,Goto(from-did-direct,1001,1)
The Inbound Route for my Reno DID goes to a Custom Destination that points to custom-stewreno.
If the number is not in the phonebook, the CDR is (tentatively) marked F (fail) and control is transferred to an IVR specific to each filtered DID. If it is in the phonebook, the CDR is marked W (whitelisted) and control is transferred to extension 1001.
The ‘success’ destination of the IVR is custom-stewreno-pass, which marks the CDR P (pass) and goes to ring the extension.
The ‘failure’ destination of the IVR (invalid or no key entered) goes to custom code (not shown and not applicable to Australia) that queries a reputation service to decide between voicemail or just hanging up.
Automatic additions to the phonebook are done outside of FreePBX by a script that queries various sources for a name to associate with the number. I chose this method so problems with the process would not cause calls to fail or be delayed.
If you are interested in switching from NodePhone to a service with ANI (unmasking blocked numbers), I have accounts with AnveoDirect and Voxbeam. (Prices below are in US dollars.)
AnveoDirect rates are pretty good; AU DID $3 setup + $1.50/month + $0.004/minute; Outbound to AU landline $0.008/min.; AU mobile $0.026/min. They offer a small credit at signup so you can make a few test calls without a payment. Unfortunately, the porting fee for AU is obscenely high at $110 (!) so it would only be practical if you didn’t need to keep your number, or if you just use them for outbound and/or an additional number.
Voxbeam charges $4 setup + $4/mo. for an AU DID, with no charge for incoming calls (there are some limits but a home user would be very unlikely to hit them). Outbound prices vary with destination but are less than $0.01/min. (landline) and $0.02/min. (mobile). They also offer a small test credit. Unfortunately, porting fees are not posted on their site; email them at [email protected] .
Both of the above services use IP authentication so you need a static or de facto static IP address. If neither is suitable, you can probably find an Australian company that will do better, though I don’t know how to search for one that offers ANI.