Not Receiving CDRs over FTP

Issue:

I have my SBC (i.e. Acme/Broadworks/Taqua/Sonus/Cisco Call Manager) configured to transfer files to CDRConverter using FTP protocol, but I never see any records reach the designated folder that I defined in the remote-path.

Troubleshoot:

  • First check to see if the vsfpd daemon (vsftpd) is running.

    • Not Running Example:

      [ossadmin@sdreporter ~]$ ps -ef|grep vsftp
      ossadmin 9587 9561 0 11:53 pts/0 00:00:00 grep vsftp
      [ossadmin@labrat-1 ~]$
      
    • Running Example:

      [ossadmin@sdreporter ~]$ ps -ef|grep vsftp
      root 2983 1 0 Apr30 ? 00:00:08 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf
      ossadmin 9285 9258 0 11:51 pts/0 00:00:00 grep vsftp
      [ossadmin@labrat-1 ~]$
      
  • If the vsftp daemon is not running, become super-user (root) and start it with the following command.

    [root@labrat-1 ossadmin]# /etc/init.d/vsftpd start
    Starting vsftpd for vsftpd: [ OK ]
    [root@labrat-1 ossadmin]#
    
  • Make certain that the auto-start/stop links are in place. Typically the auto-stop link should reside in /etc/rc0.d, and the auto-start link will reside in /etc/rc3.d or rc5.d, depending on the system run-level).

    • Auto-stop link example:

      [ossadmin@sdreporter rc0.d]$ ls -ltr *vsftp*
      lrwxrwxrwx. 1 root root 16 Apr 2 2012 K50vsftpd -> ../init.d/vsftpd
      
    • Auto-start link example:

      [ossadmin@sdreporter rc3.d]$ ls -ltr *vsftp*
      lrwxrwxrwx. 1 root root 16 Apr 2 2012 S60vsftpd -> ../init.d/vsftpd
      
  • If the vsftp daemon is running, test connecting to the ftp server running at CDRConverter by attempting a manual ftp into the system as user ospadmin. If you never see a login prompt, then the vsftp daemon is not running, and/or port 21 is not open on the CDRConverter system.

Not receiving CDRs over FTP

  • To open the port, check the iptables file for a statement port 21. Add a statement if one does not exist, and the restart the local firewall.

    # vi /etc/sysconfig iptables
    ~
    -A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
    # /etc/init.d/iptables restart
    
  • You can try starting the vsftp daemon with one of the following commands.

    # service vsftpd start
    

    or

    # /etc/init.d/vsftpd start
    bash: /etc/init.d/vsftpd: No such file or directory
    [root@labrat9-c62-64 ossadmin]#
    
  • If vsftpd is unavailable, you can install it using the command below.

    #yum install vsftpd
    
  • After you have the service installed, you should now be able to start it.

    # /etc/init.d/vsftpd start
    Starting vsftpd for vsftpd: [ OK ]
    

If you try a manual ftp again and get the following “Login failed” message, then you must edit the vsftp.conf file and restart the application.

Not receiving CDRs over FTP

# vi /etc/vsftpd/vsftpd.conf
~
anonymous_enable=NO (change anonymous_enable to NO)
~
local_enable=YES (set local_enable to YES)
~
xferlog_enable=YES ( If you enable xferlog, then the system will log messages for transfer attempts at /var/log/xferlog.)
#
 
# /etc/init.d/vsftpd restart
Shutting down vsftpd: [ OK ]
Starting vsftpd for vsftpd: [ OK ]

Another issue may be the SELinux is not allowing the user to change folders. You will see the error “500 OOPS: cannot change directory” when attempting a manual ftp.

C:\> ftp xxx.xxx.xxx.xxx
Connected to xxx.xxx.xxx.xxx.
220 (vsFTPd 2.2.2)
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (xxx.xxx.xxx.xxx:root): ray
331 Please specify the password.
Password:
500 OOPS: cannot change directory:/home/ossadmin
Login failed.
ftp> bye

If SELinux is required for your network, then issue the following command to allow the remote system (i.e. Broadworks or Acme) to change folders in order to reach the destination file transfer folder (i.e. ~BWS/1).

# /usr/sbin/setsebool -P ftp_home_dir 1
- SELinux can also be disabled. This will require a system restart.
# vi /etc/sysconfig/selinux
~
#SELINUX=enforcing
SELINUX=disabled

The vsftpd configuration expects the origination port to be port 20.

  • Excerpt from /etc/vsftpd/vsftpd.conf:

    # Make sure PORT transfer connections originate from port 20 (ftp-data).
    connect_from_port_20=YES
    

If this is not the case, then you will have to add a port-range to your vsftpd configuration on Linux. You can do this by following the steps in the screenshot below.

Not receiving CDRs over FTP