ENUM and Asterisk
Configure Asterisk for ENUM
This article describes how to set up Asterisk to use ENUM directory lookups to dial PSTN phone numbers directly peer-to-peer over the internet, thereby entirely bypassing the public telephone network.
Introduction
ENUM, aka E.164 is an ITU standard for resolving PSTN telephone numbers into DNS service records. An IP telephone or a telephony server such as Asterisk can use ENUM directory lookups to find out if a PSTN telephone number is listed in the directory and obtain the DNS service record for the number. Using the service record a peer-to-peer VoIP call can then be established, bypassing the public telephone network.
Asterisk ENUM configuration
ENUM search domain configuration
Add the following to /etc/asterisk/enum.conf :
[general] ; ; The search list for domains may be customized. Domains are searched ; in the order they are listed here. ; search => e164.org search => e164.arpa
Dialplan configuration
Add the following to /etc/asterisk/extensions.conf :
[enum] ; context for dialing PSTN numbers p2p through ENUM directory lookup
;
exten => _*164X.,1,NoOp(outgoing call with ENUM lookup for ${EXTEN:4})
;
; tell the user what we're doing
exten => _*164X.,2,Playback(silence/2)
exten => _*164X.,3,Playback(doing-enum-lookup)
;
; do E164 directory lookup for the dialed number
exten => _*164X.,4,EnumLookup(${EXTEN:4})
;
; setting the caller ID name to be shown to the called party
exten => _*164X.,5,SetCIDName(your full name)
;
; setting the caller ID number to be shown to the called party
exten => _*164X.,6,SetCIDNum(your phone number)
;
; EMUM lookup returned a DNS SRV record for peer-to-peer dialing
exten => _*164X.,7,Playback(enum-lookup-successful)
exten => _*164X.,8,Dial(${ENUM},60,r)
exten => _*164X.,9,Congestion ; peer-to-peer call failed
exten => _*164X.,10,Goto(international,${EXTEN:4},1) ; use toll service instead
;
; ENUM lookup returned an alternative phone number to dial
exten => _*164X.,55,NoOp() ; we've got a TEL record back
exten => _*164X.,56,Goto(international,${EXTEN:4},1) ; use toll service instead
;
; ENUM lookup did not return anything - number is not E164 listed
exten => _*164X.,105,Playback(enum-lookup-failed)
exten => _*164X.,106,Goto(international,${EXTEN:4},1) ; use toll service instead
[international] ; context for international toll service
;
exten => _[1-9]X.,1,NoOp(outgoing international call to ${EXTEN} using toll service)
exten => _[1-9]X.,2,Playback(international-call)
;
; the following is an example how to dial through an IAX based PSTN gateway service
exten => _[1-9]X.,3,Dial(IAX2/username@peername/${EXTEN},60,r)
exten => _[1-9]X.,4,Hangup
Don't forget to tell Asterisk to reload
Use the Asterisk command line ...
*CLI> reload
Alternatively, use Asterisk Launcher to reload ...
Dialing PSTN numbers using ENUM lookup
To dial PSTN numbers using ENUM lookup with the above configuration, numbers need to be dialed with a prefix *164 followed by the country code, the area code (without any leading zero) and the phone number.
For example, to call New York (212) 555-1234, dial *164 1 212 555-1234
List your own PSTN number in a public E164 directory
You can list your own PSTN number free of charge in a public ENUM directory so that others can call your PSTN number peer-to-peer directly to your Asterisk server, bypassing the public telephone network. To do so, sign up for a free account with the public ENUM directory at E164.org and follow the intructions on the web site.
Join the Macintosh Telephony Mailing List
List membership is free. Click here for details.
Legal Disclaimer
Asterisk is a trademark of Digium Inc. Apple, Cocoa, Macintosh and MacOS X are trademarks of Apple Inc. The Asterisk software is released under the GNU General Public License (GPL). The Asterisk for Macintosh Distribution and related utilities are maintained and released by Sunrise Telephone Systems in accordance with the GPL whilst Apple's and Digium's trademarks are mentioned for reference only in order to inform about the origin and purpose of the software. The mentioning of those marks does not imply any kind of endorsement neither by Apple Inc nor by Digium Inc. A4M is a trademark of Sunrise Telephone Systems. A4M specific icons shown on this page are the property of Sunrise Telephone Systems, their use for other purposes than use or redistribution of the unmodified A4M software distribution or parts thereof requires written permission.