I picked up a great deal recently on a Cisco 6901 IP phone from eBay, and wanted to use it as a small unobtrusive phone for calling another fixed line over SIP.

I usually use Asterisk for PBX-related fun, so installed the latest version on a linux box and set to flash my new phone with SIP firmware. By default, Cisco IP Phones ship with SCCP, or Skinny Call Control Protocol firmware, usually used with Cisco CallManager.

Flashing the phone with SIP firmware is relatively easy. Grab a copy of the firmware, in the form of a TAR archive, cmterm-6901_6911-sip.9-2-1-0.tar for SIP, or cmterm-6901_6911-sccp.9-2-1-a.tar for SCCP. Extracting either of these gives a list of files which can be placed in a TFTP Server for distribution to the phone.

Cisco 6901 IP Phone, a grand total of £3.50 from eBay including postage!

When the phone boots, it will search for a TFTP Server using DHCP option 150, or in the 6901 you can set this manually by picking up the handset and pressing *, 0, # at the same time and typing the default PIN of 24726 at the voice prompt.

Once it finds the TFTP Server, it will load SEPxxxxxxxxxxxx.cnf.xml, where the x's are replaced with the phone's MAC Address. If the phone is in SIP mode, it will typically also load dialplan.xml, and if it's in SCCP mode, it will typically also load XMLDefault.cnf.xml which defines default actions for unconfigured phones.

The next stage is the config files. Here are some for the Cisco 6901:

SIP - SEPxxx_6901_SIP.cnf.xml
SCCP - SEPxxx_6901_SCCP.cnf.xml, XMLDefault.cnf.xml

Notice the <loadInformation>...</loadInformation> tags tell it the filename from the firmware to load, for example SIP6901.9-2-1-0.loads, which you should place in the root of your TFTP server.

Now, when you boot the phone it should load its config file from your server along with its firmware. You can verify this by using tcpdump -i eth0 port 69, or your favourite protocol analyser.

The phone lights will flash red while upgrading, even though in the manual it says this means firmware failure. Just give it a few minutes (it shouldn't take more than about a minute, in which case there's probably an issue with your config file).

Before we actually flash our phone, i'll highlight one of the quirks of the 6901. It seems there is an issue in the SIP firmware with it not parsing the dialplan.xml file correctly, and hence taking almost 10 seconds from dialing a number to the call actually going through. I couldn't find a fix online despite a lot of searching, hence, I'd recommend that you keep it on SCCP firmware for use with Asterisk.

Hence, I proceeded to set up my asterisk server to use SCCP. For this, I used chan_sccp (https://github.com/chan-sccp/chan-sccp), which is very easy to install and use. I used this guide to install it: https://github.com/Omid-Mohajerani/SCCP-Asterisk/wiki/Installing-CHAN-SCCP-in-Asterisk

When it comes to configuration, I chose to keep mine very simple, using sccp.conf.minimal from the conf/ directory of the git repo to configure my device. The nice thing about the SCCP firmware is that the dialplan is handled by asterisk itself, which pattern-matches numbers as you press them, rather than by the phone. This means you get ultra-fast dialing to any extension registered in your PBX by default!

Now comes the fun part; I wanted this phone to auto-dial an extension when you take it off the hook, and it seemed that chan_sccp supported two ways to do this.

The first way was to use the hotline feature. This is typically used for unregistered phones, forcing them to only call one number when they are taken off-hook until they are provisioned an extension. hotline is useful as you can apply it globally to all unregistered phones, or select is as a line for individual ones. Sadly for us, we can't use hotline with our single-line 6901 as it takes up one of the line 'slots', meaning we can't have an incoming number to be able to call the 6901 and it can only call outwards.

If you want to configure hotline, simply add the following options to /etc/asterisk/sccp.conf:

[general]
hotline_enabled = yes
hotline_extension = 3001
hotline_context = internal

[SEPXXXXXXXXXXXX]
type = device
devicetype = 6901
description = testdev
button = line, Hotline
Enabling Hotline

Now, you can reload your phone and asterisk SCCP config by opening the asterisk CLI (asterisk -r) and running sccp reload. This is nice as it also reloads configs in the phones, and you don't need to reboot them to acquire new config like you would with SIP. If you want more verbosity for figuring out what's going on, you can use the command core set verbose 4.

Now when you pick the phone up, it will auto-dial extension 3001 in the internal context, but won't have a line for incoming calls.

The easier way to configure automatic off-hook dialing, and the way I ended up using, is to use the adhocNumber parameter. Simply place this in a [line] section in sccp.conf, and the phone will have an incoming line and also initiate a call when taken off hook. Perfect.

/etc/asterisk/sccp.conf

[general]
; You can leave hotline enabled for unregistered phones
; if it might be useful, but here it's commented.
; hotline_enabled = yes
; hotline_extension = 3001
; hotline_context = internal

[SEPXXXXXXXXXXXX]
type = device
devicetype = 6901
description = testdev
button = line, 7824

[7824]
type=line
id = 7824
pin = 1234
label = my line
description = my desc
context = internal
cid_num = 7824
cid_name = myline
adhocNumber=1001        ; this is the extension that will be dialed when you go offhook.
Configuration of adhocNumber for auto-dialing