Follow-up: Digium AA50 Reboot Issues — A Temporary Work-around

This is a follow-up my original blog post here: Digium Confirms Major Issues with AA50 VoIP Appliance: Spotaneous Reboots and Memory Card Write-Lock, A Review

Since I originally posted, I seem to have found a band-aid fix that is getting our AA50 through the days without spontaneous reboots and dropped calls in the process. I thought others might find this helpful too. Although not ideal, I am currently rebooting the AA50 shortly before it starts seeing steady use each day and thus far (knock on wood), the unit has not rebooted unexpectedly; we are going on 5 days since I put this reboot process in place.

A little bit of background before I present my work-around: The unit in question utilizes a custom “office closed” greeting that is played before all other greetings on off-hours. We deliberately set up the system to clear all of these types of messages (we call them “pre-greetings”) after a reboot. Accordingly, if the unit reboots and the office is not open, callers may not know that fact and expect a quick reply back. In order to minimize the number of cases where someone calls the office and does not hear the “office closed” pre-greeting, I reboot the phone system each Monday-Friday at 8:40 am. The office opens at 9:00 am and the receptionist routinely arrives early to listen to messages before the day starts; it is important for everything to be rebooted and ready when she arrives.

Although I do have OpenVPN access to this network, SSH with a strong password direct to the box is how this example is presented as I realize many of you might not have this luxury. I recommend that you port-forward some port other than 22 to prevent the most basic of attacks and most certainly use a strong password; if possible, restrict your origination networks as well. I based my solution on the expect package for Linux and it is working quite well.

A note on syntax: In the below examples, I use brackets [ ] to contain arguments that you will need to change to match your particular situation. For example, if your AA50’s password is 1s3curedb0x!, you would replace “[your_password]” with “1s3curedb0x!” in the below examples.

A note on requirements: My examples require the expect package and assume you are using Linux for this exercise. On a stock install of Ubuntu, you can simply “sudo apt-get install expect” to get what you need.

The reboot script: This is the main reboot script that gets called each morning. This script will remotely connect to an AA50, gracefully restart Asterisk (i.e. do not reboot in the middle of a call) and then immediately reboot the AA50.

reboot.sh script is available here

Automated log move and download scripts: If you have full logging enabled on the AA50, it does not get saved long-term so far as I can tell; it appears that the log is only stored in volatile RAM which is cleared on each reboot. Accordingly, I download my debug logs just before rebooting. I assume that if you have an AA50, you probably do not have a super high-trafficked system, but do be aware that the way I do this leaves behind events that you will not have logged right around the few seconds that it takes to login to the unit, download the log and then reboot the AA50.

Also note that this would be a much better solution if I did everything in one script. Alas, I did this piecemeal and have not yet compiled everything into one script. If you would like to do so and post it for everyone else to see, please do, but I do not have time at the moment.

move_full.sh script (moves the last full log downloaded to a file with the timestamp  of now before we download the newest log to replace it):

move_full.sh.txt is available here

scp_download.sh (download the current full log from the remote AA50 to our local machine before we reboot):

scp_download.sh.txt is available here

The cron job: This is really simple, and if you have never set up a cron job before, do a search for “crontab generator” and you will find all of the help you need.

#call the following three scripts every M-F @ 0840
40 8 * * 1-5 move_full.sh ; scp_download.sh ; reboot.sh

There you have it. It is not pretty, but it works for me. If you have a similar problem with your AA50 and are not sure how to remedy the problem yourself, please get in touch with me at http://DennisLittle.com and I will be happy to help.

Disclaimer: I am not a programmer, so use this at your own risk.

Leave a Reply