It should still be under warranty. That's just three months since you purchased it.
Last edited:
I had the issue with my 5s, the headphone jack was damagedIf possible, take a can of compressed air and blow it into the headphone jack.
Insert the headphones completely. Remove them. Do this for seven or eight times.
Afaik that's not a software glitch. It rather is a hardware bug. The sensor in your jack thinks the headphones are still attached. I'm in doubt that restoring will help in your case.