Really weird iPhone 5C issue?

I have to play music to keep my iPhone working. My iPhone randomly turns off when I'm not using it. I can press either the home or lock button once and it will reboot. Sometimes it puts itself in DFU mode. I have restored to the lastest software multiple times and set up as new iphone and not put anything on the phone at all and it still does it. I noticed that it never restarts while I'm on the phone. So I thought of ways to make it stay alive like a phone call. I played some music and turned the volume all the way down and it doesn't restart at all now. So it is most likely a hardware issue since I have had it since iOS 7 and I've restored it several times but why does playing music fix it? I keep my phone playing music 24/7 on silent and when I pause the music, it will shut off after a couple minutes. I really want to understand why this is happening and how I can fix it because I've already opened it so any warranty is long gone.

Added (1). " I noticed that it never restarts while I'm on the phone" By that I meant placing a phone call.

Added (2). It also never restarts while I'm just using the phone.
The only time it restarts is when I don't use it.
I thought it might be a notification glitch that crashed the phone but I don't think so anymore

Wipe your iPhone completely, or go to the Apple store and see if they can fix it.
I don't think it's anything that you can do, this is really weird haha.

  • What's a Really Really good case for a iPhone? So I had to get a new iPhone 5 because the lock button broke & I had accidentally dumped coffee on it. So I had purchased a new one & I want to be VERY careful with it. Does anyone know of any really good cases to keep it safe? Price doesn't matter.
  • My iphone 4 is acting really weird When i make videos it says not enough storage so i go to manage the storage but it says it has the total storage of 5gb and what's available is 5gb and it makes no sense at all and i deleted some apps and like 30 videos and and i'm down to 18 videos so when i record it lets me but only like 30 secnd videos and says not enough storage to make video or picture any help i really need help
  • IPhone 5 is acting really weird lately? I have an iPhone 5. Lately my phone has been acting really weird. I can't send iMessage/texts when I even have good reception and signal, all of my apps crash within 3 seconds of clicking on them, and all my pictures are blurry, even though they we're when I took them. I also can't change my background. Does my phone have a virus, or if not, what's wrong with it & is there a solution?
  • IPhone 4 sound really really muffled? It sounds like somebody's put their hand on my speakers. Suggestions to fix it? I was on FaceTime with my friend and she said my voice coming through to hers was normal. The sound and everything is up and on. The speakers are clean.