<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://lms.onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=Konfigurasi_ENUM_di_Asterisk</id>
	<title>Konfigurasi ENUM di Asterisk - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://lms.onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=Konfigurasi_ENUM_di_Asterisk"/>
	<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=Konfigurasi_ENUM_di_Asterisk&amp;action=history"/>
	<updated>2026-04-22T21:45:38Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://lms.onnocenter.or.id/wiki/index.php?title=Konfigurasi_ENUM_di_Asterisk&amp;diff=5263&amp;oldid=prev</id>
		<title>Onnowpurbo at 23:56, 1 February 2009</title>
		<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=Konfigurasi_ENUM_di_Asterisk&amp;diff=5263&amp;oldid=prev"/>
		<updated>2009-02-01T23:56:35Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://lms.onnocenter.or.id/wiki/index.php?title=Konfigurasi_ENUM_di_Asterisk&amp;amp;diff=5263&amp;amp;oldid=5262&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Onnowpurbo</name></author>
	</entry>
	<entry>
		<id>https://lms.onnocenter.or.id/wiki/index.php?title=Konfigurasi_ENUM_di_Asterisk&amp;diff=5262&amp;oldid=prev</id>
		<title>Onnowpurbo: New page: Di ambil dari alamat http://www.asterisk.org/doxygen/1.2/AstENUM.html#enumreadme  README.enum  2005-09-06  jtodd@loligo.com  The ENUMLOOKUP function is more complex than it first may appea...</title>
		<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=Konfigurasi_ENUM_di_Asterisk&amp;diff=5262&amp;oldid=prev"/>
		<updated>2009-02-01T23:53:58Z</updated>

		<summary type="html">&lt;p&gt;New page: Di ambil dari alamat http://www.asterisk.org/doxygen/1.2/AstENUM.html#enumreadme  README.enum  2005-09-06  jtodd@loligo.com  The ENUMLOOKUP function is more complex than it first may appea...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Di ambil dari alamat http://www.asterisk.org/doxygen/1.2/AstENUM.html#enumreadme&lt;br /&gt;
&lt;br /&gt;
README.enum&lt;br /&gt;
&lt;br /&gt;
2005-09-06 &lt;br /&gt;
jtodd@loligo.com&lt;br /&gt;
&lt;br /&gt;
The ENUMLOOKUP function is more complex than it first may appear, and&lt;br /&gt;
this guide is to give a general overview and set of examples that may&lt;br /&gt;
be well-suited for the advanced user to evaluate in their&lt;br /&gt;
consideration of ENUM or ENUM-like lookup strategies.  This document&lt;br /&gt;
assumes a familiarity with ENUM (RFC3761) or ENUM-like methods, as&lt;br /&gt;
well as familiarity with NAPTR DNS records (RFC2915, RFC3401-3404).&lt;br /&gt;
For an overview of NAPTR records, and the use of NAPTRs in the ENUM&lt;br /&gt;
global phone-number-to-DNS mapping scheme, please see&lt;br /&gt;
http://www.voip-info.org/tiki-index.php?page=ENUM for more detail.&lt;br /&gt;
&lt;br /&gt;
Using ENUM within Asterisk can be simple or complex, depending on how&lt;br /&gt;
many failover methods and redundancy procedures you wish to utilize.&lt;br /&gt;
Implementation of ENUM paths is supposedly defined by the person&lt;br /&gt;
creating the NAPTR records, but the local administrator may choose to&lt;br /&gt;
ignore certain NAPTR response methods (URI types) or prefer some over&lt;br /&gt;
others, which is in contradiction to the RFC.  The ENUMLOOKUP method&lt;br /&gt;
simply provides administrators a method for determining NAPTR results&lt;br /&gt;
in either the globally unique ENUM (e164.arpa) DNS tree, or in other&lt;br /&gt;
ENUM-like DNS trees which are not globally unique.  The methods to&lt;br /&gt;
actually create channels (&amp;quot;dial&amp;quot;) results given by the ENUMLOOKUP&lt;br /&gt;
function is then up to the administrator to implement in a way that&lt;br /&gt;
best suits their environment.&lt;br /&gt;
&lt;br /&gt;
Function: ENUMLOOKUP(&amp;lt;number&amp;gt;[,pointer_type[,options[,zone_suffix]]])&lt;br /&gt;
&lt;br /&gt;
  Performs an ENUM tree lookup on the specified number, method type,&lt;br /&gt;
  and (optionally) ordinal offset, and returns one of four different values:&lt;br /&gt;
