I had an issue like this over a year or so ago. The tactical fix to the current state is to restart the stcapp application on the router.
This isn't guaranteed to fix the state the ports are in. You may also have to reload the router.
In my case the root cause of the issue was two fold. One, I was running into a couple of software defects:
Externally found moderate defect: Duplicate (D)
VG224 issues fast busy tone on going offhook
Internally found moderate defect: Resolved (R) No dialtone on VG224 endpoint when more than one line configured
Internally found minor defect: Assigned (A)
VG224 Endpoints may lose dialtone after Immediate Switchover
Second, I did not have all VG224 ports configured on the CUCM system. By this I mean the VG224 was added to the system but not every port was configured on the CUCM (so, some had the ol' "?" icon). The VG224 did not know this was the case and kept trying to register the unconfigured ports. This caused a general stability issue with the stcapp and eventually caused the router to start unregistering other ports. IOW, I would see the exact symptoms you describe.
Now, that isn't to say you have to have the same provisioning discrepency issue I had. The IOS software was just super buggy and there was more than one way to tickle the bugs. That being said, the short term solution (in my case) was to go to either configure all of the ports in CUCM so they would register OR shutdown the voice ports on the vg224 so they would stop trying to register. We did that while we researched and tested a viable IOS replacement. Even then, the stcapp was still unstable. It just took longer for the gateway to start having issues.
The long term solution was to deploy 12.4(15)T code (at the time it was T3, today I think they are on T12). That alleviated the stability issues and it is actually the code I use for other customers now. There was some dodgy issues in the T7 to T9 release (one I ran into was T.38-CA controlled with MGCP).
So, the question I have is which release of IOS are you running? How often does this issue occur? Do you have the same provisioning discrepencies I noted? Can you/have you tested the gateway with 12.4(15)T?
Oh, in general I recommend that if you have a provisioning discrepency between the CUCM and the VG-224 that you resolve it by configuring all ports in the CUCM or shutting down/disabling the stcapp association in the VG-224. Even if it isn't causing stability issues, it is murder on the syslog/event log.
You have reached the Cisco Logistics Support Center.. To Check Status of
your RMA, visit Product Returns & Replacements (RMA). Need help? Contact
us by Phone or Email. North Americas Phone: 1800 553 2447 Option 4
Email: firstname.lastname@example.org Europe Phone: +3...
The short answer is that you don't.... That isn't entirely true while at
the same time it kind of is, but for the most part you don't configure
the softkeys. You enable or disable them via TCL. Here is the long
answer. Be sure to read the whole thing or e...
Topology: IP Phone > Switches > Microsoft NPS setup to forward 802.1x
proxy to > ISE 2.1 patch 3 Authentication: EAP-TLS using Cisco MIC SANs
Phone Models 802.1X support? 802.1x flavor Addtl Comment EAP-MD5 EAP-TLS
Cisco 3905 Y Y N Cisco 6911 Y Y N Cisco ...