Cisco 7940 & 7960 IP Phones - How To Upgrade
Introduction
This How-To summarises our experiences in upgrading 7940G and 7960G to function as SIP phones with trixbox®. These phones are originally supplied with Cisco Call Manager (CCM) firmware.
We also survived a “Protocol Application Invalid” issue that potentially makes the phone unusable. As far as we know this results from an upgrade that has gone wrong. If you have more info on when this error occurs please let us know.
This page brings together prior information that we found on the trixbox® forums, voip-info.org and generally on the internet and is a tribute to everyone who has previously posted on this subject combined with the ability of a certain search engine to dig through the many voip and telephony forums to find references that were useful for us.
We have only tested our How-To in the circumstances described below. If you find these pages useful or find errors we would love to know, use our Contact page.
- Upgrading Cisco 7940 & 7960 to SIP
- Introduction
- Upgrade
- Upgrade Process
- Troubleshooting
- Conclusion
- Surviving "Protocol Application Invalid"
- Scenario
- Background
- Fixing the problem
- Start / Stop the Centos DHCP server
- Conclusion
- Postscript
- Useful Links for Cisco 7940 & 7960
Upgrading Cisco 7940 & 7960 to SIP
Introduction
We have upgraded 7940G and 7960G phones to run the SIP firmware images. We have used the same process for upgrading both models and they use the same firmware. The following section describes the process that we followed:
Before you proceed you need to setup the basic Cisco configuration files using trixbox® & freePBX.
Run setup-cisco Setup an extension number for your Cisco phone with freePBX Read the mac address off the base of your phone Using freePBX go to the endpoint manager and edit the Default Configuration for the Cisco phone if necessary Using freePBX and the endpoint manager, select "add phone", select the phone model, enter the MAC address and the extension number that you previously created. If you want to enter additional line info, or change the time zone use the advanced option. This will create the SIP_macaddress_.cnf for your particular phone. These files will be located in /tftpboot on your trixbox server just check them over to make sure they are what you want.
Copies of the files generated by trixbox V 2.0 are here: Cisco 79X0 files
Upgrade
Summary: If you have a phone with an early firmware image you can’t immediately go to a recent firmware revision. You need to upgrade in small revision steps as we have done below. The process below takes you to release 3 and then to 4.4, 5.1, 6.3, 7.5 and then 8.2.
Please read the how-to carefully if you have problems please let us know via our feedback form on the contact page.
To carry out the upgrades you need a tftp server. trixbox® has one installed and running already.
Using winSCP or some other means copy the firmware files to /tftpboot on your trixbox machine
Just to be sure, set the mode of the files you have copied to 777
chmod -R 777 /tftpboot
This changes the permissions on ALL the files in /tftpboot to 777 if you don't want this use, chmod in a more limited way.
The tftp program running on Centos / trixbox® is “atftpd” a Trivial File Transfer Protocol Server and it should be running by default.
It is very useful when atftpd is serving files to a phone to monitor the logs so that you can see what is happening “live”. To do this you need to watch the atftpd log file. For this run
tail -f /var/log/atftpd.log
This displays the last 10 lines of the log file and automatically refreshes the display. To exit this ctrl^C
Upgrade process
Check the existing firmware on your phone to find out what version and protocol you are starting from. With very early firmware you may need to do a downgrade as we did.
e.g. P003AM30 This version has an upgrade problem that needs resolving
Here is the Cisco field notice that describes the issue. This link on the asteriskguru.com forum also has more information.
One phone was running P003AM30 and the process was as follows:
Downgrade from the stock P003AM30 to POS30203 and this requires P0S30203.bin
The firmware is referenced on voip-info.org check for the download links near the top of the page. Older images are under the heading “Archived Images”.
Note that up to this version the phones will only download files with filenames in the old DOS 8.3 format so that newer files with longer filenames cannot be used.
Note the file OS79XX.txt should contain just P0S30203
Once upgraded the reboot sequence is * 6 settings (all keys together) The unlock / lock sequence is still **#
Then upgrade to P0S3-04-4-00 this is the contents of OS79XX.txt The file needed is P0S3-04-4-00.bin
I used the SIPDefault.cnf generated by trixbox, you run
setup-cisco
I removed all comments and some blank lines because of a suggestion that this (early) version would not work if a file padded with comments was used.
The first line of SIPDefault.cnf was - image_version: "P0S3-04-4-00"
Release 5.0 is functionally equivalent to release 4.4. but is the first firmware to contain signed binaries. So PLEASE NOTE once you have upgraded beyond 4.4 (e.g. to 5) you CANNOT downgrade below 5 because the binary files are signed for V5 and above. It’s recommended that you upgrade to 4.4 FIRST and if that works then go to 5.0 or 5.1 and above.
Upgrade to version 5.1 using P0S3-05-1-00 with a compacted Sip default file Upgrade to version 8.2 made public by Cisco.
This failed so we downgraded to P0S3-06-3-00 (contents of OS79XX.txt)
This worked and the phone showed SIP 6.3, we then moved successfully to Sip 7.5 and on to Sip 8.2 (image_version: "P0S3-08-2-00") and finally 8.60.
To upgrade (or downgrade) to a particular version you need to make sure that the first line of SIPDefault.cnf is edited to show the correct image version
e.g. image_version: "P0S3-08-6-00"
Don’t forget that any other Cisco phones that reboot on the same network will try to use the same image settings.
As far as we could tell, to change the image version it was only necessary to include the contents of the sip-version.zip in /tftpboot and edit the image version in SIPDefault.cnf as mentioned above. Even the OS79XX.txt seemed unnecessary. However, other posting dispute this, so you may be wise to edit the version in this file as well. We will try this on more phones later.
However, changing the image_version set in SIPDefault.cnf to a higher or lower version and on the next reboot the phones would up- or down- grade as necessary.
Troubleshooting
- Watch the phone display as the phone boots and interpret what is happening
- Watch the atptpd.log file with tail as shown above. If the same file name is called over and over again the upgrade is not working.
- An upgrade may take between 10 and 45 minutes. The first upgrade to the more recent firmware took quite a while. But if the upgrade has not completed in the time we suggest and nothing is being served by atftpd and the log shows
Main thread exiting
- Then it has probably failed.
- Go back and try and earlier version.
- By following the incremental upgrades as we have documented above we found the process straightforward.
Conclusion
- At no stage did we interrupt an active firmware update process.
- Initially we had a number of upgrade attempts that did not work, largely because of the 8.3 and long-filename issue that we mentioned at the start of this How-To.
- These failed attempts we characterised by the atftpd.log showing contiunous attempts to download a file, often with a truncated long-filename. We killed these upgrades without any adverse effects on the phone concerned.
- Once we understood the procedures required, as we have documented above, the process went through without a hangup.
Surviving "Protocol Application Invalid"
Scenario
One Cisco 7960G that we tried, would not boot or communicate with the tftp server on our trixbox® server. The only feedback from the phone was an error message “Protocol Application Invalid”. The phone did not appear to be dead but the only keyboard function that worked was a “factory reset”.
Background
Our firewall runs Smoothwall and this has a log file for the DHCP server that supports our network. By viewing the log when the phone tried to boot we could see that the phone was getting an IP address assigned but that was about it.
The phone would do a factory reset and ask for “1” to save network settings or “2” to clear network settings. So it was clear that the phone was not dead (bricked), just unusable!
Fixing the problem
Using the error message in a search engine we found this cisco link suggesting that you need to set option 150 as a setting in DHCP server.
However, this was the main link that helped solve the problem.
It describes how to set up dhcpd.conf to supply this “option 150”. It proved difficult to add the option to the Smoothwall dhcp server, so we stopped the dhcpd server on our firewall and started up the one on our Centos / trixbox® server.
setup-dhcp
This generates a skeleton dhcpd.conf and sets DHCP to start at the next boot. It does not start the dhcpd server. See below.
You then need to edit /etc/dhcpd.conf to reflect your network settings and add the option 150
we added the following two lines into dhcpd.conf
option voip-tftp-servers code 150 = ip-address; option voip-tftp-servers 192.168.x.x; Note: ip-address is a variable for this option leave it written the way it is.
Obviously make sure that the IP addresses match your local needs you can view it by running
cat /etc/dhcpd.conf
Note: 192.168.0.1 is our Smoothwall firewall, acting as the gateway 192.168.0.130 is our trixbox server and the IP for the tftpd server 192.168.0.150 through 192.168.0.175 is the IP range offered by DHCP
Our final file looked like this:
ddns-update-style interim; ignore client-updates; option voip-tftp-servers code 150 = ip-address; option voip-tftp-servers 192.168.0.130; subnet 192.168.0.0 netmask 255.255.255.0 { option routers 192.168.0.1; option subnet-mask 255.255.255.0; option nis-domain ""; option domain-name ""; option domain-name-servers 192.168.0.1; option ntp-servers 192.168.0.130; option tftp-server-name "192.168.0.130"; range dynamic-bootp 192.168.0.150 192.168.0.175; default-lease-time 3600; max-lease-time 7200; }
Start / Stop DHCP server on Centos / trixbox
If you are already running the DHCP server on your trixbox server You may need to restart it
/etc/rc.d/init.d/dhcpd restart
If you just want to run it for this upgrade task and it has not run before
/etc/rc.d/init.d/dhcpd status
will tell you whether it is running or not
/etc/rc.d/init.d/dhcpd start /etc/rc.d/init.d/dhcpd stop work as expected and will start or stop the dhcp daemon
Conclusion
Once the DHCP server was running with the option 150 added to the config a reboot of the troublesome 7940G immediately obtained a suitable IP address and then contacted the tftpd server.
The phone pulled the appropriate firmware and configuration files down, and successfully completed an upgrade to SIP 8.60.
Of course you need to have the correct firmware on /tftpboot together with SIPDelault.cnf and a SIPmacaddress.cnf to match the MAC address for your particular phone.
Postscript
- If you don’t want to leave the DHCPD server running and DO NOT want it to start when you next reboot.
/etc/rc.d/init.d/dhcpd stop stops the dhcp daemon
running setup-dhcp changes the boot time options for the DHCP daemon. you can show the current status by running
chkconfig --list dhcpd you will get an output such as:
dhcpd 0:off 1:off 2:off 3:on 4:on 5:on 6:on
if you do not want DHCP running at the next reboot
chkconfig --level 123456 dhcpd off
you should end up with
chkconfig --list dhcpd dhcpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
Useful Links for Cisco 7940 & 7960
We have gathered and recorded here links to web resources that helped us with our setting up our Cisco phones to run with trixbox®.
- Configuring Cisco 79xx phones with Asterisk. There are other pages describing Cisco phones on the voip-info.org wiki, use the search option and the model number to locate them.
- An Overview of the Cisco 7940 / 7960 IP Phone
- Cisco Phone Documentation
- 7960 Documentation
- Converting a Cisco 7940/7960 CallManager Phone to a SIP Phone and the Reverse Process
- Cisco SIP Configuration Guide
- Cisco 7940 and 7960 IP Phones Firmware Upgrade Matrix
- How to perform a "Factory Reset"
- To reboot a SIP Cisco, Press * 6 settings_key at the same time
- Setting Cisco Ring Tones