&lt;br /&gt;
   1) post-parsed NAPTR of one method (URI) type&lt;br /&gt;
   2) count of elements of one method (URI) type&lt;br /&gt;
   3) count of all method types&lt;br /&gt;
   4) full URI of method at a particular point in the list of all possible methods &lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
&lt;br /&gt;
number = telephone number or search string.  Only numeric values&lt;br /&gt;
within this string are parsed; all other digits are ignored for&lt;br /&gt;
search, but are re-written during NAPTR regexp expansion.&lt;br /&gt;
&lt;br /&gt;
service_type = tel, sip, h323, iax2, mailto, ...[any other string],&lt;br /&gt;
     ALL. Default type is &amp;quot;sip&amp;quot;.&lt;br /&gt;
     Special name of &amp;quot;ALL&amp;quot; will create a list of method types across&lt;br /&gt;
     all NAPTR records for the search number, and then put the results&lt;br /&gt;
     in an ordinal list starting with 1. The position &amp;lt;number&amp;gt;&lt;br /&gt;
     specified will then be returned, starting with 1 as the first&lt;br /&gt;
     record (lowest value) in the list.  The service types are not&lt;br /&gt;
     hardcoded in Asterisk except for the default (sip) if no other&lt;br /&gt;
     service type specified; any method type string (IANA-approved or&lt;br /&gt;
     not) may be used except for the string &amp;quot;ALL&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
options = optional specifiers.&lt;br /&gt;
    c = count. Returns the number of records of this type are returned&lt;br /&gt;
    (regardless of order or priority.)  If &amp;quot;ALL&amp;quot; is the specified&lt;br /&gt;
    service_type, then a count of all methods will be returned for the&lt;br /&gt;
    DNS record.&lt;br /&gt;
    &amp;lt;integer&amp;gt; = The record in priority/order sequence based on the&lt;br /&gt;
    total count of records passed back by the query. If a service_type&lt;br /&gt;
    is specified, all entries of that type will be sorted into an&lt;br /&gt;
    ordinal list starting with 1 (by order first, then priority).&lt;br /&gt;
    The default of &amp;lt;options&amp;gt; is &amp;quot;1&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
