Robo Call Filter

I posted on this forum a few times looking for configuration help with Asterisk running on a pi 4 and HT813. After some effort I was able to make everything work. What I have is a system that filters virtually all robo calls. Previously, incoming robo calls would either be answered (go away!) or go to voice mail (mostly empty) which would then send an email to me. In the latter case I’d have to delete the email as well as the voice mail. I just got tired of the constant spam calls throughout the day.

I have one incoming FXO line connected to several phones on FXS. What I developed allows any FXS to capture the FXO in order to make outgoing calls. On the inbound side, Asterisk grabs the call after CID and compares either the number or name to a whitelist.

If the CID is on the whitelist, the call is immediately put through to FXS where it will ring up to 4 times. If no answer, Asterisk plays a message and records a voicemail. If a voicemail is recorded, it is emailed to me.

If the CID is not on the whitelist, Asterisk immediately picks up (without bridging to FXS, so no phone ringing) and plays a message saying press any button. Robo calls are blocked because by the time they detect pickup and connect to a spam person, the message is over. If a button isn’t pressed within 2 seconds, Asterisk hangs up.

Whitelist numbers are exact to the last 10 digits, but names can be partial. So whitelist of “dave” would also allow “dave you”, “dave me”, “dave anybody”. In this case, whitelisting the number would be best. But for something like “doctor” or a unique doctor’s name that you wouldn’t want to miss, name filtering might be best.

I also have Asterisk log every call CID, whether the caller is whitelisted, and whether a button has been pushed. This is emailed to me every morning so I can see if I missed something important.

I haven’t implemented blacklisting since I expect unwanted calls are going to be at or near zero. But this would also be possible.

I am willing to delete the personal info and zip this up for anyone who wants to attempt this on their own.

Though I am a technical person, I am a complete novice with Asterisk and the HT813. Advice here and other sites, plus a lot of help from ChatGPT, has gotten me to my solution. But, YMMV.

Regards,

Dave