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.

[ext-engin]

exten => _X.,1,noop(ENGIN STARTING)
exten => _X.,n,Set(ENGINH=${SIP_HEADER(DIVERSION)})
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.

ย 

ย