Friday, October 10, 2014

FreePBX and Mitel Phones 5215 and 5220

This has caused me more headaches than I can shake a stick at.

I am fortunate enough to have a very good and knowledgeable telco friend who installed and set up FreePBX for me. It is a very good system. This is not a HowTo for setting up FreePBX.

I landed myself a bunch of Mitel 5215 and Mitel 5220 for pennies. These are SIP capable and should be easy enough to configure. Or so I thought.

Herewith my notes. There are other 5xxx phones in the same family and I believe that this should apply reasonably equally to them. Before you ask, make sure they have a label underneath saying "DUAL MODE". This means they will work with boththe MINET and SIP protocols.

Make sure your FreePBX system is basically up and running. Keep it simple to start with for testing. 2 Devices/Users, one inbound and one outbound route and one trunk. Use strong passwords, but note theses phones only take 20 characters.

For security I suggest where possible you only connect to your server locally or via a secure VPN. It will save you a lot of headaches all round.

I am assuming that your FreePBX server is local or on a 'local' LAN connected via VPN.

Set up your DHCP and TFTPD servers. make sure they work, particularly the logging so you can see what files the phone requests  :-)


Mitel 5215 and Mitel 5220 phones

These are reasonable phones from all accounts. The 5220 is basically identical but has more buttons.

Factory reset and convert to SIP procedure :

Press both Up and Down Arrow keys simultaneously while powering up the
phone.
NETWORK SETTINGS appears
Press NO until TOOLS & FEATURES appears and then press YES
Press NO until RESTORE DEFAULTS appears and then press YES
Press CONFIRM.
The phone resets with default settings.

When the screen goes blank, press and hold the keys * and 7  together. A page will show 'Release to cancel' - continue holding until this goes.

You are now in SIP mode.

Firmware

The first problem to deal with is firmware upgrades. Firmware is available on line but takes a bit of finding since Mitel decided to lock it up and give to their favoured ones only.

Have a search for the following files, but be careful of viruses etc.

SIPPhones_4.0.0.13.zip
SIPPhones_5.0.0.21.zip
SIPPhones_6.0.0.19.zip
SIPphones_7.2.0.4.zip
SIPphones_8.0.0.4.zip

You may find them here :

ftp://ftp.bluefeathertech.com/electronics/telephony/Mitel/mitel-sip

Whatever your level of firmware, raise one version at a time. It can be fatal to jump two levels. This may seem slow and painstaking, but you will end up with a bunch of working phones.

Careful when upgrading via the web panel with a tftp server. If like you me you suffer some sort of disconnect you can brick the bootloader and I haven't seen a solution to this - probably needs some sort of internal JTAG type cabling and a ROM flasher.


You need a working dhcp and tftpd server. Put the firmware in the root of the tftpd server.

Boot the phone in SIP mode. Go to the web page and login (default login is admin and the password is the phone model e.g. 5220 or 5215)

Go to Firmware Update

Choice of Manual download type : TFTP
HTTP : remove the HTTP URL
TFTP : add your server IP

Make sure you set a matching Language under Network Config

Click Update, and wait. Do not disconnect

An alternative is to upgrade using TFTP automatically on boot. This does work but takes a bit of doing. Make sure DHCP and TFTPD are working. Put the firmware in the TFTPD root folder. Make sure the server settings are correct, and the Autoupdate is selected for TFTP.


Another way is via the phone itself. Make sure the TFTP server settings are correct.

Press (SUPERKEY), and then press >> until SETTINGS & OPTIONS? appears.
Press OK, and then press ▼ until UPGRADE FIRMWARE? appears.
Press OK. CHOOSE PROTOCOL appears.
Press the desired protocol (HTTP or TFTP), or press AUTO. BEGIN UPGRADE NOW? appears.
Press CONFIRM. The downloading process begins and the phone reboots. This process may take approximately 1 to 2 minutes bhut possibly longer. Be patient. When the time and date appear on the display, the download and reboot is complete and the phone is ready for use.

Ok, we have our firmware in place.

Next is to configure the phone - if you do this manually you can then save the configuration and load it from your TFTP server at boot time

In simple terms the minimum you really need is as follows. Once you have the basics working, view the configuration and save it. Later we can build config files to load off the TFTPD server.


Minimum settings required :

User List config

User ID  -  (the device ID)
User display name   -   (I use the user/extension number)
SIP Auth Name   -   (the device ID)
SIP Auth password   -   (device ID password)

