I have a solution that
might work for you. This has happened to me before after using my iPhone on a friends car to receive a call on his car speakers.
Fix- Plug in some headphones
- Hold down the home and power button until it restarts and you see the Apple logo
- Release the buttons and wait for it to complete power up
- Unplug headphones.
For whatever reason, sometimes the phone gets confused and thinks that the headphone jack is still hot. Doing this will force it to realize that it is not.
Hopefully this works for you.