Mitel 5000 to Free PBX (Asterisk) Trunk
The first dependency is to have licensing for the number of SIP trunks you would like to create on the Mitel 5000 system. We will be creating a SIP Trunk Group that will require these trunk licences. Each trunk needs a license at the cost of something like $125 a piece for small quantities.
The Mitel 5000:
First, go into System–>Devices and Features–>SIP Peers–>SIP Trunk Groups
Create a SIP trunk Group with just a single extension number. It will probably be something like 9200X. Mine was 92003 but yours could end up being different. Open up the configuration and edit the settings. My configuration looks like this:
The main thing here is just the IP address of the remote system. You are also going to need to go into the authentication options and enter an incoming and outgoing usernames and passwords.
Edit the call configuration for this trunk. Do this at:
System–>IP-Related Information–>Call Configurations
Create a new configuration. You will want to set DTMF Encoding to RFC2833 and Speech Encoding to G.729.
That’s about it for the Mitel side of the trunk. Let’s now jump to FreePBX and configure the trunk on that side.
My trunk settings are as follows:
Name: mitel-a
PEER
username=mitel
secret=PASSWORD
host= REMOTE IP ADDRESS
context=from-internal
nat=never
dtmfmode=rfc2833
type=peer
allow=all
port=5060
User Context: from-mitel-a
USER:
username=mitel
secret=PASSWORD
type=peer
reinvite=yes
port=5060
insecure=very
nat=never
host=REMOTE IP ADDRESS
fromdomain= REMOTE IP ADDRESS
dtmfmode=rfc2833
context=from-trunk
allow=all
You can now test your calling from the Mitel system to the asterisk system by dialing the SIP trunk group number (9200X from above) then a valid extension on the Asterisk. (This setup does not require you to read DIDs off the asterisk side but the Mitel does; more on this in just a bit.) The call should go through. If it does not work verify the call is arriving on the trunk by using the asterisk command shell: asterisk –r
Once you have the call going through from Mitel to Asterisk with the manual trunk dial it is time to add the trunk to the ARS (Automatic Route Selection) table. Get into the numbering plan at: System/Numbering Plan.
Create a new Route Group. Call it something like SIP Trunk Internal. Be warned you can screw up your calling if you not sure what you’re doing… I warned you… Remember the route groups are processed in the order they are listed. The SIP group has to be first to collect a more specific pattern of digits than the other groups. My patterns are as shown below:
The Mitel uses typical pattern matching.
As you can see, I am sending all of the 3000s, 4000s, 5000-6999, and the 8675309 number out the trunk to the asterisk system.
We now have to go to Facility Groups, also under the numbering plan, and create a new group there as well. Facility Groups typically start with a “P” in their extension numbering. Under dial rules in your new Facility Group you will need at least rule number 3 and 4 for typical calling. The Trunk Groups/Nodes category will need to have the SIP Trunk Group added to it. Finally, go back to your Route Group you created a bit ago and add the new Facility Group there.
Since all of that sounds very confusing to someone no-so-familiar with Mitel (as I was when I started this…) I will attempt to explain it all in terms of how the call traverses the groups.
Mitel Extension dials out (with 8 for ARS) –> the call hits route group –> “Yes, the destination phone number matches one of our patterns!” –> Send the call to the facility group defined for this Route Group –> The call will go out the first available trunk listed in the Facility Group.
At this point you should ensure you can call out with “8” and the 4 digit extension on the Asterisk system. Asterisk, however, is a little more flexible and does not require a dialing prefix.
To finish up your FreePBX / Asterisk configuration you will need to do something fairly similar just with a different user interface. We are going to want to create an outgoing route in Asterisk. Simple create a new outbound route and configure it as shown below. The extensions on my Mitel system are in the 2000’s, 2100’s and 2200’s. Yours may be different of course. Be sure to specify a trunk for this rule to use at the bottom then!
At this point we should be able to leave our Asterisk system. The final piece is handling incoming calls on the 5000. SIP configuration on the Mitel 5000 is only going to see a SIP trunk as if it were coming from a CO. Basically what we need to do is run the incoming calls through a routing table like we would with any other CO trunk. Yes, this is a little bit of a hack because of the limits of the 5000. It works and actually increases your flexibility though if you care to be positive…
Go into:
System –> Devices and Feature Codes –>SIP Peers –> Your SIP trunk Group –> Trunk Group Configuration
You should see something like the image below.
We want to change the Ring-In Types. Change the value to Call Routing Table and then select a new call routing table (I chose 2). Go then and edit that call routing table to suite your needs. My table can be seen below. As you can see my table is a one to one match as far as patterns to extensions. This makes it fairly easy to keep track of everyone’s number but you can get creative if you would like…
If you routing table turns out to be a one to one match like mine I would actually suggest an even simpler approach. Change the “Ring-in Type” field to be “Collected Digits” This simply takes the destination digits and preserves them as the call enters into the system. So in the call coming in on the trunk is destin for “2000” the collected digits will be preserved and extension “2000” will ring.
A few settings worth tweaking on the Mitel side are the dial timers. The two I looked at are the “inter digit” long and short timers. These are found at:
System–> Timers and Limits
These dictate the time it takes for the dialed digits to be sent. I shortened the “Long” timer so that when we dialed “8” for ARS and then dial a four digit number, for instance, it doesn’t take forever to commit the number and dial SIP trunk.
That’s about it (I say that as if that whole process was simple). I will be posting troubleshooting tips in the near future to help anyone who is tweaking settings or having trouble getting this to work.
12 Responses to Mitel 5000 / Asterisk Integration