login | register
Wed 01 of Aug, 2007 [09:24 UTC]

voip-info.org

Search with Google
Search this site with Google. Results may not include recent changes.

Web www.voip-info.org
Shoutbox
  • Aykut, Wed 01 of Aug, 2007 [07:53 UTC]: Hi all, does anybody know about Thomson ST2030 SIP phone. I have upgraded it to latest version (1.56) but "Hold" and "Conf" features are not working after the upgrade ?? Do you know any solution or do you have Ver. 1.52 ?? Where can I find it?
  • Edward J Brown, Tue 31 of Jul, 2007 [23:33 UTC]: Has anybody experienced Choppy voice quality when using a Linksys SPA942 in an Asterisk Conference bridge? It works fine with my polycom and Cisco, but sucks with my Linksys.
  • www.astawerks.com, Fri 27 of Jul, 2007 [18:00 UTC]: does anyone use asterisk on top of clark connect? does it work good?
  • simon, Fri 27 of Jul, 2007 [14:16 UTC]: Hi All, Has anyone here managed to get the Cisco79x1 to successfully fail over to the backup proxy. I have 2 asterisk servers , handsets all register and function, except that backup proxy function doesn't work. Any working example would be very apprecia
  • Matthew Richmond, Thu 26 of Jul, 2007 [03:40 UTC]: using the page() application to page across our building...often the meetme conferences don't disconnect after the caller hangs up. Anyone else having this problem. (using Polycom phones)
  • Matthew Richmond, Wed 25 of Jul, 2007 [02:58 UTC]: thanks Nicholas Blasgen! I haven't worked with AGI before, but there's always a first! Thanks again!
  • Nicholas Blasgen, Tue 24 of Jul, 2007 [19:18 UTC]: Matthew Richmond, AGI will handle all that for you.
  • sam, Mon 23 of Jul, 2007 [16:39 UTC]: need help - certain voicemail extension will stop working and recording voicemail on asterisk - anyone know why and how to fix it? Thanks
  • john haji, Mon 23 of Jul, 2007 [14:55 UTC]: free calls to pakistan
  • bong, Sat 21 of Jul, 2007 [19:09 UTC]: hi good day to all can anyone help me how to configured the nortel sip to the signaling server and how to activate in mobile w/ sip compatible without mcs
Server Stats
  • Execution time: 0.34s
  • Memory usage: 2.19MB
  • Database queries: 28
  • GZIP: Disabled
  • Server load: 2.76

Enhance the backup function of Trixbox

This page has been viewed 1708 times since being created on Sun 13 of May, 2007 05:41 UTC


If you have the same concern as me, that in case of the local disk crashed, you may have lost the all data within Trixbox, you have even configured the backup function for Trixbox, this article may be a good solution.

I wrote a script in perl, which let you perform the Trixbox backup in addition to storing in the local disk and also sending them to a specificed email address.

So you will have two backups for Trixbox on different location, one is in local disk, another one is in your mail-box. In my case, I prefer google mail-box, which has a very large available space and friendly user interface.

Step 1: Install a perl module 'perl-MIME-Lite' if it is not yet installed within system.

Login Trixbox with putty and then issue this command, check that whether the perl module 'perl-MIME-Lite' have existed.

 $ rpm -qa | grep -i perl-MIME-Lite

Download the package and install it, issue these commands with putty.

 $ su - (here will prompt the root's password)
 $ wget ftp://ftp.pbone.net/mirror/atrpms.net/el4-i386/atrpms/stable/perl-MIME-Lite-3.01-5.el4.at.noarch.rpm
 $ rpm -Uvh perl-MIME-Lite-3.01-5.el4.at.noarch.rpm

Have completed the installation.

Step 2: Edit the file '/var/lib/asterisk/bin/ampbackup.pl', completed these lines:

2.1)

find these lines like this: (around line 188)
if ( $ftpbackup ne "YES" ) {
exit
}


replace them with these lines like this:
if ( $ftpbackup eq "YES" ) {


2.2)

find this line like this: (around line )
exit 0;


replace it with these lines like this:
}
#exit 0;


2.3)

add the following scripts at the bottom.

