The best way I found to do this after extensive searching was an iPhone app called Number Shield. You can block all numbers starting with any sequence, such as an area code. There's a 50 million limit to the total amount of phone numbers you can block, which means you can block 5 area codes. The app works really well. I choose to have a phone number with an area code for a different state from where I live. Spammers usually spoof a number with your area code, or a nearby area code, so that way I can block all the area codes the spammers try to use and still get all the calls I want. The blocked calls go straight to voice mail, so I don't miss anything important. I hardly get any spam calls now.