My iPhone only has sound with headphones in?

The phone rings but for everything else it only has sound with headphones in. Example, I get an incoming call or an out coming call, when the phone is answered I hear no sound. But when I put the headphones in I hear the other person. The rookie on the other line day they can hear me even when I can't hear them.Lu can also hear then in speaker but just not without it.

I'll play a song without headphones and the song will be playing but no sound. It's an iPhone 4 and I just installed ios7 yesterday but I've only started having prjbels a few hours ago

I'm afraid I had that exact same problem with my iPhone not long after I bought it. It is apparently something to do with the earphone jack gathering dust inside, your best bet will be to take it into an apple store and ask for help. For now you could try lightly blowing into the earphone jack, but I wouldn't suggest sticking anything inside to clean. Mine did eventually fix itself, but I know that's not really going to help you: L