Cisco 7960 and Trixbox

I wrote the other day about getting the borrowed Cisco 7960 phone working with my Trixbox server. The phone was pre-provisioned and locked to my office’s PBX so the first thing I needed to do was to try and unlock it so I can edit the configs. A call over to a buddy said the password to unlock it was cisco. I was afraid I was going to give away some confident information, but lo and behold:

Notice what the next section says:

Power on your phone and connect it to your network. You will need to change the IP address of your phone to a free one on your network or enable DHCP is you have a DHCP server.

Unlock your phone by pressing **# (for old firmware) or selecting unlock config from the config menu and type in the password (default is ‘cisco‘)

Change the IP address or enable DHCP. Enter the IP address of your Asterisk@Home box in the TFTP server field. If DHCP is enabled you will have to select alternate TFTP server = yes so you can edit the TFTP field.

The rest of the information there appears to be out of date. I was happy with most of the settings but I did change the following to reflect my current setup.

  • Hostname
  • Domain name
  • TFTP Server
  • Alternate TFTP Server: changed to YES

So far, so good. I saw in my TFTP logs that the phone did try to grab some files after it rebooted. Next, I found this link:

Notice the second section of that page has the download link for the Cisco 7960 latest firmware. I don’t want to link to it directly, but you can see it there yourself. The phone I have is already provisioned for SIP and if you have one that is not, I gather you have to load the SIP firmware to get it going. I saw a lot of references to doing but didn’t pay it much attention since I am already set up for SIP.

I used wget to download the firmware right to /tftproot on my Trixbox server. I then unzipped the files in that directory. Pay attention to this file, it is important:

[root@voip2 tftpboot]# cat OS79XX.TXT
P003-08-6-00
[root@voip2 tftpboot]#

That’s the version of the firmware I just downloaded. This is important since other scripts will use this to generate the 7960’s provisioning files.

Next I saw a reference to running a script called, setup_cisco on the Trixbox server. I ran it and got back the following:

[root@voip2 tftpboot]# setup-cisco

————————————————————–
Creating a default config file for Cisco 7960/7940 phones
————————————————————–

Creating /tftpboot/SIPDefault.cnf…

Created /tftpboot/SIPDefault.cnf using 192.168.0.8 for the proxy. If the
IP address of your Asterisk system changes run this script again and reboot
your Cisco phones by pressing *-6-settings at the same time.

[root@voip2 tftpboot]#

Nice, I am liking this. If you look at this file, it should make sense to you. It has ALL the settings that are important from your Trixbox server. I noticed one thing that should be changed.

[root@voip2 tftpboot]# head SIPDefault.cnf
# Image Version
image_version: “P0S3-07-5-00”

# Proxy Server
proxy1_address: “192.168.0.8”

# Proxy Server Port (default – 5060)
proxy1_port:”5060″

# Emergency Proxy info
[root@voip2 tftpboot]#

We just downloaded the latest and greatest firmware, right? So we need to change the Image_version to match what is in the OS79XX.TXT which is P003-08-6-00.

[root@voip2 tftpboot]# head SIPDefault.cnf
# Image Version
#image_version: “P0S3-07-5-00”
image_version: “P0S3-08-6-00”

# Proxy Server
proxy1_address: “192.168.0.8”

# Proxy Server Port (default – 5060)
proxy1_port:”5060″

[root@voip2 tftpboot]#

Notice that I just commented out the original line. Force of habit, I guess but it is up to you how you edit it.

Notice that Trixbox has an “Endpoint Manager” with a link for “CiscoPhones.” This should make it really easy for you to add your phone. But wait, you need to add an extension first before you go through this provisioning piece. Surely, you know how to add an extension, right? At this point, the hardest thing was to come up with a name for this extension, since at this point I have at least twice the amount than people in the house. Make sure when you create your extension, you set NAT to No!

