Category Archives: VoIP

Engin updates their software and breaks routing

Engin updated their software a while ago and broke inbound switchboard distinctions. The To SIP header used to contain the switchboard number but now it doesn’t.

Incase you dont understand what this is about, engin is an Australian VoIP provider that allows “switchboard” numbers to be added for $5 per month to an account. This is great for saving money with 1300 numbers and provides local answer points that still come back to a single place. As we are migrating many customers away from Telstra (and hosting the VoIP asterisk system in the cloud at rackspace) this is a necessary function to determine where the calls came from.

Heres updated code that will work.


exten => _X.,1,noop(ENGIN STARTING)
exten => _X.,n,Set(ENGINH=${IF($[${LEN(${ENGINH})} > 0]?”${ENGINH}”:”${SIP_HEADER(TO)}”)})
exten => _X.,n,Set(ENGIN=${CUT(ENGINH,:,2)})
exten => _X.,n,Set(ENGIN=${CUT(ENGIN,@,1)})
exten => _X.,n,GotoIf($[${LEN(${ENGIN})} > 0]?ext-did,${ENGIN},1:ext-did,${EXTEN},1)


just set the context for incoming calls to ext-engin and then this will send all calls back to the ext-did context with the appropriate target based on which switchboard number was used.



Engin are cool

Ok, Before we start I should tell you that I am an engin dealer and ordering through the link will give me some commission. That said, If you want to not do that, you can still sign up at and not have to give me anything.

Engin is an australian voip provider that offers fantastic service. We have many people who are customers (where I work at ilb) and I’m yet to hear of a bad report. They are cheap, easy and offer brilliant service quality. Even over a shared ADSL line, voip for home is now really achievable (although quality will degrade if theres too much other network usage). For businesses, we always use a dedicated ADSL (512k sym) connection and have no complaints.

Its great to see an Australian company truly operating on the same level as the companies in the US where they population density makes things easier.

Engin Ordering Page

Trixbox, Caller ID (CID) and ENGIN

Trixbox has what i consider to be a strange behaviour where an extensions Outbound CID will override the trunk CID.

Using engin, i wanted to supress caller id on all outgoing calls. This is easy, i hear you say just by prefixing numbers with 1831. For engin, this works for everywhere but an 07 number. I called them about it and they told me that its not a problem at their end. This seemed strange to me as other Australian numbers worked perfectly. Anyway, i discovered that if you use a PAP2T or a SPA-3000, and supress caller id with them, the CID sent to engin is “anonymous”.

I now knew how to supress it but had trouble getting trixbox (or FreePBX) to actually use it. I decided that I could use the “Emergency CID” field in FreePBX Extensions and only mark engin as the emergency route. Then on the outgoing routes, tick Emergency for the numbers you want to supress caller id on.

I know its a bodgy solution but it works and i would present a normal CID for emergency calls anyway.

engin switchboard – Knowing which number was called

Using engin I was having trouble as all incoming calls from switchboard numbers were appearing on my primary number.

This was annoying as I wanted more control in the inbound routes of trixbox. The following extensioins_custom.conf contect worked for me.

include => ext-did
exten => _X.,1,SIPGetHeader(Var_TO=To)
exten => _X.,n,Goto(ext-did,switch${Var_TO:5:10},1)

As you can see, the SIP header contains a TO header which can be looked at. I simply add a Custom app inbound route for the main number like “custom-from-engin,${EXTEN},1” and using the above context, it re-routes the call back to the inbound contect (ext-did) with thenumber called with a “switch” prefix.

Then its just a simple matter of adding inbound routes like
switch0297990000 and making them do as you like.

Nokia SIP client using international numbers

When using my new Nokia E65 and dialing out with asterisk, it would often fail as i couldn’t dial a + (international option).

using Trixbox, the + character is reserved in outbound routes so i had to use extensions_custom.conf to make the following changes…

exten => _+61XXXXXXXXX,1,Goto(from-internal,0${EXTEN:-9},1)
exten => _*X.,1,Goto(from-internal,${EXTEN},1)
exten => _X.,1,Goto(from-internal,${EXTEN},1)
This allows  my saved phone entries witha + to work.

Obviously, unless you live in Australia,  you may want to change the +61 to something else.

Also, even though asterisk doesn’t appear to list + as a dialplan option, it works.

Tested in asterisk 1.2.4 and 1.2.5