The white box labeled AT&T is a battery backup unit for the communications device coming into your premise. Most likely you have some sort of fiber (like Verizon FIOS) and the battery backup keeps the unit running for a while during power loss. That way your phones still work. In the old days with copper lines, they had an outside power source so your phone still worked. Many places have laws / regulations that cover 911 services, to make sure phones still work in the event of power loss.
Depending on the quality of the battery, you may have to replace it every 3-5 years. You can disconnect the old battery to get the size numbers, and lots of places sell replacements. AT&T will sell you a battery but you have to pay for it (same as Verizon and the other carriers). I generally get mine off of eBay for about $25. I have a big UPS for my computer that uses 4 of the same size batteries, so I sometimes rotate them around.
The black box on the bottom ? No idea.