I've come across many posts on this issue with varying solutions, none of which worked for me until I tried something on my own which worked... so I'm posting my experience here. Some of the fixes I've seen include blowing in the headphone hole, using a qtip eto clean it, using an air compressor to clean the headphone hole and/or the docking part of the iphone.
None of those worked for me. The issue that I had was that the volume +/- on the side of the phone just showed "Ringer" and no white bars that you would see as you adjust the volume up and down. Further, playing any video/audio , there was no sound. The only way to hear any audio was to plugin headphones, and then the +/- worked. Unplug the headphones, and the volume adjustment stopped working and of course, no sound.
After plugging the phone into a charging chord (in my car) and unplugging it several times, I saw the Ringer volume bars show as i pressed +/- but then went away. So I had a feeling that the issue was with the docking part of the phone (http://www.flickr.com/photos/williamhook/4742859952).
I took an exacto knife (you can use anything razor thing) and bent the entire charging/docking part inside the bottom of the phone up and down a little (you'll be surprised how flexible it is). After doing this, my volume issue was fixed!