In a document sent to Apple Authorized Service Providers, Apple revealed that some customers are experiencing an iPhone 7 microphone bug. Some people have been finding that their speaker button is grayed-out during phone calls or video chats through FaceTime. It affects certain iPhone 7 and iPhone 7 Plus models running iOS 11.3 or later (via MacRumors).
iPhone 7 Microphone Bug
Apple recommends first to unpair or turn off Bluetooth devices connected to your iPhone, to see if it works. If it doesn’t, then service providers are told to run audio diagnostics. This will show if the iPhone is in need of repair if an alert appears that says “accessory not supported” or “device could not detect dock.”
Service providers have been authorized by Apple to repair these devices even if they are no longer under warranty, specifically for this issue. You can schedule an appointment either with an Apple Store Genius Bar or an Apple Authorized Service Provider on Apple’s support page.
MacRumors says that because Apple hasn’t acknowledge the bug publicly yet, employees may not know about it or deny the information. In that case you could try escalating your case to a senior AppleCare advisor.