I have my iPhone set to accept calls from contacts only. Wish I could do that for the landline.
I use a cordless Panasonic phone on our landline. While it doesn’t have the “white list” feature you requested, it does allow me to block large groups of numbers. I block entire Area Codes and some Prefixes in my own Area Code.
Now that the scammers are using my own AC and Prefix, I have to block more individual numbers. I usually spend a few minutes each week updating the Black list on the phone. I also use NoMoRobo to block known scammers.