Recently my nearly one-year-old iPhone kept telling me that an accessory was not compatible with the iPhone, even though I had not plugged in an accessory. A few days later, I could not put my iPhone into silence mode.
After getting ready to send it in for repair, I discovered it was simply compacted debris, collected from being carried in my pocket, in the bottom port that was making the iPhone think it was plugged into something. A blast of canned air did the trick, and my iPhone is now as good as new again.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20080828115638273