You can get an app for that. No, seriously...
Not sure what software you're running, some have a setting in the phone app to only accept calls from numbers that are in your contacts.
You can also ignore the spam call then add it to blocked numbers (assuming they don't hide it)
I have a long list of blocked numbers in my device...