Details

    • Backend Engine:
      All
    • Confirmation:
      Unreviewed

      Description

      Below is a diff to patch to the backup module. During a restore it will update the trunks table setting trunks defined as "pri" to off and trunks defined as "bak" to on.

      --- backup.orig/functions.inc.php	2010-06-22 21:15:04.000000000 -0500
      +++ backup/functions.inc.php	2010-07-28 15:19:18.000000000 -0500
      @@ -163,6 +163,13 @@ function backup_restore_tar($dir="", $fi
       			$sql_cmd="mysql -u ".$amp_conf['AMPDBUSER']." -p".$amp_conf['AMPDBPASS']." < /tmp/ampbackups.$fileholder/asterisk.sql 2>&1";
       			exec($sql_cmd,$out_arr,$ret);
             backup_errors($error_cause, $ret, _('failed to untar asterisk.sql'));
      +			$sql_cmd="echo \"UPDATE trunks SET disabled = 'off' WHERE disabled = 'pri'\" | mysql -u ".$amp_conf['AMPDBUSER']." -p".$amp_conf['AMPDBPASS']. " ".$amp_conf['AMPDBNAME']." 2>&1";
      +			exec($sql_cmd,$out_arr,$ret);
      +      backup_errors($error_cause, $ret, _('failed to update trunks pri to off'));
      +			$sql_cmd="echo \"UPDATE trunks SET disabled = 'on' WHERE disabled = 'bak'\" | mysql -u ".$amp_conf['AMPDBUSER']." -p".$amp_conf['AMPDBPASS']. " ".$amp_conf['AMPDBNAME']." 2>&1";
      +			exec($sql_cmd,$out_arr,$ret);
      +      backup_errors($error_cause, $ret, _('failed to update trunks bak to on'));
      +
       			$sql_cmd="mysql -u ".$amp_conf['AMPDBUSER']." -p".$amp_conf['AMPDBPASS']." < /tmp/ampbackups.$fileholder/asteriskcdr.sql 2>&1";
       			exec($sql_cmd,$out_arr,$ret);
             backup_errors($error_cause, $ret, _('failed to restore asteriskcdr.sql'));
      

      How the values get populated [core|in] or handled on the primary are not addressed in this patch.

      Discussion about this patch may be done in the forum under http://www.freepbx.org/forum/freepbx/development/managing-trunk-state-with-backup-restore

        Activity

        Hide
        Moshe Brevda added a comment -

        Until trunks are properly hook-able (and backup is "worth" of supplying such hooks), I would simplify this to an (albeit inflexible) server wide boolean option. When doing a remote restore, we would have the option to disable ALL trunk (or not). While that doesn't resolve ALL situation, it should cover most.

        Show
        Moshe Brevda added a comment - Until trunks are properly hook-able (and backup is "worth" of supplying such hooks), I would simplify this to an (albeit inflexible) server wide boolean option. When doing a remote restore, we would have the option to disable ALL trunk (or not). While that doesn't resolve ALL situation, it should cover most.
        Hide
        Philippe Lindheimer added a comment -

        with the new backup this is either done already, in process or needs a new ticket since so much has changed so just gonna change ad invalid at this point.

        Show
        Philippe Lindheimer added a comment - with the new backup this is either done already, in process or needs a new ticket since so much has changed so just gonna change ad invalid at this point.

          People

          • Assignee:
            Moshe Brevda
            Reporter:
            peterbokunet
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development