Introduction
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:
Rebooting the phone
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.Upgrading to SIP firmware
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:Configuring the phone to connect to Asterisk or another SIP provider
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):SIPDefault.cnf
#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
SIP<MAC>.cnf
#The following lines contain the authenication detailsline1_name: line1
line1_authname: "line1"
line1_displayname: "line1"
line1_password: "supersecret"
So now you should be able to boot your phone and make and receive calls. Good for you!
Setting the time
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 worldsntp_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
Phone directory
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:SIPDefault.cnf
#The directory_url contains a URL to the directory XML filedirectory_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!
Example directory file
<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>
Voicemail number
The 7940 has a voicemail button that dials your viocemail. Sound clever? It's just a config directive that tells it which number to dial when thebutton is pressed. Add the following to your SIPDefault.cnf: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
This means that when you press the message button it will dial 8501 which Asterisk will call voicemail and pass the number of your phone to the Voicemail. This will go stagiht to that mailbox number without having to enter it. If the voicemail box for that phone does not match the phone's callerID num, you could pass it statically, of course.
No hay comentarios:
Publicar un comentario