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

📄 enum.tex

📁 asterisk 是一个很有知名度开源软件
💻 TEX
📖 第 1 页 / 共 2 页
字号:
\end{verbatim}\subsection{Usage notes and subtle features}\begin{itemize}  \item The use of "+" in lookups is confusing, and warrants further  explanation.  All E.164 numbers ("global phone numbers") by  definition need a leading "+" during ENUM lookup.  If you neglect to  add a leading "+", you may discover that numbers that seem to exist  in the DNS aren't getting matched by the system or are returned with  a null string result.  This is due to the NAPTR reply requiring a  "+" in the regular expression matching sequence.  Older versions of  Asterisk add a "+" from within the code, which may confuse  administrators converting to the new function.  Please ensure that  all ENUM (e164.arpa) lookups contain a leading "+" before lookup, so  ensure your lookup includes the leading plus sign.  Other DNS trees  may or may not require a leading "+" - check before using those  trees, as it is possible the parsed NAPTRs will not provide correct  results unless you have the correct dialed string.  If you get  console messages like "WARNING[24907]: enum.c:222 parse\_naptr: NAPTR  Regex match failed." then it is very possible that the returned  NAPTR expects a leading "+" in the search string (or the returned  NAPTR is mis-formed.)  \item If a query is performed of type "c" ("count") and let's say you  get back 5 records and then some seconds later a query is made  against record 5 in the list, it may not be the case that the DNS  resolver has the same answers as it did a second or two ago - maybe  there are only 4 records in the list in the newest query.  The  resolver should be the canonical storage location for DNS records,  since that is the intent of ENUM.  However, some obscure future  cases may have wildly changing NAPTR records within several seconds.  This is a corner case, and probably only worth noting as a very rare  circumstance. (note: I do not object to Asterisk's dnsmgr method of  locally caching DNS replies, but this method needs to honor the TTL  given by the remote zone master.  Currently, the ENUMLOOKUP function  does not use the dnsmgr method of caching local DNS replies.)  \item If you want strict NAPTR value ordering, then it will be  necessary to use the "ALL" method to incrementally step through the  different returned NAPTR pointers.  You will need to use string  manipulation to strip off the returned method types, since the  results will look like "sip:12125551212" in the returned value.  This is a non-trivial task, though it is required in order to have  strict RFC compliance and to comply with the desires of the remote  party who is presenting NAPTRs in a particular order for a reason.  \item Default behavior for the function (even in event of an error) is  to move to the next priority, and the result is a null value.  Most  ENUM lookups are going to be failures, and it is the responsibility  of the dialplan administrator to manage error conditions within  their dialplan.  This is a change from the old app\_enumlookup method  and it's arbitrary priority jumping based on result type or failure.  \item Anything other than digits will be ignored in lookup strings.  Example: a search string of "+4372030blah01721" will turn into  1.2.7.1.0.0.3.0.2.7.3.4.e164.arpa. for the lookup.  The NAPTR  parsing may cause unexpected results if there are strings inside  your NAPTR lookups.  \item If there exist multiple records with the same weight and order as  a result of your query, the function will RANDOMLY select a single  NAPTR from those equal results.  \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.  \item The function will digest and return NAPTRs which use older  (deprecated) style, reversed method strings such as "sip+E2U"  instead of the more modern "E2U+sip"  \item There is no provision for multi-part methods at this time.  If  there are multiple NAPTRs with (as an example) a method of  "E2U+voice:sip" and then another NAPTR in the same DNS record with a  method of ""E2U+sip", the system will treat these both as method  "sip" and they will be separate records from the perspective of the  function.  Of course, if both records point to the same URI and have  equal priority/weight (as is often the case) then this will cause no  serious difficulty, but it bears mentioning.  \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  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.\end{itemize}\subsection{Some more Examples}All examples below except where noted use "e164.arpa" as thereferenced domain, which is the default domain name for ENUMLOOKUP.All numbers are assumed to not have a leading "+" as dialed by theinbound channel, so that character is added where necessary duringENUMLOOKUP function calls.\begin{astlisting}\begin{verbatim}; example 1;; Assumes North American international dialing (011) prefix.; Look up the first SIP result and send the call there, otherwise;  send the call out a PRI.  This is the most simple possible;  ENUM example, but only uses the first SIP reply in the list of;  NAPTR(s).;exten => _011.,1,Set(enumresult=${ENUMLOOKUP(+${EXTEN:3})})exten => _011.,n,Dial(SIP/${enumresult})exten => _011.,n,Dial(DAHDI/g1/${EXTEN});; end example 1; example 2;; Assumes North American international dialing (011) prefix.; Check to see if there are multiple SIP NAPTRs returned by;  the lookup, and dial each in order.  If none work (or none;  exist) then send the call out a PRI, group 1.;exten => _011.,1,Set(sipcount=${ENUMLOOKUP(${EXTEN:3},sip,c)}|counter=0)exten => _011.,n,While($["${counter}"<"${sipcount}"])exten => _011.,n,Set(counter=$[${counter}+1])exten => _011.,n,Dial(SIP/${ENUMLOOKUP(+${EXTEN:3},sip,,${counter})})exten => _011.,n,EndWhileexten => _011.,n,Dial(DAHDI/g1/${EXTEN});; end example 2; example 3;; This example expects an ${EXTEN} that is an e.164 number (like;  14102241145 or 437203001721); Search through e164.arpa and then also search through e164.org;  to see if there are any valid SIP or IAX termination capabilities.;  If none, send call out via DAHDI channel 1.;; Start first with e164.arpa zone...;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])exten => _X.,4,Dial(SIP/${ENUMLOOKUP(+${EXTEN},sip,,${counter})})exten => _X.,5,GotoIf($["${counter}"<"${sipcount}"]?3:6);exten => _X.,6,Set(iaxcount=${ENUMLOOKUP(+${EXTEN},iax2,c)}|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})})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 DAHDI")exten => _X.,23,Dial(DAHDI/g1/${EXTEN});; end example 3\end{verbatim}\end{astlisting}

⌨️ 快捷键说明

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