I had this problem,immediately after upgrading to iOS 6 on my iPhone 4S When it's docked I see the audio routing option for "iPhone" available and sound plays via the unmuted speaker like it should when undocked, and when I remove the phone from the dock it shows "Dock Connector". Meaning the software in iOS6 has the designator/status for audio dock backwards. I don't think I have a bad/dirty/faulty connector, the new bahvior started immediately after updating with no prior symptoms. Headphones work as expected, so it's just the dock connector really. I'm seeing number of posts and videos, people reporting the same issue as soon as they update to iOS 6.
If you don't have Airplay enabled (or more than one audio output option available), you won't see the an enumerated list with the audio output selector and just experience a "missing volume slider." In this case the phone is in on "Dock" mode and will not present the slider (it's sending the audio to an external device), and becomes something of a mystery to the user given the lack of choice, and lack of information. This is made even more confusing in all the above cases since some audio comes out the speaker, audio that is always supposed to route via the phone's speaker (e.g. adjusting the ringer) always plays just fine.
This is a SOFTWARE bug.
Also, Apple should ALWAYS show the option for sending iPhone audio out via the phone's speaker, since it's always present it's should always be an option! In my case, the dock doesnt even feature audio anyway --it's just a charging station! Having this option would have helped.