Welcome to iMore! Do you still have headphones connected? If not, your iPhone thinks you do. Try these:
1. Reset your device by holding the power button and home button down simultaneously until you see the Apple boot logo.
2. Blow into your headphone jack to make sure there isn't any lint or other foreign matter in there that's shorting it out.