My iPhone 3Gs is my pride and joy. The earphones worked fine, but the mic and the volume control buttons generated no response. I thought I wrecked my phone for sure (as my earphones were working on other people’s phones). I looked online and found this page. All you need to do is switch off the phone and put some slender object like a pin (preferably not too sharp) into the earphone socket. You end up pulling out enough lint to make new pants out of them!

Once I dug out all that lint, the earphone started working and it works great now! I decided to post this in the hope that it might help someone else.