The IP phones we are using are made by Aastra, and are great pieces of equipment. When booting up they contact (by default) a TFTP server, which is identified by DHCP option 66.
We needed to have our phones portable, and didn’t want to go through the hassle of setting up an external TFTP server for several reasons, among them security. So I set up an ftp server using VSFTP, and wrote a script which synchronizes the tftp directory with the ftp directory.
The script does the following:
Only run if any file in the tftp directory is newer than the newest file in the ftp directory
Update the aastra.cfg to have the phone use an FTP server instead of a TFTP server
Rsync the tftp directory to the ftp directory
Modify all *.cfg files in the ftp directory:
Change the local IP address with the DNS of the server
Change the HTTP lines which reference port 80 to the configured port
Change the HTTP lines which don’t reference a port at all to use the configured port
Change the permissions on all the files in the ftp directory to read only
You will need to configure the following values at the beginning of the script:
If you are using a non-standard tftp directory or ftp directory, you will need to update those values as well (also at the beginning of the script).
I’ve also attached a copy of the vsftpd.conf file. You will need to create a user that your phones will use to access the FTP server, and add that user to the /etc/vsftpd/user_list file. I would suggest using the following command for security to add your user:
useradd -s /sbin/nologin -b /var/ftp aastrauser
and don’t forget to put a password on the account
vsftpd.conf (1.7 KiB, 942 hits)
syncftp.sh (2.6 KiB, 1,179 hits)