enum_admin.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389
  1. <?xml version="1.0" encoding='ISO-8859-1'?>
  2. <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
  4. <!-- Include general documentation entities -->
  5. <!ENTITY % docentities SYSTEM "../../../docbook/entities.xml">
  6. %docentities;
  7. ]>
  8. <!-- Enum Module User's Guide -->
  9. <chapter>
  10. <title>&adminguide;</title>
  11. <section id="sec-overview">
  12. <title>Overview</title>
  13. <para>
  14. Enum module implements [i_]enum_query functions that make an enum query
  15. based on the user part of the current Request-URI. These functions
  16. assume that the Request URI user part consists of an international phone number
  17. of the form +decimal-digits, where the number of digits is at
  18. least 2 and at most 15. Out of this number
  19. <function moreinfo="none">enum_query</function> forms a domain name,
  20. where the digits are in reverse order and separated by dots followed by
  21. domain suffix that by default is <quote>e164.arpa.</quote>. For example,
  22. if the user part is +35831234567, the domain
  23. name will be <quote>7.6.5.4.3.2.1.3.8.5.3.e164.arpa.</quote>.
  24. <function moreinfo="none">i_enum_query</function> operates in a similar
  25. fashion. The only difference is that it adds a label (default "i")
  26. to branch off from the default, user-ENUM tree to an infrastructure ENUM tree.
  27. </para>
  28. <para>
  29. After forming the domain name,
  30. <function moreinfo="none">enum_query</function> queries
  31. DNS for enum NAPTR records. From the possible responses
  32. <function moreinfo="none">enum_query</function> chooses those records,
  33. whose flags field has string value "u", and whose services field has
  34. string value "e2u+[service:]sip" or
  35. "e2u+type[:subtype][+type[:subtype]...]" (case is ignored in both
  36. cases), and whose regexp field is of the form !pattern!replacement!.
  37. </para>
  38. <para>
  39. Then <function moreinfo="none">enum_query</function> sorts the chosen
  40. NAPTR records based on their &lt;order, preference&gt;. After sorting,
  41. <function moreinfo="none">enum_query</function> replaces the current
  42. Request URI by applying the regular expression of the most preferred NAPTR record
  43. to its user part and appends to the request new branches by applying regexp of
  44. each remaining NAPTR record to the user part of the
  45. current Request URI. If a new URI is a tel: URI,
  46. <function moreinfo="none">enum_query</function> appends to it as tel:
  47. URI parameters the value of tel_uri_params module parameter. Finally,
  48. <function moreinfo="none">enum_query</function> associates a q value
  49. with each new URI based on the &lt;order, preference&gt; of the
  50. corresponding NAPTR record.
  51. </para>
  52. <para>
  53. When using <function moreinfo="none">enum_query</function> without any
  54. parameters, it searches for NAPTRs with service type "e2u+sip" in the
  55. default enum tree. When using
  56. <function moreinfo="none">enum_query</function> with a single parameter,
  57. this parameter will be used as enum tree. When using
  58. <function moreinfo="none">enum_query</function>
  59. with two parameters, the functionality depends on the first letter in
  60. the second parameter. When the first letter is not a '+' sign, the
  61. second parameter will be used to search for NAPTRs with service type
  62. "e2u+parameter:sip". When the second parameter starts with a '+' sign,
  63. the ENUM lookup also supports compound NAPTRs
  64. (e.g. "e2u+voice:sip+video:sip") and searching for multiple service
  65. types within one lookup. Multiple service types must be separeted
  66. by a '+' sign.
  67. </para>
  68. <para>
  69. Most of the time you want to route based on the RURI. On rare occasions
  70. you may wish to route based on something else. The function
  71. <function moreinfo="none">enum_pv_query</function> mimics the behavior
  72. of the <function moreinfo="none">enum_query</function> function except the
  73. E.164 number in its pseudo variable argument is used for the enum lookup instead of the user
  74. part of the RURI.
  75. </para>
  76. <para>
  77. Enum query returns 1 if the current Request URI was replaced
  78. and -1 if not.
  79. </para>
  80. <para>
  81. Enum module also implements is_from_user_enum function.
  82. This function does an enum lookup on the from user and
  83. returns true if found, false otherwise.
  84. </para>
  85. </section>
  86. <section>
  87. <title>Dependencies</title>
  88. <para>
  89. The module depends on the following modules (in other words the
  90. listed modules must be loaded before this module):
  91. <itemizedlist>
  92. <listitem>
  93. <para>No dependencies.</para>
  94. </listitem>
  95. </itemizedlist>
  96. </para>
  97. </section>
  98. <section>
  99. <title>Exported Parameters</title>
  100. <section>
  101. <title><varname>domain_suffix</varname> (string)</title>
  102. <para>
  103. The domain suffix to be added to the domain name obtained from
  104. the digits of an <acronym>E164</acronym> number. Can be overridden
  105. by a parameter to enum_query.
  106. </para>
  107. <para>
  108. Default value is <quote>e164.arpa.</quote>
  109. </para>
  110. <example>
  111. <title>Setting domain_suffix module parameter</title>
  112. <programlisting format="linespecific">
  113. modparam("enum", "domain_suffix", "e1234.arpa.")
  114. </programlisting>
  115. </example>
  116. </section>
  117. <section>
  118. <title><varname>tel_uri_params</varname> (string)</title>
  119. <para>
  120. A string whose contents is appended to each new tel URI in the
  121. request as tel URI parameters.
  122. </para>
  123. <note>
  124. <para>
  125. Currently &siprouter; does not support tel URIs. This means that at present
  126. tel_uri_params is appended as URI parameters to every URI.
  127. </para>
  128. </note>
  129. <para>
  130. Default value is <quote></quote>
  131. </para>
  132. <example>
  133. <title>Setting tel_uri_params module parameter</title>
  134. <programlisting format="linespecific">
  135. modparam("enum", "tel_uri_params", ";npdi")
  136. </programlisting>
  137. </example>
  138. </section>
  139. <section>
  140. <title><varname>i_enum_suffix</varname> (string)</title>
  141. <para>
  142. The domain suffix to be used for i_enum_query() lookups.
  143. Can be overridden by a parameter to i_enum_query.
  144. </para>
  145. <para>
  146. Default value is <quote>e164.arpa.</quote>
  147. </para>
  148. <example>
  149. <title>Setting i_enum_suffix module parameter</title>
  150. <programlisting format="linespecific">
  151. modparam("enum", "i_enum_suffix", "e1234.arpa.")
  152. </programlisting>
  153. </example>
  154. </section>
  155. <section>
  156. <title><varname>branchlabel</varname> (string)</title>
  157. <para>
  158. This parameter determines which label i_enum_query() will use
  159. to branch off to the infrastructure ENUM tree.
  160. </para>
  161. <para>
  162. Default value is <quote>"i"</quote>
  163. </para>
  164. <example>
  165. <title>Setting brachlabel module parameter</title>
  166. <programlisting format="linespecific">
  167. modparam("enum", "branchlabel", "i")
  168. </programlisting>
  169. </example>
  170. </section>
  171. <section>
  172. <title><varname>bl_algorithm</varname> (string)</title>
  173. <para>
  174. This parameter determines which algorithm i_enum_query() will use
  175. to select the position in the DNS tree where the infrastructure tree
  176. branches off the user ENUM tree.
  177. </para>
  178. <para>
  179. If set to "cc", i_enum_query() will always insert the
  180. label at the country-code level.
  181. Examples: i.1.e164.arpa, i.3.4.e164.arpa, i.2.5.3.e164.arpa
  182. </para>
  183. <para>
  184. If set to "txt", i_enum_query() will look for a TXT record at
  185. [branchlabel].[reverse-country-code].[i_enum_suffix] to indicate after how many digits the
  186. label should in inserted.
  187. <example>
  188. <title>Zone file example</title>
  189. <programlisting format="linespecific">
  190. i.1.e164.arpa. IN TXT "4"
  191. 9.9.9.8.7.6.5.i.4.3.2.1.e164.arpa. IN NAPTR "NAPTR content for +1 234 5678 999"
  192. </programlisting>
  193. </example>
  194. </para>
  195. <para>
  196. If set to "ebl", i_enum_query() will look for an EBL (ENUM Branch Label) record at
  197. [branchlabel].[reverse-country-code].[i_enum_suffix]. See http://www.ietf.org/internet-drafts/draft-lendl-enum-branch-location-record-00.txt for a description of that record and the
  198. meaning of the fields. The RR type for the EBL has not been allocated yet.
  199. This version of the code uses 65300. See resolve.h.
  200. <example>
  201. <title>Zone file example</title>
  202. <programlisting format="linespecific">
  203. i.1.e164.arpa. TYPE65300 \# 14 (
  204. 04 ; position
  205. 01 69 ; separator
  206. 04 65 31 36 34 04 61 72 70 61 00 ; e164.arpa
  207. ; )
  208. 9.9.9.8.7.6.5.i.4.3.2.1.e164.arpa. IN NAPTR "NAPTR content for +1 234 5678 999"
  209. </programlisting>
  210. </example>
  211. </para>
  212. <para>
  213. Default value is <quote>cc</quote>
  214. </para>
  215. <example>
  216. <title>Setting the bl_algorithm module parameter</title>
  217. <programlisting format="linespecific">
  218. modparam("enum", "bl_algorithm", "txt")
  219. </programlisting>
  220. </example>
  221. </section>
  222. </section>
  223. <section>
  224. <title>Exported Functions</title>
  225. <section>
  226. <title>
  227. <function moreinfo="none">enum_query(["suffix"[,"service"]])</function>
  228. </title>
  229. <para>
  230. The function performs an enum query and rewrites the Request-URI with
  231. the result of the query. See <xref linkend="sec-overview"/> for more
  232. information.
  233. </para>
  234. <para>Meaning of the parameters is as follows:</para>
  235. <itemizedlist>
  236. <listitem>
  237. <para><emphasis>suffix</emphasis> - Suffix
  238. string to be appended to the domain name. String may contain
  239. pseudo variables.
  240. </para>
  241. </listitem>
  242. <listitem>
  243. <para><emphasis>service</emphasis> - Service
  244. string to be used in the service field. String may contain
  245. pseudo variables.
  246. </para>
  247. </listitem>
  248. </itemizedlist>
  249. <para>
  250. This function can be used from REQUEST_ROUTE.
  251. </para>
  252. <example>
  253. <title><function moreinfo="none">enum_query</function> usage</title>
  254. <programlisting format="linespecific">
  255. ...
  256. # search for "e2u+sip" in freenum.org
  257. enum_query("freenum.org.");
  258. ...
  259. # search for "e2u+sip" in default tree (configured as parameter)
  260. enum_query();
  261. ...
  262. # search for "e2u+voice:sip" in e164.arpa
  263. enum_query("e164.arpa.","voice");
  264. ...
  265. # search for service type "sip" or "voice:sip" or "video:sip"
  266. # note the '+' sign in front of the second parameter
  267. enum_query("e164.arpa.","+sip+voice:sip+video:sip");
  268. ...
  269. # quering for service sip and voice:sip
  270. enum_query("e164.arpa.");
  271. enum_query("e164.arpa.","voice");
  272. # or use instead
  273. enum_query("e164.arpa.","+sip+voice:sip");
  274. ...
  275. </programlisting>
  276. </example>
  277. </section>
  278. <section>
  279. <title>
  280. <function moreinfo="none">enum_pv_query("pvar"[,"suffix"[,"service"]])</function>
  281. </title>
  282. <para>
  283. The function performs an enum query on E.164 number stored
  284. in its pseudo variable argument and rewrites the Request-URI with
  285. the result of the query. See <xref linkend="sec-overview"/> for more
  286. information.
  287. </para>
  288. <para>Meaning of the parameters is as follows:</para>
  289. <itemizedlist>
  290. <listitem>
  291. <para><emphasis>pvar</emphasis> - Pseudo
  292. variable that holds an E.164 number on which enum
  293. query is performed.
  294. </para>
  295. </listitem>
  296. <listitem>
  297. <para><emphasis>suffix</emphasis> - Suffix to be appended to the
  298. domain name.
  299. </para>
  300. </listitem>
  301. <listitem>
  302. <para><emphasis>service</emphasis> - Service string to be used in
  303. the service field.
  304. </para>
  305. </listitem>
  306. </itemizedlist>
  307. <para>
  308. This function can be used from REQUEST_ROUTE.
  309. </para>
  310. <example>
  311. <title><function moreinfo="none">enum_pv_query</function> usage</title>
  312. <programlisting format="linespecific">
  313. ...
  314. # search for "e2u+sip" in freenum.org
  315. enum_pv_query("$avp(i:100)", "freenum.org.");
  316. ...
  317. # search for "e2u+sip" in default tree (configured as parameter)
  318. enum_pv_query("$fU");
  319. ...
  320. # search for "e2u+voice:sip" in e164.arpa
  321. enum_pv_query("$avp(i:100)","e164.arpa.","voice");
  322. ...
  323. # search for service type "sip" or "voice:sip" or "video:sip"
  324. # note the '+' sign in front of the second parameter
  325. enum_pv_query("$fU","e164.arpa.","+sip+voice:sip+video:sip");
  326. ...
  327. # quering for service sip and voice:sip
  328. enum_pv_query("$avp(i:100)","e164.arpa.");
  329. enum_pv_query("$avp(i:100)","e164.arpa.","voice");
  330. # or use instead
  331. enum_pv_query("$avp(i:100)","e164.arpa.","+sip+voice:sip");
  332. ...
  333. </programlisting>
  334. </example>
  335. </section>
  336. <section>
  337. <title>
  338. <function moreinfo="none">i_enum_query(["suffix"[,"service"]])</function>
  339. </title>
  340. <para>
  341. The function performs an enum query and rewrites the Request-URI with
  342. the result of the query. This the Infrastructure-ENUM version of enum_query().
  343. The only difference to enum_query() is in the calculation of the
  344. FQDN where NAPTR records are looked for.
  345. </para>
  346. <para>
  347. See ftp://ftp.rfc-editor.org/in-notes/internet-drafts/draft-haberler-carrier-enum-01.txt
  348. for the rationale behind this function.
  349. </para>
  350. </section>
  351. <section>
  352. <title><function moreinfo="none">is_from_user_enum()</function></title>
  353. <para>
  354. Checks if the user part of from <abbrev>URI</abbrev>
  355. is found in an enum lookup.
  356. Returns 1 if yes and -1 if not.
  357. </para>
  358. <para>
  359. This function can be used from REQUEST_ROUTE.
  360. </para>
  361. <example>
  362. <title><function moreinfo="none">is_from_user_enum</function> usage</title>
  363. <programlisting format="linespecific">
  364. ...
  365. if (is_from_user_enum()) {
  366. ....
  367. };
  368. ...
  369. </programlisting>
  370. </example>
  371. </section>
  372. </section>
  373. </chapter>