Asterisk Backup Method

Here at work, we’ve been setting up an Asterisk system to run our phones. Its a pretty slick setup, with the server sitting in our rack at Handy Networks’ data center in the big Qwest building in downtown Denver.

Since the system is mission critical, a good backup solution is important. Our current solution, which I’m sure we will revise, is as follows.

We use FreePBX’s backup module to perform daily backups of important data (voicemail, call recordings, etc) at 3:05AM.

At 3:30 AM, a cron job runs and the backup files are copied over to our windows file server. The files will then be ready for saving offline.

Here’s the backup script:

First, it deletes all files older than 7 days.

It then mounts the backup share. An appropriate entry is in /etc/fstab to allow the asterisk user to mount the share.

Then, using rsync, copy the files onto our windows server.

Next, we take the md5sum of each of the files and places the output on the backup server. This helps to ensure our backup’s integrity.

Finally, unmount the backup share.

Restoration would be simple. Install FreePBX + Asterisk onto a server. Copy the backup files into the backup location, and then use FreePBX’s backup and restore module to restore the backups.

Make sure you do proper testing before implementing this into a production system.

CFML Custom Function – URLExists

One of the updates I had to make today at work was to check if an item exists at a certain URL. Since this was going to be repeated, I wrote my own ColdFusion function to perform this task.

Analysis of Sorting Algorithms

The end of the semester is nearing, and one of the final homework assignments for my Data Structures class is to implement a few different sorting algorithms.

The class started at the beginning of the semester by implementing the terrible Bubble Sort algorithm (the utility of which I’m still trying to find). Its only fitting the class would end by implementing the Selection Sort, Insertion Sort and Quick Sort algorithms.

Through researching different techniques of implementing these algorithms, I ran across a very neat website labeled Sorting Algorithms Demo. The website is chock full of little java applets that show you just how fast some of these sorting algorithms are compared with each other.

If this sort of thing interests you at all, I highly suggest you check it out:

UPDATE: Just discovered this even cooler website: