My iPhone had stopped responding to the microphone and the inline clicker from all of my headphones. I noticed that my headphones weren’t going in all the way. I turned my phone off and, with a very slender screwdriver, fished out a couple small tufts of pocket lint. Everything works just fine now. There is some manner of reflective object at the base of the headphone jack. If you shine a light into the hole, and you can’t see it reflect, you’ve got lint (or worse).
Disclaimer: attempt this at your own risk.