Index: doc/tex/enum.tex
===================================================================
--- doc/tex/enum.tex	(revision 90471)
+++ doc/tex/enum.tex	(working copy)
@@ -59,6 +59,9 @@
      hardcoded in Asterisk except for the default (sip) if no other
      service type specified; any method type string (IANA-approved or
      not) may be used except for the string "ALL".
+     The service\_type code is confusing as it mixes the ENUM service-type
+     with the URI-scheme paramete of the resulting URI. It doesn't really
+     follow the RFC's definition of service-types and subtypes.
   \end{itemize}
 
   \item options
@@ -70,6 +73,22 @@
     service\_type, then a count of all methods will be returned for the
     DNS record.
     \end{itemize}
+    \item i
+    \begin{itemize}
+      \item infrastructure ENUM. See below example.
+    \end{itemize}
+    \item s
+    \begin{itemize}
+      \item ISN based lookup.
+    \end{itemize}
+    \item u
+    \begin{itemize}
+      \item Return full URI (dont remove protocol part).
+    \end{itemize}
+    \item d
+    \begin{itemize}
+      \item Direct DNS lookup.
+    \end{itemize}
   \end{itemize}
 
   \item record\#
@@ -241,8 +260,10 @@
 
   \item 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.
+  driver can be chosen by the user via the dialplan. The config
+  file can be used to set the verbosity of the ENUMLOOKUP function
+  (e.g. by setting "verbose => 10") as well as set infrastructure 
+  ENUM related parameters.
 
   \item The function will digest and return NAPTRs which use older
   (deprecated) style, reversed method strings such as "sip+E2U"
@@ -259,11 +280,83 @@
 
   \item ISN (ITAD Subscriber Number) usage:  If the search number is of
   the form ABC*DEF (where ABC and DEF are at least one numeric digit)
-  then perform an ISN-style lookup where the lookup is manipulated to
+  and the options paramater contains a "s", then ENUMLOOKUP will
+  perform an ISN-style lookup where the lookup is manipulated to
   C.B.A.DEF.domain.tld (all other settings and options apply.)  See
-  \url{http://www.freenum.org/} for more details on ISN lookups.  In the
-  unlikely event you wish to avoid ISN re-writes, put an "n" as the
-  first digit of the search string - the "n" will be ignored for the search.
+  \url{http://www.freenum.org/} for more details on ISN lookups. 
+
+  \item Infrastructure ENUM usage: If "i" is contained in the options field, 
+  then the lookup will branch off the normal ENUM tree according
+  to the configured algorithm.
+ 
+  In the long run, infrastructure ENUM will not require special treatments,
+  but until this new tree is established under ie164.arpa, trial implementation
+  of infrastructure ENUM will use records in the user-ENUM tree to branch
+  off to the I-ENUM trees.
+
+  See \url{http://tools.ietf.org/wg/enum/draft-ietf-enum-combined/}
+  for a detailed explanation of the rationale.
+
+  This version of ENUMLOOKUP supports three different branching algorithms
+  ("cc", "txt", and "ebl"). These are selected in the [ienum] section of 
+  the enum.conf configuration file. E.g.
+\begin{verbatim}
+  [ienum]
+  branchlabel => i
+  ebl_alg => cc
+
+  This tells the code to insert the label "i" at the country-code level
+  into the ENUM tree. Examples: i.1.e164.arpa, i.3.4.e164.arpa, 
+  i.2.5.3.e164.arpa.
+
+  This is the default behavior.
+
+  [ienum]
+  branchlabel => i
+  ebl_alg => txt
+
+  With this setting, ENUMLOOKUP will look for a TXT record at
+  <branchlabel>.<reverse-country-code>.<apex> to indicate after how many digits the
+  branchlabel should in inserted. e.g. a
+
+  i.1.e164.arpa. IN TXT "4"
+
+  record will tell the module to look for I-ENUM records for +1 234 5678 999 at
+  9.9.9.8.7.6.5.i.4.3.2.1.e164.arpa.
+
+  [ienum]
+  branchlabel => infrastructure
+  ebl_alg => ebl
+
+  With this setting, ENUMLOOKUP tries to locate an EBL record (see
+  http://tools.ietf.org/wg/enum/draft-ietf-enum-branch-location-record/)
+  at <branchlabel>.<reverse-country-code>.<apex>. This EBL record contains
+  three paramters on how the ENUM algorithm should proceed. Here are the
+  examples from the I-D:
+
+  Given:
+
+  infrastructure.3.4.e164.arpa.    IN EBL 2 "i" e164.arpa.
+  infrastructure.1.e164.arpa.      IN EBL 4 "i" example.com.
+  infrastructure.9.4.e164.arpa.    IN EBL 0 ""  ie164.arpa.
+
+  These records indicate how the transformation from E.164 number to
+  ENUM domains for the application "infrastructure" should be done for
+  numbers in country code +43, +1, and +49.  This leads to the
+  following mappings:
+
+  +43 15056416            6.1.4.6.5.0.5.1.i.3.4.e164.arpa
+  +1 5551234567           7.6.5.4.3.2.1.i.5.5.5.1.example.com
+  +49 891234567           7.6.5.4.3.2.1.9.8.9.4.ie164.arpa
+
+  l) The option "d" tells ENUMLOOKUP not to do the "digit-reversal",
+  but instead just concatenate the number-parameter, a "." and the
+  zone-suffix. e.g.
+
+  ENUMLOOKUP(ABC,sip,d,1,enum.example.com)
+
+  will look for NAPTR records at ABC.enum.example.com.
+\end{verbatim}
 \end{itemize}
 
 \subsection{Some more Examples}
