I would try putting the phone in restore mode and reset the device.
Press and hold power and volume down, when phone shuts off release power and hold volume down until it tells you to plug phone into iTunes.
Then plug your phone into a computer with iTunes. Run iTunes, it will detect a device in restore mode then allow iTunes to restore your device and see if the issue persists.
Question: Why is my microphone not working ?