Asterisk and Mitel 5340 myth Demystified

We have our pbx in a flash server (Asterisk) running with a bunch of softphones (because they’re free), and it works great but what is a sip based pbx if you can’t use it with a real sip based hard phone?

With that said all we had available to us were a bunch of Mitel dual mode 5340 phones sitting on our desk running the Minet protocol. We figured why not take advantage of the fact that we had some really cool sip based phones at our disposal. And that’s just what we did, we got the 5340 phone working with our asterisk server. (really cool stuff)

Now your probably wondering how we did it? Well in searching for answers across the internet we found very little information, but lucky for you we figured it out. We know knowledge transfer is one of our civic duties, so sit back and let us show you how to get your mitel phones working on your Asterisk system.

Disclaimer: Unfortunantely we were only able to test this on the Mitel 5340 model phone running firmware version R7.0.01.02.01.08 but we believe this will run for most of the newer model phones running version 7.0 and up.

Step 1.

Setup your dhcp server (we used a microsoft dhcp server but you can use whatever you like) with the following options

Typical DHCP Options

Option 003 Router – IP address of your default gateway

Option 006 DNS Servers – IP address of your dns servers

Mitel Dependent Options

Option 042 NTP Servers – ip address of your ntp servers

Option 066 Boot Server Host name – ip address of your asterisk server

Option 128 Asterisk Tftp server – ip address of your asterisk server or wherever your hosting tftp files.

Option 138 Mitel Sip ID – 200

After you’ve completed your dhcp settings its on to learning a bit about configuring the mitel 5340 phones.

For those of you that aren’t using dhcp and want to set static values for your phone all you have to do is hold down on the super key (the blue key on the Mitel 5340) while your phone is powering up. Make sure you follow the onscreen prompts and don’t forget to add your proxy (asterisk) server and the tftp server. Without these your phone will never register.

Step 2.

In order to change the Mitel 5340 to use sip you have to hold down the * 7 (that would be the star and number 7 keys at the same time) while the phone is powering on. Hold down on those two keys until the change is confirmed.

Now reboot it to confirm that it is in sip mode. You can either do this by holding down the *7 keys and wait for the message that says “already in sip mode” or wait until the phone boots and says “Starting Sip…”

Once you’ve confirmed its running in sip mode all you technically need is a user that is setup on your asterisk server. Just enter your user id when the phone prompts you to login. Here’s the not so nice part about it, because Mitel doesn’t allow you to enter the password for the extension or user that you have setup your phone will never register properly. Lucky for you there is an easy fix, all you need to do is log into the web admin interface of the phone. Type in the ip address of the phone in any standard browser and enter “admin” as the username and “5340” as the password. (This can be changed at anytime through the browser or your config file) Click on “Users and Passcodes” and change the passcode there. Now click on “Registration” and hit Re-register. You should now see your phone registered to the asterisk server and be able to make and receive calls on it.

Simple right!!

Now on to the even cooler stuff. Its up to you at this point if you want to go any further. The next section will tell you how to setup config files and firmware so you can deploy multiple phones all at the same time.

Unfortunately we cannot download firmware from Mitel’s site because we are not a partner so unless you are a Mitel partner you’ll have to use the existing firmware on your phone.

If you plan on upgrading phones and applying configurations to individual phones you’ll need to upload the firmware and create the individual config files for your phones to use.

Mitel config files are pretty cool in that they are easy to use and understand because of the xml based structure.

Step 3.

Here are the files that you will need create or just download from here:

Download “MC_(Mac_Address).cfg.zip” MN_Mac_Address.cfg_.zip – Downloaded 932 times – 508 B

Download “MN_(User).cfg.zip” MN_User.cfg_.zip – Downloaded 729 times – 494 B

Download “MN_Generic.cfg.zip” MN_Generic.cfg_.zip – Downloaded 855 times – 483 B

Complete xml config file example: 

Download “Sample_Complete_MN_Generic.cfg.zip” Sample_Complete_MN_Generic.cfg_.zip – Downloaded 875 times – 3 KB

Note: The phone will boot and look for those configuration files in that exact order.

We found that a good base to start with is configure a complete NM_Generic.cfg file that will allow to setup and configure all of the buttons, and all the necessary options to get the phone up and running. Then create a MN_<Mac Address>.cfg file for each individual phone that will contain all display name and line information.

And thats all there is to it. You should be on your way to rolling out hundreds of mitel phones on your asterisk system in no time.