You can avoid unwanted calls by identifying callers, blocking certain people, and sending unknown and spam callers directly to voicemail.
iPhone can help identify incoming calls using information from Apple Business Connect, supported carriers, and supported call identification apps.
Go to Settings > Apps > Phone.
Tap Blocked Contacts, then tap Edit.
Tap While on a call on iPhone