⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 enum.tex

📁 asterisk 是一个很有知名度开源软件
💻 TEX
📖 第 1 页 / 共 2 页
字号:
\section{The ENUMLOOKUP dialplan function}The ENUMLOOKUP function is more complex than it first may appear, andthis guide is to give a general overview and set of examples that maybe well-suited for the advanced user to evaluate in theirconsideration of ENUM or ENUM-like lookup strategies.  This documentassumes a familiarity with ENUM (RFC3761) or ENUM-like methods, aswell as familiarity with NAPTR DNS records (RFC2915, RFC3401-3404).For an overview of NAPTR records, and the use of NAPTRs in the ENUMglobal phone-number-to-DNS mapping scheme, please see\url{http://www.voip-info.org/tiki-index.php?page=ENUM} for more detail.Using ENUM within Asterisk can be simple or complex, depending on howmany failover methods and redundancy procedures you wish to utilize.Implementation of ENUM paths is supposedly defined by the personcreating the NAPTR records, but the local administrator may choose toignore certain NAPTR response methods (URI types) or prefer some overothers, which is in contradiction to the RFC.  The ENUMLOOKUP methodsimply provides administrators a method for determining NAPTR resultsin either the globally unique ENUM (e164.arpa) DNS tree, or in otherENUM-like DNS trees which are not globally unique.  The methods toactually create channels ("dial") results given by the ENUMLOOKUPfunction is then up to the administrator to implement in a way thatbest suits their environment.\begin{verbatim}Function: ENUMLOOKUP(number[,Method-type[,options[,record#[,zone-suffix]]]])\end{verbatim}  Performs an ENUM tree lookup on the specified number, method type, and  ordinal record offset, and returns one of four different values:\begin{enumerate}   \item post-parsed NAPTR of one method (URI) type   \item count of elements of one method (URI) type   \item count of all method types   \item full URI of method at a particular point in the list of all possible methods\end{enumerate}\subsection{Arguments}\begin{itemize}  \item number  \begin{itemize}    \item telephone number or search string.  Only numeric values    within this string are parsed; all other digits are ignored for    search, but are re-written during NAPTR regexp expansion.  \end{itemize}  \item service\_type  \begin{itemize}     \item tel, sip, h323, iax2, mailto, ...[any other string],     ALL. Default type is "sip".     Special name of "ALL" will create a list of method types across     all NAPTR records for the search number, and then put the results     in an ordinal list starting with 1. The position <number>     specified will then be returned, starting with 1 as the first     record (lowest value) in the list.  The service types are not     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".  \end{itemize}  \item options  \begin{itemize}    \item c    \begin{itemize}      \item count. Returns the number of records of this type are returned    (regardless of order or priority.)  If "ALL" is the specified    service\_type, then a count of all methods will be returned for the    DNS record.    \end{itemize}  \end{itemize}  \item record\#  \begin{itemize}    \item which record to present if multiple answers are returned    <integer> = The record in priority/order sequence based on the    total count of records passed back by the query. If a service\_type    is specified, all entries of that type will be sorted into an    ordinal list starting with 1 (by order first, then priority).    The default of <options> is "1"  \end{itemize}  \item zone\_suffix  \begin{itemize}    \item allows customization of the ENUM zone. Default is e164.arpa.  \end{itemize}\end{itemize}\subsection{Examples}Let's use this ENUM list as an example (note that these examples existin the DNS, and will hopefully remain in place as exampledestinations, but they may change or become invalid over time.  Theend result URIs are not guaranteed to actually work, since some ofthese hostnames or SIP proxies are imaginary.  Of course, the tel:replies go to directory assistance for New York City and SanFrancisco...)  Also note that the complex SIP NAPTR at weight 30 willstrip off the leading "+" from the dialed string if it exists.  Thisis probably a better NAPTR than hard-coding the number into the NAPTR,and it is included as a more complex regexp example, though othersimpler NAPTRs will work just as well.\begin{verbatim}0.2.0.1.1.6.5.1.0.3.1.loligo.com. 3600 IN NAPTR 10 100 "u"     "E2U+tel" "!^\\+13015611020$!tel:+12125551212!" .0.2.0.1.1.6.5.1.0.3.1.loligo.com. 3600 IN NAPTR 21 100 "u"     "E2U+tel" "!^\\+13015611020$!tel:+14155551212!" .0.2.0.1.1.6.5.1.0.3.1.loligo.com. 3600 IN NAPTR 25 100 "u"     "E2U+sip" "!^\\+13015611020$!sip:2203@sip.fox-den.com!" .0.2.0.1.1.6.5.1.0.3.1.loligo.com. 3600 IN NAPTR 26 100 "u"     "E2U+sip" "!^\\+13015611020$!sip:1234@sip-2.fox-den.com!" .0.2.0.1.1.6.5.1.0.3.1.loligo.com. 3600 IN NAPTR 30 100 "u"     "E2U+sip" "!^\\+*([^\\*]*)!sip:\\1@sip-3.fox-den.com!" .0.2.0.1.1.6.5.1.0.3.1.loligo.com. 3600 IN NAPTR 55 100 "u"     "E2U+mailto" "!^\\+13015611020$!mailto:jtodd@fox-den.com!" .\end{verbatim}Example 1: Simplest case, using first SIP return (use all defaultsexcept for domain name)\begin{verbatim}exten => 100,1,Set(foo=${ENUMLOOKUP(+13015611020,,,,loligo.com)})  returns: ${foo}="2203@sip.fox-den.com"\end{verbatim}Example 2: What is the first "tel" pointer type for this number?(after sorting by order/preference; default of "1" is assumed inoptions field)\begin{verbatim}exten => 100,1,Set(foo=${ENUMLOOKUP(+13015611020,tel,,,loligo.com)})  returns: ${foo}="+12125551212"\end{verbatim}Example 3: How many "sip" pointer type entries are there for this number?\begin{verbatim}exten => 100,1,Set(foo=${ENUMLOOKUP(+13015611020,sip,c,,loligo.com)})  returns: ${foo}=3\end{verbatim}Example 4: For all the "tel" pointer type entries, what is the secondone in the list? (after sorting by preference)\begin{verbatim}exten => 100,1,Set(foo=${ENUMLOOKUP(+13015611020,tel,,2,loligo.com)})  returns: ${foo}="+14155551212"\end{verbatim}Example 5: How many NAPTRs (tel, sip, mailto, etc.) are in the list for this number?\begin{verbatim}exten => 100,1,Set(foo=${ENUMLOOKUP(+13015611020,ALL,c,,loligo.com)})  returns: ${foo}=6\end{verbatim}Example 6: Give back the second full URI in the sorted list of all NAPTR URIs:\begin{verbatim}exten => 100,1,Set(foo=${ENUMLOOKUP(+13015611020,ALL,,2,loligo.com)})  returns: ${foo}="tel:+14155551212"  [note the "tel:" prefix in the string]\end{verbatim}Example 7: Look up first SIP entry for the number in the e164.arpa zone (all defaults)\begin{verbatim}exten => 100,1,Set(foo=${ENUMLOOKUP(+437203001721)})  returns: ${foo}="enum-test@sip.nemox.net"  [note: this result is  subject to change as it is "live" DNS and not under my control]\end{verbatim}Example 8: Look up the ISN mapping in freenum.org alpha test zone\begin{verbatim}exten => 100,1,Set(foo=${ENUMLOOKUP(1234*256,,,,freenum.org)})  returns: ${foo}="1234@204.91.156.10"  [note: this result is subject  to change as it is "live" DNS]\end{verbatim}Example 9: Give back the first SIP pointer for a number in the\begin{verbatim}enum.yoydynelabs.com zone (invalid lookup)exten => 100,1,Set(foo=${ENUMLOOKUP(1234567890,sip,,1,enum.yoyodynelabs.com)})  returns: ${foo}=""

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -