Here you can set your ringer volume- independent of the outside volume buttons if you have
Change with Buttons OFF This requires you to move the slider to set your ringer volume.
What have you done troubleshooting?
Basics from the manual are restart, reset, restore
Follow the 3R's- if a restart does not solve your problem proceed
User troubleshooting is:
1.restart, ie power off/on,
2. reset http://support.apple.com/kb/HT1430,
3. restore from backup, restore as new device. http://support.apple.com/kb/HT1414
this worked for my Iphone 4
Assistive touch - switch to on.
using the assistive touch (the white circle that now appears on your screen), go to:
Then tap the bell (mute) icon.
This should fix the issue. To test it (without having to wait for someone to call you) write an SMS and see if the keyboard clicks are audible.
I hope this solves your issue like it did mine. If it doesn't maybe try tapping that mute icon again and/or flicking the actual mute bottom on the left hand side of your iPhone.
This solution comes from @17beachside71 on this thread: