This is another guide that was born out of extreem frustration. After spending weeks trying to get my CISCO 7940g to work with Asterisk, I decided to document the event for future generations.
The phones can be picked up cheap on eBay and also work nicely with Asterisk after some fiddling. However, there are a few points to bear in mind:
The first thing you probably want to know is how to reboot the phone. Hold down "*", "6" and "settings". The settings button is the bottom right of the group of four buttons around a circular, green question mark button. It has a box with a tick in it on the button.
I don't want to cover this in too much detail as it's repeatadly documented all over the Internet. There are a few points to bear in mind:
Let's start by assuming that you have managed to get a firmware upgrade to the lastest version of the SIP firmware. Now you need to configure the phone. When the phone boots, it downloads the firmware from the TFTP server and also pulls down some config files. You need the following files on the TFTP server (assuming you are using 8.9):
There are two configuration files to use. SIPDefault contains settings that apply to all phones. SIP<mac>.cnf contains settings that apply to a single phone, indentified by MAC address. The following is an example of the minimal configuration needed to get the phone to register to either Asterisk or another SIP provider:
#image_version shows the firmware image to get from the TFTP server. Note this shouls start P0S and not P00.
image_version: P0S3-08-9-00
#Proxy server address should probably be more accuratly be called the SIP server
proxy1_address: x.x.x.x
#proxy_register tell it to connect to the SIP server (why would you want to set this to 0?!
proxy_register: 1
#The following lines contain the authenication details
line1_name: line1
line1_authname: "line1"
line1_displayname: "line1"
line1_password: "supersecret"
This is a bit of a mission. You set the NTP server and timezone but also have to set the details of when Daylight Saving Time starts and finishes. Fortunatly the rules are available here and it seems that DST is stardardised across the EU. The following example goes in SIPDefault.cnf and should get you going for the UK. Change the time zone for Europe. Change something else for the rest of the world
sntp_server: "pool.ntp.orgt"
sntp_mode: unicast
time_zone: GMT
dst_offset: 1
dst_start_month: March
dst_start_day_of_week: Sun
dst_start_week_of_month: 8
dst_start_time: 01
dst_stop_month: Oct
dst_stop_day_of_week: Sun
dst_stop_week_of_month: 8
dst_stop_time: 02
dst_auto_adjust: 1
time_format_24hr: 1
date_format : D/M/Y
The CISCO phone directory is stored in an XML file that can hold 32 numbers. You can either get the phone directory XML file directly or use a form to send a search criteria to a script that returns matching results. Firstly you have to assign a button to the phone directory. There are various programmable buttons on the phone that you could use but since one is marked "directory" it makes sense to use that. First you add an entry to the SIPDefault.cnf, telling it what to do when the directory button is pressed. In the example below, pressing the button will GET directory.xml via HTTP:
#The directory_url contains a URL to the directory XML file
directory_url: "http://www.example.com/directory.xml"
directory.xml could just contain a phonebook in XML, like the example directory file below. This is fine if you don't want to search and don't have more than 32 entries. If you do, you have to do things a little differently. You can add the following to directory.xml:
<CiscoIPPhoneInput> <Title>Phone book</Title> <Prompt>Prompt text.</Prompt> <URL>http://www.example.com/phonebook.pl</URL> <InputItem> <DisplayName>search</DisplayName> <QueryStringParam>search</QueryStringParam> <InputFlags></InputFlags> <DefaultValue></DefaultValue> </InputItem> </CiscoIPPhoneInput>
Now, when you press the directory button, you will be presented with a search screen. You can enter a name and press search. It will then try to GET /phonebook.pl?search=name from the HTTP server. Thus you will have to write a script that searches for the string in your phone directory and returns the results using the CISCO XML format below. This is obviously a lot more work but hey, these are enterprise phones!
<CiscoIPPhoneDirectory> <Title>Directory</Title> <Prompt>Who you gonna call?</Prompt> <DirectoryEntry> <Name>Tom</Name> <Telephone>6905</Telephone> </DirectoryEntry> <DirectoryEntry> <Name>Dick</Name> <Telephone>6906</Telephone> </DirectoryEntry> </CiscoIPPhoneDirectory>
messages_uri: "8500"
So, when you hit the message button it dials 8500, which, as we all know is the default main voicemail number for Asterisk. We can also go a step further and create a number that dials the voice mail. Change the number in the mesasges_uri to 8501 and create the following extention in extentionss.conf:
exten => 8501,1,VoicemailMain(${CALLERID(number)})
exten => 8501,n,Hangup
Asterisk can turn on and off the Message Waiting Indicator on phones. This is simply a case of adding "mailbox