zone_suffix = allows customization of the ENUM zone. Default is e164.arpa.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EXAMPLE USES:&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s use this ENUM list as an example (note that these examples exist&lt;br /&gt;
in the DNS, and will hopefully remain in place as example&lt;br /&gt;
destinations, but they may change or become invalid over time.  The&lt;br /&gt;
end result URIs are not guaranteed to actually work, since some of&lt;br /&gt;
these hostnames or SIP proxies are imaginary.  Of course, the tel:&lt;br /&gt;
replies go to directory assistance for New York City and San&lt;br /&gt;
Francisco...)  Also note that the complex SIP NAPTR at weight 30 will&lt;br /&gt;
strip off the leading &amp;quot;+&amp;quot; from the dialed string if it exists.  This&lt;br /&gt;
is probably a better NAPTR than hard-coding the number into the NAPTR,&lt;br /&gt;
and it is included as a more complex regexp example, though other&lt;br /&gt;
simpler NAPTRs will work just as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
0.2.0.1.1.6.5.1.0.3.1.loligo.com. 3600 IN NAPTR 10 100 &amp;quot;u&amp;quot; &amp;quot;E2U+tel&amp;quot; &amp;quot;!^\\+13015611020$!tel:+12125551212!&amp;quot; .&lt;br /&gt;
0.2.0.1.1.6.5.1.0.3.1.loligo.com. 3600 IN NAPTR 21 100 &amp;quot;u&amp;quot; &amp;quot;E2U+tel&amp;quot; &amp;quot;!^\\+13015611020$!tel:+14155551212!&amp;quot; .&lt;br /&gt;
0.2.0.1.1.6.5.1.0.3.1.loligo.com. 3600 IN NAPTR 25 100 &amp;quot;u&amp;quot; &amp;quot;E2U+sip&amp;quot; &amp;quot;!^\\+13015611020$!sip:2203@sip.fox-den.com!&amp;quot; .&lt;br /&gt;
0.2.0.1.1.6.5.1.0.3.1.loligo.com. 3600 IN NAPTR 26 100 &amp;quot;u&amp;quot; &amp;quot;E2U+sip&amp;quot; &amp;quot;!^\\+13015611020$!sip:1234@sip-2.fox-den.com!&amp;quot; .&lt;br /&gt;
0.2.0.1.1.6.5.1.0.3.1.loligo.com. 3600 IN NAPTR 30 100 &amp;quot;u&amp;quot; &amp;quot;E2U+sip&amp;quot; &amp;quot;!^\\+*([^\\*]*)!sip:\\1@sip-3.fox-den.com!&amp;quot; .&lt;br /&gt;
0.2.0.1.1.6.5.1.0.3.1.loligo.com. 3600 IN NAPTR 55 100 &amp;quot;u&amp;quot; &amp;quot;E2U+mailto&amp;quot; &amp;quot;!^\\+13015611020$!mailto:jtodd@fox-den.com!&amp;quot; .&lt;br /&gt;
&lt;br /&gt;
Example 1: Simplest case, using first SIP return (use all defaults&lt;br /&gt;
except for domain name)&lt;br /&gt;
exten =&amp;gt; 100,1,Set(foo=${ENUMLOOKUP(+13015611020,,,loligo.com)})&lt;br /&gt;
  returns: ${foo}=&amp;quot;2203@sip.fox-den.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Example 2: What is the first &amp;quot;tel&amp;quot; pointer type for this number?&lt;br /&gt;
(after sorting by order/preference; default of &amp;quot;1&amp;quot; is assumed in&lt;br /&gt;
options field)&lt;br /&gt;
exten =&amp;gt; 100,1,Set(foo=${ENUMLOOKUP(+13015611020,tel,,loligo.com)})&lt;br /&gt;
  returns: ${foo}=&amp;quot;+12125551212&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Example 3: How many &amp;quot;sip&amp;quot; pointer type entries are there for this number?&lt;br /&gt;
exten =&amp;gt; 100,1,Set(foo=${ENUMLOOKUP(+13015611020,sip,c,loligo.com)})&lt;br /&gt;
  returns: ${foo}=3&lt;br /&gt;
&lt;br /&gt;
Example 4: For all the &amp;quot;tel&amp;quot; pointer type entries, what is the second&lt;br /&gt;
one in the list? (after sorting by preference)&lt;br /&gt;
exten =&amp;gt; 100,1,Set(foo=${ENUMLOOKUP(+13015611020,tel,2,loligo.com)})&lt;br /&gt;
  returns: ${foo}=&amp;quot;+14155551212&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Example 5: How many NAPTRs (tel, sip, mailto, etc.) are in the list for this number?&lt;br /&gt;
exten =&amp;gt; 100,1,Set(foo=${ENUMLOOKUP(+13015611020,ALL,c,loligo.com)})&lt;br /&gt;
  returns: ${foo}=6&lt;br /&gt;
&lt;br /&gt;
Example 6: Give back the second full URI in the sorted list of all NAPTR URIs:&lt;br /&gt;
exten =&amp;gt; 100,1,Set(foo=${ENUMLOOKUP(+13015611020,ALL,2,loligo.com)})&lt;br /&gt;
  returns: ${foo}=&amp;quot;tel:+14155551212&amp;quot;  [note the &amp;quot;tel:&amp;quot; prefix in the string]&lt;br /&gt;
