Upgrade 3CX to v18 and get it hosted free!

Asterisk func enumlookup

Author image

Synopsis

ENUMLOOKUP allows for general or specific querying of NAPTR records or counts of NAPTR types for ENUM or ENUM-like DNS pointers.

New in Asterisk 1.2, deprecates the application EnumLookup in Asterisk 1.4

Description

in Asterisk 1.2:
ENUMLOOKUP(number[,Method-type[,options|record#[,zone-suffix]]])

in Asterisk 1.4 and newer:
ENUMLOOKUP(number[,Method-type[,options,record#[,zone-suffix]]])

Option ‘c’ returns an integer count of the number of NAPTRs of a certain RR type.
Combination of ‘c’ and Method-type of ‘ALL’ will return a count of all NAPTRs for the record.
Defaults are: Method-type=sip, no options, record=1, zone-suffix=e164.arpa

For more information, see README.enum

Details

  • *CLI> show function ENUMLOOKUP

If you have this in Asterisk 1.2:

${ENUMLOOKUP(${EXTEN},sip,1,freenum.org)}

then you need this in Asterisk 1.4:

${ENUMLOOKUP(${EXTEN},sip,,1,freenum.org)}

Note the extra comma; the field that used to be a union of options and Nth has become two separate fields. Since this branch is based on trunk you need to use the 1.4 syntax with it.

Incidently, if the parameter c were used, as in:

${ENUMLOOKUP(+13015611020,ALL,c,e164.org)}

(from doc/README.enum in the 1.2 branch)
it would become:

${ENUMLOOKUP(+13015611020,ALL,c,,e164.org)}

in the new syntax.

Return value

Returns the resulting string.

Example

exten => s,1,Set(foo=${ENUMLOOKUP(7079964444)})

For a complete RFC compliant macro, with support for multiple enum providers, see RFC Compliant ENUM Macro

See also



Article Reviews

Write a Review

Your email address will not be published. Required fields are marked *

Required Field. Minimum 5 characters.

Required Field. Minimum 5 characters, maximum 50.

Required field.There is an error with this field.

Required Field.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

There are no reviews for this article. Be the first one to write a review.

Related Posts:

Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.