04 number - how to use

If you are using Asterisk for VoIP, the changes are quite simple.


There is probably a line that says search = e164.arp. Make this two lines
search =
search =
Note that we suggest adding a dot to the end of each line as shown to avoid extra unnecessary DNS lookups.


Simply allow the default guest login, but with a context of, say, callmeukin
This would allow any incoming connections but only using the callmeukin context
Note that we are assuming the incoming caller id is valid. You may not want to trust it.


You will need a context to allow the incoming calls. We recommend that the calls are sent with full international calling and called numbers, so you need to strip the called number to fit your local dial plan. In this example we have assumed you have the prefix 0400 (i.e. +44400). You need to use your allocated prefix instead.
exten = _+44400./_+44.,1,SetCIDNum(0${CALLERIDNUM:3})   ; make UK caller ID sensible for UK
exten = _+44400.,1,NoOp ; unchanged caller ID
exten = _+44400.,2,Goto(default,${EXTEN:6},1)      ; treat as default call
Note that you may want to use a suitable incoming call context and not default in the Goto as otherwise you may be allowing outgoing calls if your default context allows this.
Note that the EXTEN:6 will depend on the length of the prefix, 6 is appropriate for +44400.

Also, you will need to be able to make calls out using 04 prefixes. The following context can be included in your dialing from users context (typically default).
exten = _04.,1,Goto(enumout,+44${EXTEN:1},1)
The callmeukout then makes the call to the 04 prefix number.
exten = _+.,1,EnumLookup(${EXTEN:1})   ; Lookup the number (without +)
exten = _+.,2,SetCIDNum(+44400${CALLERIDNUM})   ; Set our caller ID to be sensible
exten = _+.,3,Dial(${ENUM})   ; Dial what we were told to
exten = _+.,4, Congestion ; Dial done
exten = _+.,52,Congestion   ; Enum return TEL record
exten = _+.,102,Congestion   ; Enum failed
Note, again, we have assumed we have a prefix of 0400 (i.e. +44400) and that following this is the local caller ID. You may want to change this, and may even want to send a normal phone number or 0800 number, etc. Please don't set to a premium rate number and make sure it is one of your own - there is no checking on caller ID!