Engin DID Workaround

From Asterisk Australia
Jump to: navigation, search

Engin DID Asterisk WorkAround

Engin DID will not be recognised in Asterisk. We can change this by using the following code.

First, edit the file /etc/asterisk/extensions_custom.conf

add the following lines to the file.

   [custom-from-engin]
   include => ext-did
   exten => _X.,1,Set(Var_TO=${SIP_HEADER(To)})
   exten => _X.,n,Goto(ext-did,${Var_TO:5:10},1)

New Proxy Information

Old 'to' field SIP header To: <sip:039017XXXX@voice.mibroadband.com.au>

New 'to' field SIP header To: "Firstname LastName"<sip:039017XXXX@voice.mibroadband.com.au>

SIP header change for the new engin Proxy servers. eg. Koala1.engin.com.au

    exten => s,1,NoOp(${SIP_HEADER(To)})
    exten => s,n,Set(DID=${SIP_HEADER(To)})
    exten => s,n,Set(DID=${CUT(DID,:,2)})
    exten => s,n,Set(DID=${CUT(DID,@,1)})
    exten => s,n,Goto(from-pstn,${DID},1)

This extracts the number from everything after the first “:” char and everything before the first “@” char


  • A Quick note about what this code is doing.

It checks the TO field, this is in the sip header. It then strips the 10 digit phone number from the string.

Reload or restart your asterisk server.

Setup your DID's in freePBX. Login, Select Inbound Routes, Select "Add Incoming Route". In the DID Number field enter your engin phone number eg. 0292345678 then select the destination for that number.

Note : You must now have a DID set for each number, otherwise the system may loop.