We have batteries still it may charge back up with the code just depends on the version of software. If they are not used often they will always go dead.
I came up with a workaround for that for my Western Electric payphone (Protel 8000 chassis), because when I first got my payphone up and running in 2012 I bought one of those premade battery packs for it from Payphone.com and after about 9 months it was so dead that it wouldn't even hold a charge anymore (I rarely use my payphone).
To get around the problem I needed better batteries than those cheap Ni-CDs that come in the premade battery packs. So I bought a plastic battery holder (
this one) and the right type of connector (Molex SL series 2-position; I bought the actual Molex connector and pins and crimped them on, but you can also just cut the connector off a dead premade battery pack and splice it onto the battery holder wires, if you don't have a Molex crimping tool).
The best rechargeable battery you can get is Sanyo/Panasonic Eneloop, especially for applications where the batteries sit for long periods of time without being recharged (due to their very low self-discharge rate: 70% retained charge after five years). The Eneloops I have can also be recharged 1800 times, which might as well be a lifetime in this case. And each one has a 2000 mAh capacity (newer Eneloops have even more impressive specs), compared to the 600 mAh capacity of each of those cheap NiCDs in the premade battery pack. As a bonus I can recharge them in the battery charger that I already have (a Sanyo brand one that was bundled with the first pack of Eneloop batteries I bought in 2012; $15.47 total).
I did that in the summer of 2013, and despite hardly ever using the payphone (I often go many months at a time without even picking up the handset), the Eneloops have always tested good (one beep) when doing the *#67 battery test. I swap them out with freshly recharged Eneloops maybe once a year just for good measure, even though they are still at about 1.3 volts each after that amount of time. I've bought a total of 12 Eneloop batteries (4 of them in 2012 and 8 of them in 2013), and I use them interchangeably in my payphone, digital camera, and flashlight. They all still recharge and hold a charge like new.
Here's a picture of it (with the premade NiCD battery pack on the left for comparison):

And here's a picture of it in my payphone:
