enum_admin.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  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 <function>is_from_user_enum</function> 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>Parameters</title>
  100. <section id="enum.p.domain_suffix">
  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 id="enum.p.tel_uri_params">
  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 id="enum.p.i_enum_suffix">
  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 id="enum.p.branchlabel">
  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 id="enum.p.bl_algorithm">
  172. <title><varname>bl_algorithm</varname> (string)</title>
  173. <para>
  174. This parameter determines which algorithm the
  175. <function>i_enum_query()</function> function will use
  176. to select the position in the DNS tree where the infrastructure tree
  177. branches off the user ENUM tree.
  178. </para>
  179. <para>
  180. If set to "cc", i_enum_query() will always insert the
  181. label at the country-code level.
  182. Examples: i.1.e164.arpa, i.3.4.e164.arpa, i.2.5.3.e164.arpa
  183. </para>
  184. <para>
  185. If set to "txt", i_enum_query() will look for a TXT record at
  186. [branchlabel].[reverse-country-code].[i_enum_suffix] to indicate after how many digits the
  187. label should in inserted.
  188. <example>
  189. <title>Zone file example</title>
  190. <programlisting format="linespecific">
  191. i.1.e164.arpa. IN TXT "4"
  192. 9.9.9.8.7.6.5.i.4.3.2.1.e164.arpa. IN NAPTR "NAPTR content for +1 234 5678 999"
  193. </programlisting>
  194. </example>
  195. </para>
  196. <para>
  197. If set to "ebl", i_enum_query() will look for an EBL (ENUM Branch Label) record at
  198. [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
  199. meaning of the fields. The RR type for the EBL has not been allocated yet.
  200. This version of the code uses 65300. See resolve.h.
  201. <example>
  202. <title>Zone file example</title>
  203. <programlisting format="linespecific">
  204. i.1.e164.arpa. TYPE65300 \# 14 (
  205. 04 ; position
  206. 01 69 ; separator
  207. 04 65 31 36 34 04 61 72 70 61 00 ; e164.arpa
  208. ; )
  209. 9.9.9.8.7.6.5.i.4.3.2.1.e164.arpa. IN NAPTR "NAPTR content for +1 234 5678 999"
  210. </programlisting>
  211. </example>
  212. </para>
  213. <para>
  214. Default value is <quote>cc</quote>
  215. </para>
  216. <example>
  217. <title>Setting the bl_algorithm module parameter</title>
  218. <programlisting format="linespecific">
  219. modparam("enum", "bl_algorithm", "txt")
  220. </programlisting>
  221. </example>
  222. </section>
  223. </section>
  224. <section>
  225. <title>Functions</title>
  226. <section id="enum.f.enum_query">
  227. <title>
  228. <function moreinfo="none">enum_query(["suffix"[,"service"]])</function>
  229. </title>
  230. <para>
  231. The function performs an enum query and rewrites the Request-URI with
  232. the result of the query. See <xref linkend="sec-overview"/> for more
  233. information.
  234. </para>
  235. <para>Meaning of the parameters is as follows:</para>
  236. <itemizedlist>
  237. <listitem>
  238. <para><emphasis>suffix</emphasis> - Suffix
  239. string to be appended to the domain name. String may contain
  240. pseudo variables.
  241. </para>
  242. </listitem>
  243. <listitem>
  244. <para><emphasis>service</emphasis> - Service
  245. string to be used in the service field. String may contain
  246. pseudo variables.
  247. </para>
  248. </listitem>
  249. </itemizedlist>
  250. <para>
  251. This function can be used from REQUEST_ROUTE.
  252. </para>
  253. <example>
  254. <title><function moreinfo="none">enum_query</function> usage</title>
  255. <programlisting format="linespecific">
  256. ...
  257. # search for "e2u+sip" in freenum.org
  258. enum_query("freenum.org.");
  259. ...
  260. # search for "e2u+sip" in default tree (configured as parameter)
  261. enum_query();
  262. ...
  263. # search for "e2u+voice:sip" in e164.arpa
  264. enum_query("e164.arpa.","voice");
  265. ...
  266. # search for service type "sip" or "voice:sip" or "video:sip"
  267. # note the '+' sign in front of the second parameter
  268. enum_query("e164.arpa.","+sip+voice:sip+video:sip");
  269. ...
  270. # quering for service sip and voice:sip
  271. enum_query("e164.arpa.");
  272. enum_query("e164.arpa.","voice");
  273. # or use instead
  274. enum_query("e164.arpa.","+sip+voice:sip");
  275. ...
  276. </programlisting>
  277. </example>
  278. </section>
  279. <section id="enum.f.enum_pv_query">
  280. <title>
  281. <function moreinfo="none">enum_pv_query("pvar"[,"suffix"[,"service"]])</function>
  282. </title>
  283. <para>
  284. The function performs an enum query on E.164 number stored
  285. in its pseudo variable argument and rewrites the Request-URI with
  286. the result of the query. See <xref linkend="sec-overview"/> for more
  287. information.
  288. </para>
  289. <para>Meaning of the parameters is as follows:</para>
  290. <itemizedlist>
  291. <listitem>
  292. <para><emphasis>pvar</emphasis> - Pseudo
  293. variable that holds an E.164 number on which enum
  294. query is performed.
  295. </para>
  296. </listitem>
  297. <listitem>
  298. <para><emphasis>suffix</emphasis> - Suffix to be appended to the
  299. domain name.
  300. </para>
  301. </listitem>
  302. <listitem>
  303. <para><emphasis>service</emphasis> - Service string to be used in
  304. the service field.
  305. </para>
  306. </listitem>
  307. </itemizedlist>
  308. <para>
  309. This function can be used from REQUEST_ROUTE.
  310. </para>
  311. <example>
  312. <title><function moreinfo="none">enum_pv_query</function> usage</title>
  313. <programlisting format="linespecific">
  314. ...
  315. # search for "e2u+sip" in freenum.org
  316. enum_pv_query("$avp(i:100)", "freenum.org.");
  317. ...
  318. # search for "e2u+sip" in default tree (configured as parameter)
  319. enum_pv_query("$fU");
  320. ...
  321. # search for "e2u+voice:sip" in e164.arpa
  322. enum_pv_query("$avp(i:100)","e164.arpa.","voice");
  323. ...
  324. # search for service type "sip" or "voice:sip" or "video:sip"
  325. # note the '+' sign in front of the second parameter
  326. enum_pv_query("$fU","e164.arpa.","+sip+voice:sip+video:sip");
  327. ...
  328. # quering for service sip and voice:sip
  329. enum_pv_query("$avp(i:100)","e164.arpa.");
  330. enum_pv_query("$avp(i:100)","e164.arpa.","voice");
  331. # or use instead
  332. enum_pv_query("$avp(i:100)","e164.arpa.","+sip+voice:sip");
  333. ...
  334. </programlisting>
  335. </example>
  336. </section>
  337. <section id="enum.f.i_enum_query">
  338. <title>
  339. <function moreinfo="none">i_enum_query(["suffix"[,"service"]])</function>
  340. </title>
  341. <para>
  342. The function performs an enum query and rewrites the Request-URI with
  343. the result of the query. This the Infrastructure-ENUM version of enum_query().
  344. The only difference to enum_query() is in the calculation of the
  345. FQDN where NAPTR records are looked for.
  346. </para>
  347. <para>
  348. See ftp://ftp.rfc-editor.org/in-notes/internet-drafts/draft-haberler-carrier-enum-01.txt
  349. for the rationale behind this function.
  350. </para>
  351. </section>
  352. <section id="enum.f.is_from_user_enum">
  353. <title><function moreinfo="none">is_from_user_enum()</function></title>
  354. <para>
  355. Checks if the user part of from <abbrev>URI</abbrev>
  356. is found in an enum lookup.
  357. Returns 1 if yes and -1 if not.
  358. </para>
  359. <para>
  360. This function can be used from REQUEST_ROUTE.
  361. </para>
  362. <example>
  363. <title><function moreinfo="none">is_from_user_enum</function> usage</title>
  364. <programlisting format="linespecific">
  365. ...
  366. if (is_from_user_enum()) {
  367. ....
  368. };
  369. ...
  370. </programlisting>
  371. </example>
  372. </section>
  373. </section>
  374. </chapter>