##########################################################################
#                                                                        #
# -Backup your Trixbox with email                                        #
#                                                                        #
# written by alang 2007,3,31                                             #
# email me to alang[dot]hsu[at]gmail[dot]com                             #
# visit my blog http://itblog.blogdns.net/                               #
#                                                                        #
# -Note: This script will need to install the perl module perl-MIME-Lite #
#       on your system, if it doesn't exist.                             #
#       Issue this command,check whether the module exist in system.     #
#       rpm -qa | grep -i perl-MIME-Lite                                 #
#                                                                        #
# -Usage: Adjust the argument as per your requirement, just like the     #
#         following.                                                     #
#       $emailbackup, fill in 'YES' to enable this function, or fill in  #
#       'NO' to disable it.                                              #
#       $SenderName, fill in your name, or whatever.                     #
#       $WebsiteName, fill in your web-site name, or whatever.           #
#       $from_address, fill in the sender's email address.               #
#       $to_address, fill in recipient's email address, which will       #
#       recieve the backup file.                                         #
#       $subject, fill in the subject of the mail.                       #
#                                                                        #
#       Finally, hoping you like this script, and have fun with Trixbox. #
##########################################################################


use MIME::Lite;

################### BEGIN OF CONFIGURATION ####################
$emailbackup = 'YES';
$SenderName = 'Administrator-YourName';
$WebsiteName = 'My IP PBX-Asterisk';
$from_address = 'root@asterisk1.local';
$to_address = 'your@email.address';
$subject = 'MyPBX Backup Process Reporting! from .$WebsiteName.>'.$WebsiteName.'';
################### END OF CONFIGURATION ####################

if ( $emailbackup ne "YES" ){
        exit;
}

$recommended_filename_1 = "$Stamp.tar.gz";
$attachfile = "/var/lib/asterisk/backups/$Backup_Name/$Stamp.tar.gz";
if ( -f $attachfile )
{

$msg = MIME::Lite->new(
   From => $SenderName.' <'.$from_address.'>',
   To => $to_address,
   Subject => $subject,
   Type => 'text/plain',
   Data => "############# Please don't reply this email ############# \n\n"
       ."Hi, ".$SenderName."\n\n"
       ."Your web(".$WebsiteName.") has completed backup as the attached file. \n"
       ."The detailed information: \n"
       ."Backup job name = $Backup_Name \n"
       ."Backup file name = $Stamp.tar.gz \n"
       ."Backup time = $mon $mday, $year at $hour:$min:$sec \n\n"
       ."Please save as it and in good keeping.")
   or die "Error creating MIME body: $!\n";

# Attach the tar file
$msg->attach(
   Type=>'application/x-tar',
   Path =>$attachfile,
   Filename =>$recommended_filename_1)
   or die "Error attaching tar  $!\n";

### Send in the "best" way (the default is to use "sendmail"):
$msg->send();
}

exit 0;
# EOF


2.4)

Adjust the argument as per your requirement, just like the following.

$emailbackup - fill in 'YES' to enable this function, or fill in 'NO' to disable it.
$SenderName - fill in your name, or whatever.
$WebsiteName - fill in your web-site name, or whatever.
$from_address - fill in the sender's email address.
$to_address - fill in recipient's email address, which will recieve the backup file.
$subject - fill in the subject of the mail.

Save it and quit.

Step 3: Configuring the backup schedule with FreePBX.

From Freepbx choose Tools -> Backup & Restore.
Next select Add Backup Schedule
Filling out all fields per your backup requirement, if this is the first time you schedule a backup, it is advisable to do the backup right now by selecting NOW from the Run Backup drop down selection box.

Step 4: Finished

Check out your mail box, you should got a mail containing the attachment to Trixbox backup.
Finally, hope you like this scipt, and have fun with Trixbox.

Created by A-Lang, Last modification by A-Lang on Sat 26 of May, 2007 [15:34 UTC]

Comments Filter

Works perfectly

by Colin Stoner on Monday 04 of June, 2007 [18:22:15 UTC]
Nice script. I would recommend FTP in a similar script for larger Trixbox servers, but for personal and small-business use this was perfect.

Please update this page with new information, just login and click on the "Edit" or "Add Comment" button above. Get a free login here: Register Thanks! - support@voip-info.org

Page Changes | Comments

Sponsored by:

Terms of Service Privacy Policy
© 2003-2007 Arte Marketing, Inc.

Powered by bitweaver