Ticket #5315 (closed Feature Requests: fixed)

Opened 2 years ago

Last modified 1 year ago

Backup via FTP -> Active mode

Reported by: mjunghanns Assigned to: mbrevda
Priority: major Milestone: 2.11
Component: Backup & Restore Version: 2.9-branch
Keywords: active ftp firewall Cc: tonyclewis
Confirmation: Unreviewed Distro:
Backend Engine: All Distro Ver:
Backend Ver: SVN Revision (if applicable):

Description

Whenever one would try to use the FTP backup method to store the backup on a FTP server that is sitting behind a firewall/router, which is not capable of providing sufficient FTP transfer support, the file transfer would fail. In that case FTP's passive mode would not work, even though a connection using the FTP control port 21 could be established. In the described setup it would be necessary to disable passive mode and use active mode.

From the command line this would be accomplished by just typing 'passive' since this command is a toggle for active/passive mode.

[root@pbx asterisk]# ftp backup.some-dude.com
Connected to backup.some-dude.com.
220-FileZilla Server version 0.9.37 beta
220-written by Tim Kosse (Tim.Kosse@gmx.de)
220 Please visit http://sourceforge.net/projects/filezilla/
502 GSSAPI authentication not implemented
504 Auth type not supported
KERBEROS_V4 rejected as an authentication type
Name (backup.some-dude.com:root): pbx
331 Password required for pbx
Password:
230 Logged on
Remote system type is UNIX.
ftp> passive
Passive mode off.
ftp> ls
200 Port command successful
150 Opening data channel for directory list.
-rw-r--r-- 1 ftp ftp       22200952 Aug 09 21:16 20110809.21.15.42.tar.gz
drwxr-xr-x 1 ftp ftp              0 Aug 09 20:02 test
226 Transfer OK
ftp>

Unfortunately I was not able to find any configuration switch within FreePBX that would allow me to choose from active or passive mode. I fixed this limitation by adding the toggle to the FTP login and transfer sequence.

/var/www/html/admin/modules/backup/bin/ampbackup.php:

    251 if( $opts['ftpuser'] && $opts['ftppass'] && $opts['ftphost']){
    252         $fh             = fopen($opts['ftpfile'], 'w');
    253         $data   = 'user ' . $opts['ftpuser'] . ' ' . $opts['ftppass'] . " \n";
    254         $data   .= "passive\n";
    255         $data   .= "binary\n";
    256         if($opts['ftpdir'] != ''){
    257                 $data .= "cd ${opts['ftpdir']} \n";
    258         }

modification on line 254

From my point of view this is a very critical limitation since the absence of the abilit to switch between these two operational modes can make this module useless for many people that depend on active mode.

This feature could be implemented by including an 'active mode' checkbox into the backup-/restore gui. Some if-clause that is checking on the checkbox would need to be added to the workaround described above.

Change History

02/20/12 21:01:20 changed by p_lindheimer

  • cc set to tonyclewis.
  • owner set to mbrevda.
  • milestone changed from 2.10 to 2.11.

reassigning to moshe to comment whether this is still the case or has been addressed. If it's been addressed change milestone to 2.10 and close otherwise deal with as you see appropriate.

02/21/12 08:46:21 changed by mbrevda

EDIT: We need to look in to exposing this option via the gui, as we currently are hardcode to PASIVE

03/26/12 13:02:04 changed by mbrevda

  • status changed from new to closed.
  • resolution set to fixed.

(In [13908]) closes #5707, #5315 - backup editing issues

04/14/12 13:49:44 changed by p_lindheimer

(In [13970]) Merged revisions 13855-13856,13858-13859,13861,13864,13866,13868,13897,13899-13901,13903,13906,13908,13910,13912,13919,13931,13933-13935,13937,13939,13941,13945,13947-13950,13952-13953,13955-13956,13959,13961-13962,13964-13965,13967 via svnmerge from http://www.freepbx.org/v2/svn/modules/branches/2.10

........

r13855 | p_lindheimer | 2012-03-19 13:17:22 -0700 (Mon, 19 Mar 2012) | 1 line

closes #5664 get app_confbridge to work on Asterisk 10

........

r13864 | p_lindheimer | 2012-03-22 15:33:29 -0700 (Thu, 22 Mar 2012) | 1 line

incorrect logic re #5705

........

r13900 | p_lindheimer | 2012-03-23 14:27:18 -0700 (Fri, 23 Mar 2012) | 1 line

fixes #5710 bad syntax thanks for the fix TSM

........

r13906 | p_lindheimer | 2012-03-23 15:50:21 -0700 (Fri, 23 Mar 2012) | 1 line

fixes #5714 don't write out any Content-Length headers in sip_notify_additional.conf

........

r13908 | mbrevda | 2012-03-26 10:02:04 -0700 (Mon, 26 Mar 2012) | 1 line

closes #5707, #5315 - backup editing issues

........

r13919 | mbrevda | 2012-03-27 01:36:07 -0700 (Tue, 27 Mar 2012) | 1 line

  • upstream changes

........

r13934 | p_lindheimer | 2012-03-27 11:01:15 -0700 (Tue, 27 Mar 2012) | 1 line

fixes #5734 properly validate new destinations

........

r13948 | mbrevda | 2012-03-31 16:03:09 -0700 (Sat, 31 Mar 2012) | 1 line

re #5750 - ensure function exists before calling

........

r13949 | p_lindheimer | 2012-04-02 16:09:06 -0700 (Mon, 02 Apr 2012) | 1 line

fixes #5752 typo resulting in pin being requested twice

........

r13956 | mbrevda | 2012-04-10 07:44:57 -0700 (Tue, 10 Apr 2012) | 1 line

upstream bug fixes, restart updates for asterisk 1.8