If you had work done on your iPhone this can sometimes be caused by the wrong revision of headphone jack module (or backplate). Otherwise something may be stuck inside the jack, or the part be broken alltogether. You can find the headphone jack on Ebay or order it here:
http://www.portatronics.com/index.php?c ... ne-2G.html