How to fix an IPhone 4 with no sound?

My phones kind of beat up, the lock button is jammed and now the sound doesn't work. I don't know if it doesn't work if someone calls me, I always have my phone on silent anyway, but now I can't hear my music and it's really annoying. Like the volume bar just disappears, if i hit the volume on the side of the phone it doesn't do anything, and if i go to the lock screen and try to turn the volume up that way it is gone too. Sometimes the volume bar will come back so ill turn the volume up, but if I hit play on my music the bar goes away and no sound comes out. Does anyone have any idea what happened/ how to fix it?

Call customer service