To anyone who still has this problem and no warranty left or doesn't want to deal with the warranty.:
I found the fix to my situation.
So a few weeks ago i dropped my phone into a gutter of water and it stayed there for around 15 seconds. my phone still works but i had the same volume problem as everyone here did.
what my hypothesis is for the problem is that there's a buildup of lint in all the crevaces of your dock connector. once those get moist, they retain water and trigger things like the dock connector area -- disabling the volume for some things.
So what i did was i carefully took a needle (like a sewing needle) and tried to scrape out all the lint and actually dig the lint out of the little holes and crevaces inside the dock connector. it should go without saying that you need to be very careful and try not to put any pressure or as minimum pressure as possible on the actual connector part that has the pins. as i was cleaning it out it would work sporatically and then it would work more as i cleaned out more. the place that made it work for the past 30 mins so far (a record over the past 3 weeks) is in the indented area at the far left and far right end of the dock port. if you grab a flashlight and take a close look, you might see blue lint or whatever color lint in those corners.just carefully "dig" it out with a needle and don't force the needle any further in that it can freely go. some people try to dry it out and that works but if you want a quicker fix and to clean out the port, try this out. Hope this helps at least one person 🙂
-Petie
also, i'm not responsible for any mistakes you may make. i'm not watching over you and i'm not doing it for you. but it worked for me, so yeah