Speaker, microphone don't work after i pulled out my headphones

Excuse moi, je comprend francais, mais c’est dificile pour moi a ecrir.
Je continue en anglais.
I found the problem is the phone is not switching between headset and external speaker/microphone. When the headset is plugged in when you are being called or when you make a call, there is no problem.
When you have used your headset (listening to music or something) and then unplug the headset, the problem will start and you will not hear or be able to speak to the other person.
Reboot works. Until you use your headset again…
I don’t have a solution yet, sorry.