A few days ago I experienced the same problem as most other people in this forum... My iPhone would not play any music without headset connected and also I could not hear anything when in a call... Additionally, I did not hear any "clicks" when pressing any keys...
I tried absolutely EVERTYTHING at no avail... the phone just would not work.
Buy the headphone jack flex cable (I bought mine on eBay for US$14.00 including shipping)
The only pain in the butt was opening the phone up and removing the old flex and then installing the new one. Everything went great and as soon as I powered on my phone it was as good as new!
This makes me think that most of us were experiencing hardware issues that could not be solved by just plugging/unplugging the headset jack...
My advice, just buy the flex!
You dont have to buy from the guy I bought from, but if you do, expect to receive it within 3-4 days of purchasing it.
Hope this helps!