&lt;br /&gt;
Example 7: Look up first SIP entry for the number in the e164.arpa zone (all defaults)&lt;br /&gt;
exten =&amp;gt; 100,1,Set(foo=${ENUMLOOKUP(+437203001721)})&lt;br /&gt;
  returns: ${foo}=&amp;quot;enum-test@sip.nemox.net&amp;quot;  [note: this result is&lt;br /&gt;
  subject to change as it is &amp;quot;live&amp;quot; DNS and not under my control]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example 8: Look up the ISN mapping in freenum.org alpha test zone&lt;br /&gt;
exten =&amp;gt; 100,1,Set(foo=${ENUMLOOKUP(1234*256,,,freenum.org)})&lt;br /&gt;
  returns: ${foo}=&amp;quot;1234@204.91.156.10&amp;quot;  [note: this result is subject&lt;br /&gt;
  to change as it is &amp;quot;live&amp;quot; DNS]&lt;br /&gt;
&lt;br /&gt;
Example 9: Give back the first SIP pointer for a number in the&lt;br /&gt;
enum.yoydynelabs.com zone (invalid lookup)&lt;br /&gt;
exten =&amp;gt; 100,1,Set(foo=${ENUMLOOKUP(1234567890,sip,1,enum.yoyodynelabs.com)})&lt;br /&gt;
  returns: ${foo}=&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage notes and subtle features:&lt;br /&gt;
&lt;br /&gt;
  a) The use of &amp;quot;+&amp;quot; in lookups is confusing, and warrants further&lt;br /&gt;
  explanation.  All E.164 numbers (&amp;quot;global phone numbers&amp;quot;) by&lt;br /&gt;
  definition need a leading &amp;quot;+&amp;quot; during ENUM lookup.  If you neglect to&lt;br /&gt;
  add a leading &amp;quot;+&amp;quot;, you may discover that numbers that seem to exist&lt;br /&gt;
  in the DNS aren&amp;#039;t getting matched by the system or are returned with&lt;br /&gt;
  a null string result.  This is due to the NAPTR reply requiring a&lt;br /&gt;
  &amp;quot;+&amp;quot; in the regular expression matching sequence.  Older versions of&lt;br /&gt;
  Asterisk add a &amp;quot;+&amp;quot; from within the code, which may confuse&lt;br /&gt;
  administrators converting to the new function.  Please ensure that&lt;br /&gt;
  all ENUM (e164.arpa) lookups contain a leading &amp;quot;+&amp;quot; before lookup, so&lt;br /&gt;
  ensure your lookup includes the leading plus sign.  Other DNS trees&lt;br /&gt;
  may or may not require a leading &amp;quot;+&amp;quot; - check before using those&lt;br /&gt;
  trees, as it is possible the parsed NAPTRs will not provide correct&lt;br /&gt;
  results unless you have the correct dialed string.  If you get&lt;br /&gt;
  console messages like &amp;quot;WARNING[24907]: enum.c:222 parse_naptr: NAPTR&lt;br /&gt;
  Regex match failed.&amp;quot; then it is very possible that the returned&lt;br /&gt;
  NAPTR expects a leading &amp;quot;+&amp;quot; in the search string (or the returned&lt;br /&gt;
  NAPTR is mis-formed.)&lt;br /&gt;
&lt;br /&gt;
  b) If a query is performed of type &amp;quot;c&amp;quot; (&amp;quot;count&amp;quot;) and let&amp;#039;s say you&lt;br /&gt;
  get back 5 records and then some seconds later a query is made&lt;br /&gt;
  against record 5 in the list, it may not be the case that the DNS&lt;br /&gt;
  resolver has the same answers as it did a second or two ago - maybe&lt;br /&gt;
  there are only 4 records in the list in the newest query.  The&lt;br /&gt;
  resolver should be the canonical storage location for DNS records,&lt;br /&gt;
  since that is the intent of ENUM.  However, some obscure future&lt;br /&gt;
  cases may have wildly changing NAPTR records within several seconds.&lt;br /&gt;
  This is a corner case, and probably only worth noting as a very rare&lt;br /&gt;
  circumstance. (note: I do not object to Asterisk&amp;#039;s dnsmgr method of&lt;br /&gt;
  locally caching DNS replies, but this method needs to honor the TTL&lt;br /&gt;
  given by the remote zone master.  Currently, the ENUMLOOKUP function&lt;br /&gt;
  does not use the dnsmgr method of caching local DNS replies.)&lt;br /&gt;
