[asterisk-users] better enumlookup handler

Russell Bryant russell at digium.com
Thu May 8 10:51:58 CDT 2008


Brian J. Murrell wrote:
> Does anyone have a better ENUM lookup handler than the built-in
> ENUMLOOKUP() function?  The built-in function does not properly handle
> multiple return values such as:
> 
> 8.9.9.3.2.8.8.6.6.8.1.e164.org has NAPTR record 200 10 "u" "E2U+SIP" "!^\\+1866(.*)$!sip:1866\\1 at tollfree.sip-happens.com!" .
> 8.9.9.3.2.8.8.6.6.8.1.e164.org has NAPTR record 200 10 "u" "E2U+SIP" "!^\\+1866(.*)$!sip:1641641866\\1 at sip.tollfreegateway.com!" .

Have you taken a look at the ENUMQUERY() and ENUMRESULT() functions that are a
part of Asterisk 1.6?

The ENUMQUERY() function lets you do a single enum query for a number.  Then,
the ENUMRESULT() function lets you access and iterate through all of the records
received from the query.  Then, you can use dialplan logic to try each one
without having to actually do the lookup over and over ...

I have an unsupported 1.4 backport of these functions available.

svn co http://svncommunity.digium.com/svn/russell/asterisk-1.4/

-- 
Russell Bryant
Senior Software Engineer
Open Source Team Lead
Digium, Inc.



More information about the asterisk-users mailing list