Once you have your extension setup, let’s add the phone via the Endpoint Manager.

  1. In your web browser, make sure you are in admin mode, (you should already be since you are admin’ing extensions.
  2. Go to Asterisk -> EndPoint Manager -> Cisco Phones
  3. Choose the extension you just made, pick 7960 from the dropdown and enter the MAC address with out the “:’s”. For example, 0013F3677617 (Note, not my real MAC address.) The MAC Address is on a sticker on the bottom of the phone. Click Submit
  4. This is where I had a problem. Permissions did not seem to be set properly on my /tftproot directory. I don’t remember if I did something or if it was like this out of the box. But once I hit submit, I got the following error:

    Warning: fopen(/tftpboot/SIP0013F3677617 .cnf): failed to open stream: Permission denied in /var/www/html/maint/modules/11_endpointcfg/endpoint_cisco.php on line 147

    Since http runs as user asterisk I simply ran the following command:

    [root@voip2 tftpboot]# chmod o+w .

    Now when I hit submit, I see the phone added to the menu. I also see this file in my /tftproot:

    -rw-r–r– 1 asterisk asterisk 973 Mar 16 23:37 SIP0013F3677617.cnf

  5. Now, in the /tftproot directory, there is a cisco_util directory that has the following in it:

    [root@voip2 cisco_util]# pwd
    /tftpboot/cisco_util
    [root@voip2 cisco_util]# ls -la
    total 16
    drw-rw-rw- 2 root root 4096 May 4 2006 .
    drwxrwxrwx 6 root root 4096 Mar 16 23:37 ..
    -rw-r–r– 1 root root 839 May 4 2006 xmlDefault.CNF.XML
    -rw-r–r– 1 root root 839 May 4 2006 XMLDefault.cnf.xml
    [root@voip2 cisco_util]#

    The files are the same, but apparently the capitalization matters to different firmware versions, so they are covering the bases. Remember the OS79XX.TXT file? That’s right. We need to update both of these files with the right version of the firmware. Change the following in both files to:

    <loadinformation8 model=”IP Phone 7940″>P003-07-4-00</loadinformation8><loadinformation7 model=”IP Phone 7960″>P003-07-4-00</loadinformation7>

    To:

    <loadinformation8 model=”IP Phone 7940″>P003-07-4-00</loadinformation8><loadinformation7 model=”IP Phone 7960″>P003-08-6-00</loadinformation7>

  6. There seems to be some disagreement around these files. Should they be in /tftproot or should they be in /tftproot/cisco_util. Not real clear to me and the /var/log/aftpd.log seems to show them being grabbed from the root directory. We’ll try it.
  7. Next, we need to check out the dialplan.xml file. Mine has really nothing in it. This page mentioned above has a section all about the dialplan. Basically, the default plan waits for 5 seconds before initiating the call. I know this would bug my wife so I’ll change the dialplan to start the call upon immediately matching our pattern we’ve been using with Trixbox; 9+XXXXXXXXXX. We have 10 digit dialing were we live and Viatalk wants you to dial a “1” with every number. When we dial 9+ our number, the Trixbox server sends the number to Viatalk the way they are expecting it. So, based on the examples in that page, I make it look like this:

    <dialtemplate>
    <template match=”9,……….” timeout=”0″>
    </template> </dialtemplate>

  8. To summarize, we need five files in the /tftproot:
    1. OS79XX.TXT
    2. P003-08-6-00.bin
    3. P003-08-6-00.sbn
    4. P0S3-08-6-00.loads
    5. P0S3-08-6-00.sb2
    6. SIPDefault.cnf
    7. SIP0013C3677610.cnf
    8. RINGLIST.DAT
    9. dialplan.xml
    10. xmlDefault.CNF.XML
    11. XMLDefault.cnf.xml

    The last two may need in cisco_util or in the root directory.

  9. Reset the power and cross your fingers! As my phone comes back up, I see it hit the logs and there were flashing lights of red and green, messages of verifying load, copying to bank 1, etc. It has done it more than once at this point.
  10. DST Settings. In you SIPDefault.cnf make the time section look like to get the correct DST settings in the US:

    # Time Server
    sntp_mode: “unicast”
    sntp_server: “192.168.0.8” <- whatever your Trixbox server IP address is
    time_zone: “EST”
    dst_offset: “1”
    dst_start_month: “Mar”
    dst_start_day: “”
    dst_start_day_of_week: “Sun”
    dst_start_week_of_month: “2”
    dst_start_time: “02”
    dst_stop_month: “Nov”
    dst_stop_day: “”
    dst_stop_day_of_week: “Sunday”
    dst_stop_week_of_month: “1”
    dst_stop_time: “2”
    dst_auto_adjust: “1”

  11. Configure Line 2 for troublefree call waiting. Found again on this page:

    Call Waiting Feature

    The 79XX series phones have a good way of handling SIP registrations provided the Call Waiting feature isn’t turned off. Most other SIP phones require an individual SIP username and password for each line appearance. Instead, the 79XX will automatically roll-over to the next available line. So, for example, on a 7960 you can have all six lines programmed to the same SIP username/password and the phone will automatically handle the call waiting function. Note: If you use any other method of ringing multiple lines on the phone (i.e. dialing SIP/123&SIP/456) your phone will show a confusingly high number of missed calls.

    Examples are on that page but if you got this far you can probably figure it out.
    TroubleShooting!
    Well, as luck would have it, I appeared to be stuck in a reboot loop. Watching the tftp logs, I kept seeing the following attempts for these files, which I don’t have:

    atftpd[8119.-1208575056]: Serving CTLSEPMACADDRESS.tlv to 192.168.0.52:50337

    atftpd[8119.-1208575056]: Serving SEPMACADDRESS.cnf.xml to 192.168.0.52:50338

    Ofcourse, MACADDRESS is really the MAC address of the phone.

    To the rescue, I find this page:

    This addresses the SEP file. I created that file OUTSIDE of the /tftproot directory since I didn’t want to risk the phone grabbing the file before I had a chance to edit it.

    I found this page over at Cisco that said the following:

    The CTLSEP MAC file is the first file requested in the universal application loader, followed by the additional six configuration files in the hunt algorithm defined in the “Universal Application Loader” section. If the CTLSEP MAC file is present, the phone proceeds with additional security actions regarding phone and server communication; if the CTLSEP MAC file is not present or is empty, the phone proceeds in nonsecure mode with the hunt algorithm.

    I guess I don’t need it, either of them.

    I am still having problems. I noticed that the phone is trying to grab a file that doesn’t exist:

    atftpd[8119.-1208575056]: Serving P003-08-6-00.loads

    The file that came from the zip file is actually:

    P0S3-08-6-00.loads

    I tried to be smart and copy the original to match the name of the one the phone is trying to get. Now it loads and I now get a “File auth error.” I realized that I had made a typo in the SIPDefault file. It is corrected in the example above.

    The phone is working and I was able to call out and call internal extensions!


One thought on “Cisco 7960 and Trixbox

  1. Pingback: Cisco 7960 and Trixbox; the whole enchilada at Eat your Vegetables!

Comments are closed.