Phone Ok, but internal database says not ready

hi all

We have had a situation with our asterisk 1.2.8 system that confuses me.
We had a Cisco 7960 running SIP 8.2 code that had a faulty power cable,
and kept rebooting, about every 10 minutes. Every time it rebooted,
it registered ok, and you could make calls from the phone.
Calls to the phone always showed as busy (phone is unavailable).
Looking at the dial trace, it goes into dialparties.agi, which always returned
not ready.
SIP show peers showed the phone was registered ok, the problem appeared to be in the internal asterisk database. We solved the problem by restarting the asterisk process.
Two questions:
any one seen this before, any ideas why it happens
how could we have fixed it without restarting

Thanks in advance