Search Computer Help Please

Showing posts with label asterisk enumlookup. Show all posts
Showing posts with label asterisk enumlookup. Show all posts

Monday, November 30, 2009

ENUM FreePBX - Setup Enumlookup with Asterisk FreePBX

This walk through goes through the steps to setup enumlookup on the latest version of Asterisk with FREEPBX

The First Step is to Create the ENUM TRUNK



Then ADD an ENUM TRUNK



Click Submit Changes, and Apply Configuration Changes, make sure to save and apply changes whenever you add a trunk or change settings



Note: No changes need to be made on this page unless you want to customize it especially.
The next step is to setup your outbound routes in FreePBX

ENUM Outbound Routes in FreePBX

Open up the outbound route 0 9_outisde, here we will specify how outgoing calls will be routed.




Check the Trunk Sequence


Here I have the trunk sequence set as ENUM first and if an enumlookup fails it will fall back to SIP Trunk which will send calls to the PSTN. Apply changes once you have changed your trunk sequence.

Setting up Dial Patterns for ENUM - Here we setup what numbers will be sent to the enum function for example , you may want to setup your FreePBX to only send numbers dialed starting with 9 to enum and all other to the PSTN.

The picture below shows the Dial Patterns for enumlookup

X = any number from 0 - 9
.X_ = match any number , any digit any length (easy option)




ENUMLOOKUP - FREEPBX changing ENUM registry's to lookup default (e164.org)

FreePBX by default looks up e164.org for enum records, you can change which domains to lookup on by accessing the file /var/lib/asterisk/agi-bin/enumlookup.agi

Open up SSH client, e.g Putty and login to the server



Open up the enumlookup.agi script and add the enum domains you wish to lookup.

And that's pretty much it for the walkthrough if you have problems usually its due to incorrect settings with your extensions or the reciever of the call not accepting incoming calls.

To allow others to call you VIA ENUM - Allow Anonymous SIP CALLS or route based on DID number e.g


This setting is found under General Settings.



Tuesday, November 24, 2009

Setting up enumlookup Asterisk 1.4

The enumlookup function can be setup in Asterisk 1.4 simply by editing the extensions.conf file , the enum.conf file does not need to be used and I think its pretty much obsolete now.

First thing you want to do if identify which phones or services will be allowed to perform an enumlookup. e.g include localphones , your local extensions will be able to perform enumlookup's. lot of people forget to include the phone or service for example to add localphones and internal

[enumlookup]
include=> localphones
include=> enumlookup
include=> internal

ensure you include everyone with permission to use this function

The basic enumlookup script for Asterisk 1.4 looks like this

[enumlookup]

include => common

include => internal

include => enumlookup

; This example expects an ${EXTEN} that is an e.164 number (like

; 14102241145 or 437203001721)

; Search through e164.arpa and then also search through e164.org, you can change the e164.org to your own ;enum server or different enum registry

; to see if there are any valid SIP or IAX termination capabilities.

; If none, send call out via Zap channel 1, you could redirect it to a SIP trunk if it fails if you prefer

;

; Start first with e164.arpa zone...

;

exten => _X.,1,Set(sipcount=${ENUMLOOKUP(+${EXTEN},sip,c)}|counter=0)

exten => _X.,2,GotoIf($["${counter}"<"${sipcount}"]?3:6)

exten => _X.,3,Set(counter=$[${counter}+1])

exten => _X.,4,Dial(SIP/${ENUMLOOKUP(+${EXTEN},sip,,${counter})})

exten => _X.,5,GotoIf($["${counter}"<"${sipcount}"]?3:6)

;

exten => _X.,6,Set(iaxcount=${ENUMLOOKUP(+${EXTEN},iax2,c)}|counter=0)

exten => _X.,7,GotoIf($["${counter}"<"${iaxcount}"]?8:11)

exten => _X.,8,Set(counter=$[${counter}+1])

exten => _X.,9,Dial(IAX2/${ENUMLOOKUP(+${EXTEN},iax2,,${counter})})

exten => _X.,10,GotoIf($["${counter}"<"${iaxcount}"]?8:11)

;

exten => _X.,11,NoOp("No valid entries in e164.arpa for ${EXTEN} - checking in e164.org")

;

; ...then also try e164.org, and look for SIP and IAX NAPTRs...

;

exten => _X.,12,Set(sipcount=${ENUMLOOKUP(+${EXTEN},sip,c,,e164.org)}|counter=0)

exten => _X.,13,GotoIf($["${counter}"<"${sipcount}"]?14:17)

exten => _X.,14,Set(counter=$[${counter}+1])

exten => _X.,15,Dial(SIP/${ENUMLOOKUP(+${EXTEN},sip,,${counter},e164.org)})

exten => _X.,16,GotoIf($["${counter}"<"${sipcount}"]?14:17)

;

exten => _X.,17,Set(iaxcount=${ENUMLOOKUP(+${EXTEN},iax2,c,,e164.org)}|counter=0)

exten => _X.,18,GotoIf($["${counter}"<"${iaxcount}"]?19:22)

exten => _X.,19,Set(counter=$[${counter}+1])

exten => _X.,20,Dial(IAX2/${ENUMLOOKUP(+${EXTEN},iax2,,${counter},e164.org)})

exten => _X.,21,GotoIf($["${counter}"<"${iaxcount}"]?19:22)

;

; ...then send out PRI.

;

exten => _X.,22,NoOp("No valid entries in e164.org for ${EXTEN} - sending out via Zap")

exten => _X.,23,Dial(Zap/g1/${EXTEN})

;

; end example 3

Simply pasting this into your extensions.conf will work as long as you have specified who to include at the very beginning.

for the dialing pattern, here we use .X_ which specifies anything starting with the digit 0-9 and anything after that will be matched. So anything really.

that's about it , goodluck