Just came home to find I have the same problem!! iPhone 4S, never jail broken,dropped or spilled anything on it! I have been using my original iPhone charger (when they came out with the new iPhone I just shaved my charging/docking station to fit) so it is a little on the dirty side!
This is the first post I read so I did the headphone thing, the docking undocking thing, restarted it and messed with all the volume setting and neither of them worked.
So finally taking "mike iPhone guys" post, I looked @ the 32 pin port at the bottem of the iPhone and I reminded me of a old Nintendo cartridge do untreated it as so.
*** THIS IS HOW I FIXED THIS ISSUE, I DO NOT RECOMMEND IT BEFORE CONSULTING APPLE, YOU MIGHT DAMAGE YOUR DEVICE*********
These are the exact steps I took ....
1. I blew into the port and it did absolutely nothing!
2. I took a vacuum ($200 Hoover windtunnel t series P.A.W.S pet approved vacuum, so it has some power behind it, not the most expensive but not the cheapest either) and used the smallest accessory, the long connection hose/tube with the smaller rectangle attachment and sucked the air out of the port.
This worked for 5 secs my volume bar appeard and then disappeared again.
3. I took a very thin butter knife, wrapped it with a paper towel that I sprayed windex with and stuck it in gently one both sides, tested and still didn't work.
4. Repeated the previous step but added a little pressure and shoved the blade in the upper part only closest to the screen, not the bottem side the knife didn't want to go in as easy so I didn't try, alot of dirt was on the rag, then I used a dry part of the towel and did the same again until there was no dirt on it!
Tested and still didn't work!
5. Blow in it once more, and vacuumed it once more but this time putting my finger in the area that the vacuum didn't reach on both ends an lightly tapping it, WORKS FINE NOW! Just needed some
Cleaning. I can only assume the dirt does make it
Think that it's still docked.