Whitelisted answering machine

While I setup asterisk a few years back and the box worked well for a few years for a very small office setup, I’m definitely a newbie.

My current project is wanting to setup asterisk to be a glorified ‘smart’ answering machine at the grandparent’s home to cut back on the scam calls. He’s already been fooled once into giving banking info out and there’s too many fake callerIDs, or blocked callerID calling - targetting the elderly I assume.

My goal is to not have to rewire the home, the only central phone line location is the outside DMARK.

I would like Asterisk (With a wildcard 101P) to listen to an incoming call’s callerID, if it’s not whitelisted or in the same area code, pick up the line and go right to voicemail. Otherwise only pick up if the call keeps ringing - not picked up by another handset - for a minute or so. Looking through the docs, I have no idea if this is even possible. As this isn’t a normal setup with everything through the asterisk machine, I haven’t been successful in searching for an answer.

What sort of rulesets apply to listening for a callerID to decide if asterisk even ‘takes the call’? Any suggestions or places to look would be helpful.


Technically, you can save the “known good” phone numbers or area/exchange in the Asterisk database (dial-plan function DB(…) and command line “database put…”). The dial plan can check the database before deciding whether to GoTo the voice mail or ring an extension. Asterisk’s usual /var/log files can help you see the numbers that are calling, in case any more need to be added to the “ok” list.

A triage – “good”, “bad”, and “unknown” – might lend itself to better results than just a list of “known good” numbers.

You can save the grandparent from embarrassment by making the automated transfer to voicemail take as long as a plain ring-no-answer.

As an alternative to a direct shunt to voice mail for non “known good” numbers, a “press 1” rigmarole can separate humans from spam callers. Unfortunately, it might also cold-shoulder elderly friends, who cannot hear or understand well enough to deal with it.

If the grandparent has the patience to enjoy it, you can also add an IVR extension to toggle the “smart” answering machine on and off. Plumbers whose offices call to “verify” you’re at home for the scheduled appointment to fix a busted pipe do not always bother to leave a message; they assume no one is home and skip the appointment. Times like those, it might be worth the gamble to let all calls through.

If the house has two-line phones with a clear indicator, you can have Asterisk send “known good” calls to one line and “questionable” calls to another.