Ringer stops working from time to time

I'm having an issue where the ringer on my iphone 6 even when it is turned on it will not work. I've shut it down and turned back on and it still has this issue. It is working ok today, but other times it doesn't want to. What could be the issue or what can I do?
I don't know. Is it somehow connecting to a Bluetooth headset that's nearby?
It must be a software bug, i think u should hard reebot your device by pressing home button and power key simultaneously for about 5-7 seconds till the screen reeboots, this method always help in resolving software issues.

Original thread: https://forums.imore.com/threads/ringer-stops-working-from-time-to-time.331839/