&lt;br /&gt;
  c) If you want strict NAPTR value ordering, then it will be&lt;br /&gt;
  necessary to use the &amp;quot;ALL&amp;quot; method to incrementally step through the&lt;br /&gt;
  different returned NAPTR pointers.  You will need to use string&lt;br /&gt;
  manipulation to strip off the returned method types, since the&lt;br /&gt;
  results will look like &amp;quot;sip:12125551212&amp;quot; in the returned value.&lt;br /&gt;
  This is a non-trivial task, though it is required in order to have&lt;br /&gt;
  strict RFC compliance and to comply with the desires of the remote&lt;br /&gt;
  party who is presenting NAPTRs in a particular order for a reason.&lt;br /&gt;
&lt;br /&gt;
  d) Default behavior for the function (even in event of an error) is&lt;br /&gt;
  to move to the next priority, and the result is a null value.  Most&lt;br /&gt;
  ENUM lookups are going to be failures, and it is the responsibility&lt;br /&gt;
  of the dialplan administrator to manage error conditions within&lt;br /&gt;
  their dialplan.  This is a change from the old app_enumlookup method&lt;br /&gt;
  and it&amp;#039;s arbitrary priority jumping based on result type or failure.&lt;br /&gt;
&lt;br /&gt;
  e) Anything other than digits will be ignored in lookup strings.&lt;br /&gt;
  Example: a search string of &amp;quot;+4372030blah01721&amp;quot; will turn into&lt;br /&gt;
  1.2.7.1.0.0.3.0.2.7.3.4.e164.arpa. for the lookup.  The NAPTR&lt;br /&gt;
  parsing may cause unexpected results if there are strings inside&lt;br /&gt;
  your NAPTR lookups.&lt;br /&gt;
&lt;br /&gt;
  f) If there exist multiple records with the same weight and order as&lt;br /&gt;
  a result of your query, the function will RANDOMLY select a single&lt;br /&gt;
  NAPTR from those equal results.&lt;br /&gt;
&lt;br /&gt;
  g) Currently, the function ignores the settings in enum.conf as the&lt;br /&gt;
  search zone name is now specified within the function, and the H323&lt;br /&gt;
  driver can be chosen by the user via the dialplan.  There were no&lt;br /&gt;
  other values in this file, and so it becomes deprecated.&lt;br /&gt;
&lt;br /&gt;
  h) The function will digest and return NAPTRs which use older&lt;br /&gt;
  (depricated) style, reversed method strings such as &amp;quot;sip+E2U&amp;quot;&lt;br /&gt;
  instead of the more modern &amp;quot;E2U+sip&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  i) There is no provision for multi-part methods at this time.  If&lt;br /&gt;
  there are multiple NAPTRs with (as an example) a method of&lt;br /&gt;
  &amp;quot;E2U+voice:sip&amp;quot; and then another NAPTR in the same DNS record with a&lt;br /&gt;
  method of &amp;quot;&amp;quot;E2U+sip&amp;quot;, the system will treat these both as method&lt;br /&gt;
  &amp;quot;sip&amp;quot; and they will be separate records from the perspective of the&lt;br /&gt;
  function.  Of course, if both records point to the same URI and have&lt;br /&gt;
  equal priority/weight (as is often the case) then this will cause no&lt;br /&gt;
  serious difficulty, but it bears mentioning.&lt;br /&gt;
&lt;br /&gt;
  j) ISN (ITAD Subscriber Number) usage:  If the search number is of&lt;br /&gt;
  the form ABC*DEF (where ABC and DEF are at least one numeric digit)&lt;br /&gt;
  then perform an ISN-style lookup where the lookup is manipulated to&lt;br /&gt;
  C.B.A.DEF.domain.tld (all other settings and options apply.)  See&lt;br /&gt;
  http://www.freenum.org/ for more details on ISN lookups.  In the&lt;br /&gt;
  unlikely event you wish to avoid ISN re-writes, put an &amp;quot;n&amp;quot; as the&lt;br /&gt;
  first digit of the search string - the &amp;quot;n&amp;quot; will be ignored for the search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==EXAMPLES==&lt;br /&gt;
