[asterisk-dev] ENUMLOOKUP - regex broken?

Lawrence Conroy lconroy at insensate.co.uk
Sun Mar 1 08:09:20 CST 2009


Hi Folks,
(as an Author of some of the ENUM specs, this woke me up):
----
digging the domain 3.2.1.3.2.1.0.0.8.4.4.e164.org. for NAPTR shows:
3.2.1.3.2.1.0.0.8.4.4.e164.org.	60 IN	NAPTR	200 10 "u" "E2U+SIP" "!^\\ 
+44800(.*)$!sip:44800\\1 at selfnet.at!" .
3.2.1.3.2.1.0.0.8.4.4.e164.org.	60 IN	NAPTR	200 10 "u" "E2U+SIP" "!^\\ 
+44800(.*)$!sip:44800\\1 at bt.telng.com!" .
3.2.1.3.2.1.0.0.8.4.4.e164.org.	60 IN	NAPTR	200 10 "u" "E2U+SIP" "!^\\ 
+44800(.*)$!sip:44800\\1 at public.sip.magrathea.net!" .
3.2.1.3.2.1.0.0.8.4.4.e164.org.	60 IN	NAPTR	200 10 "u" "E2U+SIP" "!^\\ 
+44800(.*)$!sip:44800\\1 at freenum.sip.telecomplete.net!" .

There are a number of "features" to this NAPTR RRset:

- all of these NAPTRs have the same ORDER and PRIORITY, so one of  
these will be selected at random.

- Your NAPTRs all say "match the AUS against +44800, capture the rest,  
put a prefix and the rest as the SIP userpart".
   Personally, I would have made this shorter by matching "^\\ 
+(44800.*)$" and using "sip:\\1 at selfnet.at" and so on.

I would expect an ENUM client to generate <sip:44800123123 at selfnet.at>  
for number AUS +44800123123.
(or <sip:44800123123 at bt.telng.com>, or <sip:44800123123 at public.sip.magrathea.net 
 >,
  or <sip:44800123123 at freenum.sip.telecomplete.net>, at random).
----

However, I looked at the latest version of doc/enum.txt (in 1.4.23.1)  
and enum.c and enum.h,
and I can't see the option 's'. Did you mean 'c'?

all the best,
   Lawrence

On 28 Feb 2009, at 23:18, Chris Maciejewski wrote:
> Hi,
>
> The following number +44800123123 is registered with e164.org.
>
> $ dig 3.2.1.3.2.1.0.0.8.4.4.e164.org naptr
> returns:
> ....
> 3.2.1.3.2.1.0.0.8.4.4.e164.org.	11 IN	NAPTR	200 10 "u" "E2U+SIP"
> "!^\\+44800(.*)$!sip:44800\\1 at selfnet.at!" .
>
> so in theory it should translate to: sip:44800123123 at selfnet.at
>
> But the following dialplan function:
> exten => _X.,n,Set(ENUM_URI=${ENUMLOOKUP(+44800123123,sip,s, 
> 1,e164.org)})
> exten => _X.,n,NoOp(Enum URI: ${ENUM_URI})
>
> returns: ... "Enum URI: 4480044800123123 at selfnet.at") in new stack
>
> Is there a problem with regex rewriting in ENUMLOOKUP function?
>
> Best regards,
> Chris




More information about the asterisk-dev mailing list