Just thought I’d update this thread so that anybody in the future trying to do this can benefit from my partial success.
First off many thanks to Ian, without whom’s help I wouldn’t have got this far.
Ok first off a quick summary of what I wanted to achieve.
I wanted to add ‘VOIP’ extensions to our existing Mitel SX2000 using Asterisk and a TDM400P card with 4 FXO modules as the link between the two.
The extension numbers must be in the same range as our existing ‘standard’ extensions and external DDI must also function.
I did not want to be limited to ‘4’ VOIP extensions i.e. the number of ports on the TDM400 therefore the link should operate like a ‘trunk’ and not just a bunch of extensions.
I am using Asterisk 1.2.5 and Zaptel 1.2.4
Ok on the SX side.
If you don’t already have one create a class of service of type ‘voice mail’
To do this create a new class of service and set the following option :
COV/ONS/E&M Voice Mail Port = YES
Connect the TDM400 to 1 or more ONS extension ports on the SX, for each of these ports set the COS to the number of the Voice Mail class of service as above.
Create a new hunt group of type ‘VoiceMail’ and add all the above extensions to it.
Now for each VOIP extension create a new hunt group using the required extension number e.g. I wanted a VOIP extension with a number of 223 so I created a hunt group 223.
Leave the ‘Hunt Group’ type as Voice.
You will need to add at least 1 extension number otherwise the SX won’t allow you to create the hunt group, use any existing ‘standard extension’ number.
Save the new hunt group.
Re open the newely created hunt group and remove the 1 extension added during creation, save the changes to the now blank group.
Open the ‘Call Rerouting Always Assignment’ form.
Choose an unused number and change the value of DID/TIE/CO/INTERNAL to ‘reroute’, for the directory number enter the number of the Voice Mail hunt group you created previously.
Save your changes and move to the ‘Call Rerouting Assignment’ form, scroll down the list until you find the ‘VOIP’ extension number hunt group you created earlier. Under the Always alternative section assign the reroute always number that you have just configure in the previous step to the DAY/NIGHT1/NIGHT2 options.
The configuration of the SX is now complete.
For additional ‘VOIP’ extensions simply create ‘empty’ hunt groups using the ‘extension number’. Then assign the same Call Rerouting Always value for these new ‘extensions’ in the ‘Call Rerouting assignment’ form as per the very first extension created.
On the Asterisk side.
In your dial plan modify the incoming context used by your TDM400 as follows:
exten => s,1,Answer()
exten => s,n,WaitExten(5)
exten => ,1,Dial(,)
And thats it.
Ok so how does this work?
Well when the VOIP extension is called from a traditional extension or DDI incoming call the SX reroutes the call as per the ‘Call Reroute Always’ setting. I.e. the call is sent to a free line on the TDM400.
As the ‘hunt group’ used is set as ‘VoiceMail’ after the Asterisk box answers the call the SX2000 sends the ‘called’ extension ID using DTMF tones to the Asterisk box, which the WaitExten command picks up and uses to jump in our dial plan.
So what doesn’t work, well with the ONS cards I have the TDM400 doesn’t detect if the SX hangs up the line. As such you will need to ensure you set ‘timeouts’ for every option involving calls ‘from’ the Zap channels.
If a caller from the SX hangs up before the VOIP extensions answers the Asterisk box will not notice and instead will continue to ring the VOIP extension.
Also Calling Line ID is not presented by the SX.
Hope this helps someone in the future.
Many thanks again to Ian, who is investigating an alternate ONS card that might solve the problem of undetected hangups.