Saved me..shut phone,, take a qutip, dip in rubbing alcohol, squeeze out any excess off the qutip,, insert into headphones jack and turn A few times,,, allow to dry for 5 mins (just in case) and turn on. I have fixed this same issue in many different smartphones with this method .
use toggleheadset2 app or soundabout app ....it will resolve ur prob...