At the recently concluded WWDC 2019, Apple announced its latest iOS 13 for iPhone and iPad. The new software includes a range of updates and enhancements, including a smarter Siri.
In iOS 13, Apple has added a new setting in the Phone app that uses Siri intelligence to prevent spam callers from bothering you.
As explained on the iOS 13 preview page, when enabled, only those calls will ring which are from numbers in Contacts, Mail, and Messages. All other calls will be automatically sent to voicemail.