Asterisk/FreePBX Settings for DIDs

Instructions if using your DID with Asterisk (or FreePBX)

Once your PBX destination is configured in the client area of irishvoip.com, you can configure your PBX to handle the number.

These instructions are for CHAN_SIP. Log into the server terminal as root an edit the configuration file /etc/asterisk/sip_custom.conf and add the lines below

[IrishVoIP-DID-Primary]
host=46.19.210.14
dtmfmode=rfc2833
dtmf=rfc2833
type=peer
context=from-iv-did
nat=never
allow=all
qualify=4000

[IrishVoIP-DID-Secondary]
host=46.19.209.14
dtmfmode=rfc2833
dtmf=rfc2833
type=peer
context=from-iv-did
nat=never
allow=all
qualify=4000

This makes your inbound traffic arrive through a trunk which can be monitored among your peers. If using FreePBX it will automatically whitelist the trunks on your FreePBX firewall

Now handle the traffic by adding the from-iv-did context as below in the /etc/asterisk/extensions_custom.conf file.

[from-iv-did]
exten => _.,1,GotoIf($["${CALLERID(num):0:4}"!="+353"]?5)
exten => _.,2,Log(notice,Inbound DID - ${CALLERID(num)}, Its Irish Change to Irish Format)
exten => _.,3,Set(CALLERID(all)="" <0${CALLERID(num):4}>)
exten => _.,4,Goto(17)
exten => _.,5,GotoIf($["${CALLERID(num):0:3}"!="353"]?9)
exten => _.,6,Log(notice,Inbound DID - ${CALLERID(num)}, Its Irish Change to Irish Format)
exten => _.,7,Set(CALLERID(all)="" <0${CALLERID(num):3}>)
exten => _.,8,Goto(17) exten => _.,9,GotoIf($["${CALLERID(name):0:9}"="anonymous"]?11) exten => _.,10,GotoIf($["${CALLERID(name):0:9}"!="Anonymous"]?13) exten => _.,11,Set(CALLERID(all)="" <WITHHELD>) exten => _.,12,Goto(17) exten => _.,13,GotoIf($["${CALLERID(num):0:2}"!="00"]?16) exten => _.,14,Set(CALLERID(all)="" <+${CALLERID(num):2}>) exten => _.,15,Goto(17) exten => _.,16,Set(CALLERID(all)="" <+${CALLERID(num)}>) exten => _.,17,Log(notice,Inbound DID - Caller ID from ${CALLERID(num)} to ${CALLERID(DNID)}) exten => _.,18,Goto(from-pstn,${EXTEN},1)

This changes the inbound caller ID to be more Irish friendly and then onward routes the call to be handled as a normal incoming call by your PBX as normal.

You could skip the custom context by simply making the context of the two sip_custom.conf entries from-pstn

If using FreePBX, you can now create Inbound Routes to decide where to route the calls, to extensions, ring groups, IVR, call parks etc. in Asterisk route via your dial plan.

Reload your PBX after making these two changes and you are all set

If you also purchased a SIP Trunk from us please see below as to how to configure

https://www.irishvoip.com/index.php/knowledgebase/41/How-to-use-a-SIP-Trunk.html

  • 326 Users Found This Useful
Was this answer helpful?

Related Articles

FreePBX Feature List

  Caller ID Call Transfer Call Parking Call Forwarding Call Recording Call...

How to transfer a call with Freepbx?

Blind Transfer - If you wish to simply blind transfer a call to another extension perform the...

Firewall Rules for DIDs

Traffic from our DID service will be delivered directly to the PBX IP address and Port you setup...

How to configure a DID

You can edit the destination of your Irish VoIP purchased DID in your client area in...

How do I use my Call Plan number with FreePBX?

By following the steps below you will be able to make and receive calls using your Irish VoIP...