Always a good place to start is to shutdown and reboot your iPhone. If that doesn't work then it's time to investigate further.
If a reboot has no effect, is it possible that your iPhone is connecting to some sort of Bluetooth device? It may not necessarily be a headset (I know you said you don't use one) - it could be a speaker, a receiver, headphones, etc.
The next time this happens, the first thing I would do is go to Bluetooth settings at Settings > Bluetooth and check to see if any devices are listed there? If you see anything you don't recognise or ever want connected, tap on the blue ⓘ symbol on the right of it and select Forget This Device.
Another troubleshooting step you can take is to disable Bluetooth altogether for a while to see what difference, if any, that makes. Once again, you can do this at: Settings > Bluetooth.
If none of this helps, you could check your headphone socket to make sure it's clear of any debris. You can also plug some headphones in and see how your iPhone behaves and then unplug them again.
Finally, you do have various Reset options available to you at Settings > General > Reset. You could start with the Reset Network Settings option (note this will reset Wi-Fi networks and passwords, mobile network settings, VPNs, etc.).
Otherwise you could do a full backup of your iPhone and then do a full reset of all content and settings (also available at Settings > General > Reset). This erases everything, so make sure you've done a full backup so you have something to restore from!