Line   -   SIP

SIP Proxy   -   (IP of your FreePBX box)
Port   -  5060
Scheme   -  UDP

SIP Registry server   -   (IP of your FreePBX box)
Port   -  5060
Scheme   -  UDP

Outbound server   -   (IP of your FreePBX box)
Port   -  5060
Scheme   -  UDP

Voicemail serve   -   (IP of your FreePBX box)
Port   -  5060
Scheme   -  UDP

Firewall   -   as necessary

Apply. That should be enough to get you registered.


Do a sound/echo test with *43

If all is well, view and then save the config.

OK, tftp config files.

The phone searches for files in this order :


MN_generic.cfg
MN_"Device_IP".cfg
MN_01234567890A.cfg

We'll ignore the Device_ID one.

Note the last is the phone MAC address. It is CASE SENSITIVE and any letters in the MAC must be in uppercase (if you are on Linux - can't speak for Windows)

Generic Settings

Here you can add GENERIC settings that apply to each MODEL of phone

MN_generic.cfg

e.g.
<Parameter Model="5220">
   <dhcpenable>1</dhcpenable>
   <tftp_config>1</tftp_config>
   <pppoe_enable>0</pppoe_enable>
   <tftp_task_enable>1</tftp_task_enable>
   <tftp_upgrade>0</tftp_upgrade>
   <http_upgrade>0</http_upgrade>
   <sip_mode>sip</sip_mode>
   <outbound_state>0</outbound_state>
   <tls_port>5061</tls_port>
   <local_sip_port>5060</local_sip_port>
   <tos>0</tos>
   <e802_priority>-1</e802_priority>
   <vlan_id>-1</vlan_id>
   <sntp>pool.ntp.org</sntp>
   <rss_feed></rss_feed>
   <blf_pickup>*98</blf_pickup>
   <domain>reetspetit.net</domain>
   <lancode>en_GB</lancode>
   <tonecode>GB</tonecode>
   <etc.........>
</Parameter>

  


<Parameter Model="5220">
   <dhcpenable>1</dhcpenable>
   <tftp_config>1</tftp_config>
   <pppoe_enable>0</pppoe_enable>
   <tftp_task_enable>1</tftp_task_enable>
   <tftp_upgrade>0</tftp_upgrade>
   <http_upgrade>0</http_upgrade>
   <sip_mode>sip</sip_mode>
   <outbound_state>0</outbound_state>
   <tls_port>5061</tls_port>
   <local_sip_port>5060</local_sip_port>
   <tos>0</tos>
   <e802_priority>-1</e802_priority>
   <vlan_id>-1</vlan_id>
   <sntp>pool.ntp.org</sntp>
   <rss_feed></rss_feed>
   <blf_pickup>*98</blf_pickup>
   <domain>reetspetit.net</domain>
   <lancode>en_GB</lancode>
   <tonecode>GB</tonecode>
   <etc.........>
</Parameter>


Mac Specific settings


Here you can add SPECIFIC settings that apply to each INDIVIDUAL phone by MAC address

One particular point of note. You may get 'no proxy available' if you try to use the wrong key settings for phones. This caused me no end of grief as I used the wrong key descriptors on one phone.

Make sure you use the correct for the type of phone. If you want to create more bespoke settings, shortcut keys etc, make the changes, save the new configuration file and diff the original and new files. Then copy the changes to the relevant cfg files.

e.g. here are two individual setups for two separate phones.

MN_01234567890A.cfg

<Parameter Model="5220">
   <pkDescription>
      <Key Line="25" Fea="6" Des="Line  1" Addr="" Addr2="" Mode="1" Mode2="1" UserID="8001"></Key>
      <Key Line="26" Fea="0" Des="" Addr="" Addr2="" Mode="1" Mode2="1" UserID=""></Key>
      <Key Line="27" Fea="7" Des="Line 2" Addr="" Addr2="" Mode="1" Mode2="1" UserID="8001"></Key>
      <Key Line="28" Fea="0" Des="" Addr="" Addr2="" Mode="1" Mode2="1" UserID=""></Key>
      <Key Line="29" Fea="8" Des="Line 3" Addr="" Addr2="" Mode="1" Mode2="1" UserID="8001"></Key>
      <Key Line="30" Fea="0" Des="" Addr="" Addr2="" Mode="1" Mode2="1" UserID=""></Key>
      <Key Line="31" Fea="9" Des="Line 4" Addr="" Addr2="" Mode="1" Mode2="1" UserID="8001"></Key>
      <Key Line="32" Fea="0" Des="" Addr="" Addr2="" Mode="1" Mode2="1" UserID=""></Key>
      <Key Line="33" Fea="4" Des="Headset             " Addr="" Addr2="" Mode="1" Mode2="1" UserID=""></Key>
      <Key Line="34" Fea="0" Des="" Addr="" Addr2="" Mode="1" Mode2="1" UserID=""></Key>
      <Key Line="35" Fea="3" Des="Advisory            " Addr="" Addr2="" Mode="1" Mode2="1" UserID=""></Key>
      <Key Line="36" Fea="0" Des="" Addr="" Addr2="" Mode="1" Mode2="1" UserID=""></Key>
      <Key Line="37" Fea="2" Des="Call logs" Addr="" Addr2="" Mode="1" Mode2="1" UserID=""></Key>
      <Key Line="38" Fea="0" Des="" Addr="" Addr2="" Mode="1" Mode2="1" UserID=""></Key>
   </pkDescription>
   <time_zone>+1</time_zone>
   <user_passwd>5d41402abc4b2a76b9719d911017c592</user_passwd>
   <host_name>sip8001</host_name>
   <user_list>
      <User State="1" ID="8001" DispName="5001" Pwd="MySecretPassword" AuthName="8001" Realm="" RegSvr="192.168.1.1" RegPort="5060" RegScheme="2" ProxySvr="192.168.1.1" ProxyPort="5060" ProxyScheme="2" VMSvr="192.168.1.1" VMPort="5060" VMScheme="2" OutSvr="192.168.1.1" OutPort="5060" OutCtr="0" Ring="1" Line="0" EventSvr="" EventPort="5060" EventScheme="2" NatMode="1" NatType="stun" NatIp="0" BlfGroup=""></User>
   </user_list>
</Parameter>

MN_01234567890B.cfg

<Parameter Model="5215">
   <pkDescription>
      <Key Line="25" Fea="6" Des="Line  1" Addr="" Addr2="" Mode="1" Mode2="1" UserID="8002"></Key>
      <Key Line="26" Fea="7" Des="Line 2" Addr="" Addr2="" Mode="1" Mode2="1" UserID="8002"></Key>
      <Key Line="27" Fea="1" Des="5002" Addr="5002" Addr2="" Mode="1" Mode2="1" UserID=""></Key>
      <Key Line="28" Fea="0" Des="" Addr="" Addr2="" Mode="1" Mode2="1" UserID=""></Key>
      <Key Line="29" Fea="4" Des="Headset             " Addr="" Addr2="" Mode="1" Mode2="1" UserID=""></Key>
      <Key Line="30" Fea="3" Des="Advisory            " Addr="" Addr2="" Mode="1" Mode2="1" UserID=""></Key>
      <Key Line="31" Fea="2" Des="Call logs" Addr="" Addr2="" Mode="1" Mode2="1" UserID=""></Key>
   </pkDescription>
   <time_zone>+1</time_zone>
   <user_passwd>5d41402abc4b2a76b9719d911017c592</user_passwd>
   <host_name>sip8002</host_name>
   <user_list>
      <User State="1" ID="8002" DispName="5002" Pwd="MySecretPassword" AuthName="8002" Realm="" RegSvr="192.168.1.1" RegPort="5060" RegScheme="2" ProxySvr="192.168.1.1" ProxyPort="5060" ProxyScheme="2" VMSvr="192.168.1.1" VMPort="5060" VMScheme="2" OutSvr="192.168.1.1" OutPort="5060" OutCtr="0" Ring="1" Line="0" EventSvr="" EventPort="5060" EventScheme="2" NatMode="1" NatType="stun" NatIp="0" BlfGroup=""></User>
   </user_list>
</Parameter>


All things being equal you should be able to go to Advanced features, Reboot, and the phone will pick up the correct settings.

Quick list :

1. Clean boot, go to web page, set TFTPD server
2. Apply firmware
3. Take a copy of the clean config
4. Add basic settings to connect
5. Take a copy of the basic config
6. Make further changes
7. Take a copy of the advanced config
8. Diff and create cfg files
9. Get a beer :-)

1 comment: