[asterisk-commits] trunk r10047 - in /trunk: UPGRADE.txt
doc/enum.txt funcs/func_enum.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Tue Feb 14 14:57:27 MST 2006
Author: kpfleming
Date: Tue Feb 14 15:57:26 2006
New Revision: 10047
URL: http://svn.digium.com/view/asterisk?rev=10047&view=rev
Log:
don't force a default zone for ENUM() lookups, use the configuration file (issue #6036, with update to UPGRADE.txt)
Modified:
trunk/UPGRADE.txt
trunk/doc/enum.txt
trunk/funcs/func_enum.c
Modified: trunk/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/trunk/UPGRADE.txt?rev=10047&r1=10046&r2=10047&view=diff
==============================================================================
--- trunk/UPGRADE.txt (original)
+++ trunk/UPGRADE.txt Tue Feb 14 15:57:26 2006
@@ -40,6 +40,9 @@
modules.conf file then you will need to explicitly load the modules that
contain the functions you want to use.
+* The ENUM() function no longer supplies a default zone for searching; instead,
+ it uses the default zone(s) defined in enum.conf.
+
The SIP channel:
* The "incominglimit" setting is replaced by the "call-limit" setting in sip.conf.
Modified: trunk/doc/enum.txt
URL: http://svn.digium.com/view/asterisk/trunk/doc/enum.txt?rev=10047&r1=10046&r2=10047&view=diff
==============================================================================
--- trunk/doc/enum.txt (original)
+++ trunk/doc/enum.txt Tue Feb 14 15:57:26 2006
@@ -64,7 +64,8 @@
ordinal list starting with 1 (by order first, then priority).
The default of <options> is "1"
-zone_suffix = allows customization of the ENUM zone. Default is e164.arpa.
+zone_suffix = allows customization of the ENUM zone. If no zone_suffix is
+ given the default zones are taken from enum.conf
EXAMPLE USES:
@@ -117,7 +118,7 @@
exten => 100,1,Set(foo=${ENUMLOOKUP(+13015611020,ALL,2,loligo.com)})
returns: ${foo}="tel:+14155551212" [note the "tel:" prefix in the string]
-Example 7: Look up first SIP entry for the number in the e164.arpa zone (all defaults)
+Example 7: Look up first SIP entry for the number in the default zone(s) from enum.conf
exten => 100,1,Set(foo=${ENUMLOOKUP(+437203001721)})
returns: ${foo}="enum-test at sip.nemox.net" [note: this result is
subject to change as it is "live" DNS and not under my control]
@@ -195,10 +196,9 @@
a result of your query, the function will RANDOMLY select a single
NAPTR from those equal results.
- g) Currently, the function ignores the settings in enum.conf as the
- search zone name is now specified within the function, and the H323
- driver can be chosen by the user via the dialplan. There were no
- other values in this file, and so it becomes deprecated.
+ g) If a zone is given explicitely the function ignores the settings
+ in enum.conf as the search zone name is now specified within the function,
+ and the H323 driver can be chosen by the user via the dialplan.
h) The function will digest and return NAPTRs which use older
(depricated) style, reversed method strings such as "sip+E2U"
@@ -225,7 +225,8 @@
==EXAMPLES==
All examples below except where noted use "e164.arpa" as the
-referenced domain, which is the default domain name for ENUMLOOKUP.
+referenced domain, which is the default domain name for ENUMLOOKUP if
+'search => e164.arpa' is set in enum.conf.
All numbers are assumed to not have a leading "+" as dialed by the
inbound channel, so that character is added where necessary during
ENUMLOOKUP function calls.
@@ -270,6 +271,48 @@
;
; Start first with e164.arpa zone...
;
+exten => _X.,1,Set(sipcount=${ENUMLOOKUP(+${EXTEN},sip,c,e164.arpa)}|counter=0)
+exten => _X.,2,GotoIf($["${counter}"<"${sipcount}"]?3:6)
+exten => _X.,3,Set(counter=$[${counter}+1])
+exten => _X.,4,Dial(SIP/${ENUMLOOKUP(+${EXTEN},sip,${counter},e164.arpa)})
+exten => _X.,5,GotoIf($["${counter}"<"${sipcount}"]?3:6)
+;
+exten => _X.,6,Set(iaxcount=${ENUMLOOKUP(+${EXTEN},iax2,c,e164.arpa)}|counter=0)
+exten => _X.,7,GotoIf($["${counter}"<"${iaxcount}"]?8:11)
+exten => _X.,8,Set(counter=$[${counter}+1])
+exten => _X.,9,Dial(IAX2/${ENUMLOOKUP(+${EXTEN},iax2,${counter},e164.arpa)})
+exten => _X.,10,GotoIf($["${counter}"<"${iaxcount}"]?8:11)
+;
+exten => _X.,11,NoOp("No valid entries in e164.arpa for ${EXTEN} - checking in e164.org")
+;
+; ...then also try e164.org, and look for SIP and IAX NAPTRs...
+;
+exten => _X.,12,Set(sipcount=${ENUMLOOKUP(+${EXTEN},sip,c,e164.org)}|counter=0)
+exten => _X.,13,GotoIf($["${counter}"<"${sipcount}"]?14:17)
+exten => _X.,14,Set(counter=$[${counter}+1])
+exten => _X.,15,Dial(SIP/${ENUMLOOKUP(+${EXTEN},sip,${counter},e164.org)})
+exten => _X.,16,GotoIf($["${counter}"<"${sipcount}"]?14:17)
+;
+exten => _X.,17,Set(iaxcount=${ENUMLOOKUP(+${EXTEN},iax2,c,e164.org)}|counter=0)
+exten => _X.,18,GotoIf($["${counter}"<"${iaxcount}"]?19:22)
+exten => _X.,19,Set(counter=$[${counter}+1])
+exten => _X.,20,Dial(IAX2/${ENUMLOOKUP(+${EXTEN},iax2,${counter},e164.org)})
+exten => _X.,21,GotoIf($["${counter}"<"${iaxcount}"]?19:22)
+;
+; ...then send out PRI.
+;
+exten => _X.,22,NoOp("No valid entries in e164.org for ${EXTEN} - sending out via Zap")
+exten => _X.,23,Dial(Zap/g1/${EXTEN})
+;
+; end example 3
+
+;
+;
+; An alternative to example 3 would be setting the search zones in enum.conf like
+; search => e164.arpa
+; search => e164.org
+;
+; Start start matching the default zones from configuration:
exten => _X.,1,Set(sipcount=${ENUMLOOKUP(+${EXTEN},sip,c)}|counter=0)
exten => _X.,2,GotoIf($["${counter}"<"${sipcount}"]?3:6)
exten => _X.,3,Set(counter=$[${counter}+1])
@@ -282,25 +325,6 @@
exten => _X.,9,Dial(IAX2/${ENUMLOOKUP(+${EXTEN},iax2,${counter})})
exten => _X.,10,GotoIf($["${counter}"<"${iaxcount}"]?8:11)
;
-exten => _X.,11,NoOp("No valid entries in e164.arpa for ${EXTEN} - checking in e164.org")
-;
-; ...then also try e164.org, and look for SIP and IAX NAPTRs...
-;
-exten => _X.,12,Set(sipcount=${ENUMLOOKUP(+${EXTEN},sip,c,e164.org)}|counter=0)
-exten => _X.,13,GotoIf($["${counter}"<"${sipcount}"]?14:17)
-exten => _X.,14,Set(counter=$[${counter}+1])
-exten => _X.,15,Dial(SIP/${ENUMLOOKUP(+${EXTEN},sip,${counter},e164.org)})
-exten => _X.,16,GotoIf($["${counter}"<"${sipcount}"]?14:17)
-;
-exten => _X.,17,Set(iaxcount=${ENUMLOOKUP(+${EXTEN},iax2,c,e164.org)}|counter=0)
-exten => _X.,18,GotoIf($["${counter}"<"${iaxcount}"]?19:22)
-exten => _X.,19,Set(counter=$[${counter}+1])
-exten => _X.,20,Dial(IAX2/${ENUMLOOKUP(+${EXTEN},iax2,${counter},e164.org)})
-exten => _X.,21,GotoIf($["${counter}"<"${iaxcount}"]?19:22)
-;
-; ...then send out PRI.
-;
-exten => _X.,22,NoOp("No valid entries in e164.org for ${EXTEN} - sending out via Zap")
-exten => _X.,23,Dial(Zap/g1/${EXTEN})
-;
-; end example 3
+exten => _X.,11,NoOp("No valid entries in default zones from enum.conf for ${EXTEN}")
+;
+
Modified: trunk/funcs/func_enum.c
URL: http://svn.digium.com/view/asterisk/trunk/funcs/func_enum.c?rev=10047&r1=10046&r2=10047&view=diff
==============================================================================
--- trunk/funcs/func_enum.c (original)
+++ trunk/funcs/func_enum.c Tue Feb 14 15:57:26 2006
@@ -85,9 +85,6 @@
}
ast_copy_string(tech, args.tech ? args.tech : "sip", sizeof(tech));
-
- if (!args.zone)
- args.zone = "e164.arpa";
if (!args.options)
args.options = "1";
More information about the asterisk-commits
mailing list