&lt;br /&gt;
All examples below except where noted use &amp;quot;e164.arpa&amp;quot; as the&lt;br /&gt;
referenced domain, which is the default domain name for ENUMLOOKUP.&lt;br /&gt;
All numbers are assumed to not have a leading &amp;quot;+&amp;quot; as dialed by the&lt;br /&gt;
inbound channel, so that character is added where necessary during&lt;br /&gt;
ENUMLOOKUP function calls.&lt;br /&gt;
&lt;br /&gt;
; example 1&lt;br /&gt;
;&lt;br /&gt;
; Assumes North American international dialing (011) prefix.&lt;br /&gt;
; Look up the first SIP result and send the call there, otherwise&lt;br /&gt;
;  send the call out a PRI.  This is the most simple possible&lt;br /&gt;
;  ENUM example, but only uses the first SIP reply in the list of&lt;br /&gt;
;  NAPTR(s). &lt;br /&gt;
;&lt;br /&gt;
exten =&amp;gt; _011.,1,Set(enumresult=${ENUMLOOKUP(+${EXTEN:3})})&lt;br /&gt;
exten =&amp;gt; _011.,n,Dial(SIP/${enumresult})&lt;br /&gt;
exten =&amp;gt; _011.,n,Dial(Zap/g1/${EXTEN})&lt;br /&gt;
; &lt;br /&gt;
; end example 1&lt;br /&gt;
&lt;br /&gt;
; example 2&lt;br /&gt;
;&lt;br /&gt;
; Assumes North American international dialing (011) prefix.&lt;br /&gt;
; Check to see if there are multiple SIP NAPTRs returned by &lt;br /&gt;
;  the lookup, and dial each in order.  If none work (or none&lt;br /&gt;
;  exist) then send the call out a PRI, group 1.&lt;br /&gt;
;&lt;br /&gt;
exten =&amp;gt; _011.,1,Set(sipcount=${ENUMLOOKUP(${EXTEN:3},sip,c)}|counter=0)&lt;br /&gt;
exten =&amp;gt; _011.,n,While($[&amp;quot;${counter}&amp;quot;&amp;lt;&amp;quot;${sipcount}&amp;quot;])&lt;br /&gt;
exten =&amp;gt; _011.,n,Set(counter=$[${counter}+1])&lt;br /&gt;
exten =&amp;gt; _011.,n,Dial(SIP/${ENUMLOOKUP(+${EXTEN:3},sip,${counter})})&lt;br /&gt;
exten =&amp;gt; _011.,n,EndWhile&lt;br /&gt;
exten =&amp;gt; _011.,n,Dial(Zap/g1/${EXTEN})&lt;br /&gt;
;&lt;br /&gt;
; end example 2&lt;br /&gt;
&lt;br /&gt;
; example 3&lt;br /&gt;
;&lt;br /&gt;
; This example expects an ${EXTEN} that is an e.164 number (like&lt;br /&gt;
;  14102241145 or 437203001721)&lt;br /&gt;
; Search through e164.arpa and then also search through e164.org&lt;br /&gt;
;  to see if there are any valid SIP or IAX termination capabilities.&lt;br /&gt;
;  If none, send call out via Zap channel 1.&lt;br /&gt;
;&lt;br /&gt;
; Start first with e164.arpa zone...&lt;br /&gt;
;&lt;br /&gt;
exten =&amp;gt; _X.,1,Set(sipcount=${ENUMLOOKUP(+${EXTEN},sip,c)}|counter=0)&lt;br /&gt;
exten =&amp;gt; _X.,2,GotoIf($[&amp;quot;${counter}&amp;quot;&amp;lt;&amp;quot;${sipcount}&amp;quot;]?3:6)&lt;br /&gt;
exten =&amp;gt; _X.,3,Set(counter=$[${counter}+1])&lt;br /&gt;
exten =&amp;gt; _X.,4,Dial(SIP/${ENUMLOOKUP(+${EXTEN},sip,${counter})})&lt;br /&gt;
exten =&amp;gt; _X.,5,GotoIf($[&amp;quot;${counter}&amp;quot;&amp;lt;&amp;quot;${sipcount}&amp;quot;]?3:6)&lt;br /&gt;
;&lt;br /&gt;
exten =&amp;gt; _X.,6,Set(iaxcount=${ENUMLOOKUP(+${EXTEN},iax2,c)}|counter=0)&lt;br /&gt;
exten =&amp;gt; _X.,7,GotoIf($[&amp;quot;${counter}&amp;quot;&amp;lt;&amp;quot;${iaxcount}&amp;quot;]?8:11)&lt;br /&gt;
exten =&amp;gt; _X.,8,Set(counter=$[${counter}+1])&lt;br /&gt;
exten =&amp;gt; _X.,9,Dial(IAX2/${ENUMLOOKUP(+${EXTEN},iax2,${counter})})&lt;br /&gt;
exten =&amp;gt; _X.,10,GotoIf($[&amp;quot;${counter}&amp;quot;&amp;lt;&amp;quot;${iaxcount}&amp;quot;]?8:11)&lt;br /&gt;
;&lt;br /&gt;
exten =&amp;gt; _X.,11,NoOp(&amp;quot;No valid entries in e164.arpa for ${EXTEN} - checking in e164.org&amp;quot;)&lt;br /&gt;
;&lt;br /&gt;
; ...then also try e164.org, and look for SIP and IAX NAPTRs...&lt;br /&gt;
;&lt;br /&gt;
exten =&amp;gt; _X.,12,Set(sipcount=${ENUMLOOKUP(+${EXTEN},sip,c,e164.org)}|counter=0)&lt;br /&gt;
exten =&amp;gt; _X.,13,GotoIf($[&amp;quot;${counter}&amp;quot;&amp;lt;&amp;quot;${sipcount}&amp;quot;]?14:17)&lt;br /&gt;
exten =&amp;gt; _X.,14,Set(counter=$[${counter}+1])&lt;br /&gt;
exten =&amp;gt; _X.,15,Dial(SIP/${ENUMLOOKUP(+${EXTEN},sip,${counter},e164.org)})&lt;br /&gt;
exten =&amp;gt; _X.,16,GotoIf($[&amp;quot;${counter}&amp;quot;&amp;lt;&amp;quot;${sipcount}&amp;quot;]?14:17)&lt;br /&gt;
;&lt;br /&gt;
exten =&amp;gt; _X.,17,Set(iaxcount=${ENUMLOOKUP(+${EXTEN},iax2,c,e164.org)}|counter=0)&lt;br /&gt;
exten =&amp;gt; _X.,18,GotoIf($[&amp;quot;${counter}&amp;quot;&amp;lt;&amp;quot;${iaxcount}&amp;quot;]?19:22)&lt;br /&gt;
exten =&amp;gt; _X.,19,Set(counter=$[${counter}+1])&lt;br /&gt;
exten =&amp;gt; _X.,20,Dial(IAX2/${ENUMLOOKUP(+${EXTEN},iax2,${counter},e164.org)})&lt;br /&gt;
exten =&amp;gt; _X.,21,GotoIf($[&amp;quot;${counter}&amp;quot;&amp;lt;&amp;quot;${iaxcount}&amp;quot;]?19:22)&lt;br /&gt;
;&lt;br /&gt;
; ...then send out PRI.&lt;br /&gt;
;&lt;br /&gt;
exten =&amp;gt; _X.,22,NoOp(&amp;quot;No valid entries in e164.org for ${EXTEN} - sending out via Zap&amp;quot;)&lt;br /&gt;
exten =&amp;gt; _X.,23,Dial(Zap/g1/${EXTEN})&lt;br /&gt;
;&lt;br /&gt;
; end example 3&lt;/div&gt;</summary>
		<author><name>Onnowpurbo</name></author>
	</entry>
</feed>