I can confirm that if the phone 'thinks' it has a headset, the audio from the phone is diverted through the headset.
I managed to solve sound disappearing from my phone when I look directly into the headset socket and found something inside it.
It turned out to be a small piece of tissue stuck inside the hole. I managed to dig it out with a small toothpick and the phone speaker is working again.
I remembered now that when the last time I was using it when it was still working fine, my earphone jack didn't want to go into the headset socket and I forced it in. It must have been that a small piece of tissue got logged inside it when I had the phone, the earphone and my tissue all inside my jacket pocket. How it happened, I've no idea.
So, take a look inside the headset socket and see if there's anything inside there which should't be there. I'm so relieved that I was able to 'fix' my phone without resorting to long and expensive repair.