Browse Source

Documentation updates

oej 16 years ago
parent
commit
2cd87dedde

+ 1 - 0
docbook/entities.xml

@@ -4,6 +4,7 @@
 <!ENTITY iptel "<ulink url='http://iptel.org'>iptel.org</ulink>">
 <!ENTITY iptel "<ulink url='http://iptel.org'>iptel.org</ulink>">
 
 
 <!ENTITY kamailio "Kamailio">
 <!ENTITY kamailio "Kamailio">
+<!ENTITY kamailiobinary "kamailio">
 <!ENTITY kamailioname "Kamailio SIP Server Platform">
 <!ENTITY kamailioname "Kamailio SIP Server Platform">
 <!ENTITY kamailioconfig "kamailio.cfg">
 <!ENTITY kamailioconfig "kamailio.cfg">
 
 

+ 10 - 9
modules_k/ldap/README

@@ -281,8 +281,8 @@ Note
    3.2. LDAP Session Settings
    3.2. LDAP Session Settings
    3.3. Configuration File Example
    3.3. Configuration File Example
 
 
-   The module reads an external confiuration file at module initialization
-   time that includes LDAP session definitions.
+   The module reads an external configuration file at module
+   initialization time that includes LDAP session definitions.
 
 
 3.1. Configuration File Syntax
 3.1. Configuration File Syntax
 
 
@@ -428,7 +428,7 @@ ldap_client_bind_timeout = 500
    Default value: /usr/local/etc/kamailio/ldap.cfg
    Default value: /usr/local/etc/kamailio/ldap.cfg
 
 
    Example 1.8. config_file parameter usage
    Example 1.8. config_file parameter usage
-modparam("ldap", "config_file", "/etc/kamailio/ldap.ini")
+modparam("ldap", "config_file", "/usr/local/etc/kamailio/ldap.ini")
 
 
 5. Exported Functions
 5. Exported Functions
 
 
@@ -444,10 +444,10 @@ modparam("ldap", "config_file", "/etc/kamailio/ldap.ini")
 
 
    Performs an LDAP search operation using given LDAP URL and stores
    Performs an LDAP search operation using given LDAP URL and stores
    result internally for later retrieval by ldap_result* functions. If one
    result internally for later retrieval by ldap_result* functions. If one
-   ore more LDAP entries are found the function returns the number of
-   found entries which evaluates to TRUE in the Kamailio configuration
-   script. It returns -1 (FALSE) in case no LDAP entry was found, and -2
-   (FALSE) if an internal error like e.g. an LDAP error occurred.
+   or more LDAP entries are found the function returns the number of found
+   entries which evaluates to TRUE in the Kamailio configuration script.
+   It returns -1 (FALSE) in case no LDAP entry was found, and -2 (FALSE)
+   if an internal error like e.g. an LDAP error occurred.
 
 
    Function Parameters:
    Function Parameters:
 
 
@@ -771,7 +771,8 @@ if (ldap_search(
    OpenLDAP library (libldap) and header files (libldap-dev) v2.1 or
    OpenLDAP library (libldap) and header files (libldap-dev) v2.1 or
    greater (this module was tested with v2.1.3 and v2.3.32) are required
    greater (this module was tested with v2.1.3 and v2.3.32) are required
    for compiling the LDAP module. The OpenLDAP source is available at
    for compiling the LDAP module. The OpenLDAP source is available at
-   http://www.openldap.org/.
+   http://www.openldap.org/. Note that TLS support needs to be added a
+   compile time for the libraries.
 
 
    The OpenLDAP library is available pre-compiled for most UNIX/Linux
    The OpenLDAP library is available pre-compiled for most UNIX/Linux
    flavors. On Debian/Ubuntu, the following packages must be installed:
    flavors. On Debian/Ubuntu, the following packages must be installed:
@@ -808,7 +809,7 @@ Chapter 2. Developer Guide
    load_ldap_api function which returns a pointer to a ldap_api structure.
    load_ldap_api function which returns a pointer to a ldap_api structure.
    This structure includes pointers to the API functions described below.
    This structure includes pointers to the API functions described below.
    The LDAP module source file api.h includes all declarations needed to
    The LDAP module source file api.h includes all declarations needed to
-   load the API, it has to be included in the file that loads the API.
+   load the API, it has to be included in the file that use the API.
    Loading the API is typically done inside a module's mod_init call as
    Loading the API is typically done inside a module's mod_init call as
    the following example shows:
    the following example shows:
 
 

+ 88 - 42
modules_k/ldap/doc/ldap_admin.xml

@@ -13,7 +13,10 @@
     <section>
     <section>
       <title>Overview</title>
       <title>Overview</title>
 
 
-      <para>The LDAP module implements an LDAP search interface for &kamailio;. It exports script functions to perform an LDAP search operation and to store the search results as &kamailio; AVPs. This allows for using LDAP directory data in the &kamailio; SIP message routing script.</para>
+      <para>The LDAP module implements an LDAP search interface for &kamailio;. 
+	It exports script functions to perform an LDAP search operation and to 
+	store the search results as &kamailio; AVPs. This allows for using LDAP
+	directory data in the &kamailio; SIP message routing script.</para>
       
       
       <para>The following features are offered by the LDAP module:</para>
       <para>The following features are offered by the LDAP module:</para>
       <itemizedlist>
       <itemizedlist>
@@ -32,37 +35,58 @@
         <listitem>
         <listitem>
             <para>LDAP server failover and automatic reconnect</para>
             <para>LDAP server failover and automatic reconnect</para>
         </listitem>
         </listitem>
-		<listitem>
+	<listitem>
             <para>Configurable LDAP connection and bind timeouts</para>
             <para>Configurable LDAP connection and bind timeouts</para>
         </listitem>
         </listitem>
-		<listitem>
+	<listitem>
             <para>Module API for LDAP search operations that can be used by other &kamailio; modules</para>
             <para>Module API for LDAP search operations that can be used by other &kamailio; modules</para>
         </listitem>
         </listitem>
       </itemizedlist> 
       </itemizedlist> 
       
       
-      <para>The module implementation makes use of the open source OpenLDAP library available on most UNIX/Linux platforms. Besides LDAP server failover and automatic reconnect, this module can handle multiple LDAP sessions concurrently allowing to access data stored on different LDAP servers. Each &kamailio; worker process maintains one LDAP TCP connection per configured LDAP server. This enables parallel execution of LDAP requests and offloads LDAP concurrency control to the LDAP server(s).</para>
+      <para>The module implementation makes use of the open source <emphasis>OpenLDAP</emphasis> library available
+	on most UNIX/Linux platforms. Besides LDAP server failover and automatic reconnect, this module can handle
+	multiple LDAP sessions concurrently allowing to access data stored on different LDAP servers. Each &kamailio;
+	worker process maintains one LDAP TCP connection per configured LDAP server. This enables parallel execution
+	of LDAP requests and offloads LDAP concurrency control to the LDAP server(s).</para>
       
       
-      <para>An LDAP search module API is provided that can be used by other &kamailio; modules. A module using this API does not have to implement LDAP connection management and configuration, while still having access to the full OpenLDAP API for searching and result handling.</para> 
+      <para>An LDAP search module API is provided that can be used by other &kamailio; modules. A module using this
+	API does not have to implement LDAP connection management and configuration, while still having access
+	to the full OpenLDAP API for searching and result handling.</para> 
       
       
-      <para>Since LDAP server implementations are optimized for fast read access they are a good choice to store SIP provisioning data. Performance tests have shown that this module achieves lower data access times and higher call rates than other database modules like e.g. the &kamailio; MYSQL module.</para>
+      <para>Since LDAP server implementations are optimized for fast read access they are a good choice to store SIP
+	provisioning data. Performance tests have shown that this module achieves lower data access times and higher
+	call rates than other database modules like e.g. the &kamailio; MYSQL module.</para>
 
 
       <section>
       <section>
         <title>Usage Basics</title>
         <title>Usage Basics</title>
 
 
         <para>
         <para>
-			First so called LDAP sessions have to be specified in an external configuration file (as described in <xref linkend="ldap-config" xreflabel="LDAP Configuration File"/>). Each LDAP session includes LDAP server access parameters like server hostname or connection timeouts. Normally only a single LDAP session will be used unless there is a need to access more than one LDAP server. The LDAP session name will then be used in the &kamailio; configuration script to refer to a specific LDAP session.
+	First so called LDAP sessions have to be specified in an external configuration file (as described in
+	<xref linkend="ldap-config" xreflabel="LDAP Configuration File"/>). Each LDAP session includes LDAP server
+	access parameters like server hostname or connection timeouts. Normally only a single LDAP session will be
+	used unless there is a need to access more than one LDAP server. The LDAP session name will then be used in
+	the &kamailio; configuration script to refer to a specific LDAP session.
         </para>
         </para>
 
 
         <para>
         <para>
-			The <varname>ldap_search</varname> function (<xref linkend="ldap-search-fn"/>) performs an LDAP search operation. It expects an LDAP URL as input which includes the LDAP session name and search parameters. <xref linkend="ldap-urls"/>  provides a quick overview on LDAP URLs.
+	The <varname>ldap_search</varname> function (<xref linkend="ldap-search-fn"/>) performs an LDAP search
+	operation. It expects an LDAP URL as input which includes the LDAP session name and search parameters.
+	<xref linkend="ldap-urls"/>  provides a quick overview on LDAP URLs.
         </para>
         </para>
         
         
         <para>
         <para>
-			The result of an LDAP search is stored internally and can be accessed with one of the <varname>ldap_result*</varname> functions. <varname>ldap_result</varname> (<xref linkend="ldap-result-fn"/>) stores resulting LDAP attribute value as AVPs. <varname>ldap_result_check</varname> (<xref linkend="ldap-result-check-fn"/>) is a convenience function to compare a string with LDAP attribute values using regular expression matching. Finally, <varname>ldap_result_next</varname> (<xref linkend="ldap-result-next-fn"/>) allows to handle LDAP search queries that return more than one LDAP entry.
+	The result of an LDAP search is stored internally and can be accessed with one of the
+	<varname>ldap_result*</varname> functions. <varname>ldap_result</varname> (<xref linkend="ldap-result-fn"/>)
+	stores resulting LDAP attribute value as AVPs. <varname>ldap_result_check</varname>
+	(<xref linkend="ldap-result-check-fn"/>) is a convenience function to compare a string with LDAP attribute
+	values using regular expression matching. Finally, <varname>ldap_result_next</varname>
+	(<xref linkend="ldap-result-next-fn"/>) allows to handle LDAP search queries that return more than one LDAP entry.
         </para>
         </para>
         
         
         <para>
         <para>
-        All <varname>ldap_result*</varname> functions do always access the LDAP result set from the last <varname>ldap_search</varname> call. This should be kept in mind when calling <varname>ldap_search</varname> more than once in the &kamailio; configuration script.
+        All <varname>ldap_result*</varname> functions do always access the LDAP result set from the last
+	<varname>ldap_search</varname> call. This should be kept in mind when calling <varname>ldap_search</varname>
+	more than once in the &kamailio; configuration script.
         </para>
         </para>
       </section>
       </section>
 
 
@@ -70,11 +94,14 @@
         <title>LDAP URLs</title>
         <title>LDAP URLs</title>
 
 
         <para>
         <para>
-        <varname>ldap_search</varname> expects an LDAP URL as argument. This section describes the format and semantics of an LDAP URL.
+        <varname>ldap_search</varname> expects an LDAP URL as argument. This section describes the format and semantics of
+	an LDAP URL.
         </para>
         </para>
 
 
         <para>
         <para>
-			RFC 4516 <xref linkend="RFC4516"/> describes the format of an LDAP Uniform Resource Locator (URL). An LDAP URL represents an LDAP search operation in a compact format. The LDAP URL format is defined as follows (slightly modified, refer to section 2 of <xref linkend="RFC4516"/> for ABNF notation):
+	RFC 4516 <xref linkend="RFC4516"/> describes the format of an LDAP Uniform Resource Locator (URL). An LDAP URL
+	represents an LDAP search operation in a compact format. The LDAP URL format is defined as follows (slightly
+	modified, refer to section 2 of <xref linkend="RFC4516"/> for ABNF notation):
         </para>
         </para>
 
 
         <blockquote>
         <blockquote>
@@ -98,8 +125,7 @@
 
 
             <listitem>
             <listitem>
               <para>Base Distinguished Name (DN) of LDAP search or target of
               <para>Base Distinguished Name (DN) of LDAP search or target of
-              non-search operation, as defined in RFC 4514 <xref
-				  linkend="RFC4514"/></para>
+              non-search operation, as defined in RFC 4514 <xref linkend="RFC4514"/></para>
             </listitem>
             </listitem>
           </varlistentry>
           </varlistentry>
 
 
@@ -127,7 +153,7 @@
 
 
             <listitem>
             <listitem>
               <para>LDAP search filter definition following rules of RFC 4515
               <para>LDAP search filter definition following rules of RFC 4515
-				  <xref linkend="RFC4515"/><note>
+		  <xref linkend="RFC4515"/><note>
                   <para>The following table lists characters that have to be
                   <para>The following table lists characters that have to be
                   escaped in LDAP search filters:</para>
                   escaped in LDAP search filters:</para>
 
 
@@ -172,7 +198,8 @@
           percent-encoding (refer to section 2.1 of RFC 4516). In particular 
           percent-encoding (refer to section 2.1 of RFC 4516). In particular 
 	  this means that any "?" character in an LDAP URL component must be
 	  this means that any "?" character in an LDAP URL component must be
 	  written as "%3F", since "?" is used as a URL delimiter.</para>
 	  written as "%3F", since "?" is used as a URL delimiter.</para>
-  <para>The exported function <varname>ldap_filter_url_encode</varname> (<xref linkend="ldap-filter-url-encode-fn"/>) 
+  	  <para>The exported function <varname>ldap_filter_url_encode</varname>
+	  (<xref linkend="ldap-filter-url-encode-fn"/>) 
 	  implements RFC 4515/4516 LDAP search filter and URL escaping
 	  implements RFC 4515/4516 LDAP search filter and URL escaping
 	  rules.</para>
 	  rules.</para>
         </note>
         </note>
@@ -214,7 +241,7 @@
     <section id="ldap-config">
     <section id="ldap-config">
       <title>LDAP Configuration File</title>
       <title>LDAP Configuration File</title>
 
 
-      <para>The module reads an external confiuration file at module
+      <para>The module reads an external configuration file at module
       initialization time that includes LDAP session definitions.</para>
       initialization time that includes LDAP session definitions.</para>
 
 
       <section>
       <section>
@@ -223,7 +250,7 @@
         <para>The configuration file follows the Windows INI file syntax,
         <para>The configuration file follows the Windows INI file syntax,
         section names are enclosed in square brackets:<programlisting>[Section_Name]</programlisting>Any
         section names are enclosed in square brackets:<programlisting>[Section_Name]</programlisting>Any
         section can contain zero or more configuration key assignments of the
         section can contain zero or more configuration key assignments of the
-        form<programlisting>key = value ; comment</programlisting>Values can
+        form <programlisting>key = value ; comment</programlisting> Values can
         be given enclosed with quotes. If no quotes are present, the value is
         be given enclosed with quotes. If no quotes are present, the value is
         understood as containing all characters between the first and the last
         understood as containing all characters between the first and the last
         non-blank characters. Lines starting with a hash sign and blank lines
         non-blank characters. Lines starting with a hash sign and blank lines
@@ -242,9 +269,8 @@ ldap_bind_password         = "pwd"
 ldap_network_timeout       = 500
 ldap_network_timeout       = 500
 ldap_client_bind_timeout   = 500
 ldap_client_bind_timeout   = 500
 </programlisting>
 </programlisting>
-        The configuration keys are
-        explained in the following section. This LDAP session can be referred
-        to in the routing script by using an LDAP URL like
+        The configuration keys are explained in the following section.
+	This LDAP session can be referred to in the routing script by using an LDAP URL like
         e.g.<programlisting>ldap://example_ldap/cn=admin,dc=example,dc=com</programlisting>
         e.g.<programlisting>ldap://example_ldap/cn=admin,dc=example,dc=com</programlisting>
         </para>
         </para>
       </section>
       </section>
@@ -258,7 +284,12 @@ ldap_client_bind_timeout   = 500
 
 
             <listitem>
             <listitem>
 			  <para>
 			  <para>
-				  LDAP URL including fully qualified domain name or IP address of LDAP server optionally followed by a colon and TCP port to connect: <varname>ldap://&lt;FQDN/IP&gt;[:&lt;port&gt;]</varname>. Failover LDAP servers can be added, each separated by a comma. In the event of connection errors, the module tries to connect to servers in order of appearance. To connect over TLS/SSL, use ldaps://.
+				LDAP URL including fully qualified domain name or IP address
+				of LDAP server optionally followed by a colon and TCP port to
+				connect: <varname>ldap://&lt;FQDN/IP&gt;[:&lt;port&gt;]</varname>.
+				Failover LDAP servers can be added, each separated by a comma.
+				In the event of connection errors, the module tries to connect
+				to servers in order of appearance. To connect over TLS/SSL, use ldaps://.
 			  </para>
 			  </para>
 
 
               <para>Default value: none, this is a mandatory setting</para>
               <para>Default value: none, this is a mandatory setting</para>
@@ -414,13 +445,13 @@ ldap_client_bind_timeout = 500
         <para>Full path to LDAP configuration file.</para>
         <para>Full path to LDAP configuration file.</para>
 
 
         <para>Default value:
         <para>Default value:
-        <varname>/usr/local/etc/kamailio/ldap.cfg</varname></para>
+        <varname>/usr/local/etc/&kamailiobinary;/ldap.cfg</varname></para>
 
 
         <example>
         <example>
           <title><varname>config_file</varname> parameter usage</title>
           <title><varname>config_file</varname> parameter usage</title>
 
 
           <programlisting format="linespecific">
           <programlisting format="linespecific">
-modparam("ldap", "config_file", "/etc/kamailio/ldap.ini")
+modparam("ldap", "config_file", "/usr/local/etc/&kamailiobinary;/ldap.ini")
 		  </programlisting>
 		  </programlisting>
         </example>
         </example>
       </section>
       </section>
@@ -433,7 +464,7 @@ modparam("ldap", "config_file", "/etc/kamailio/ldap.ini")
         <title>ldap_search(ldap_url)</title>
         <title>ldap_search(ldap_url)</title>
 
 
         <para>Performs an LDAP search operation using given LDAP URL and stores result
         <para>Performs an LDAP search operation using given LDAP URL and stores result
-        internally for later retrieval by <varname>ldap_result*</varname> functions. If one ore
+        internally for later retrieval by <varname>ldap_result*</varname> functions. If one or
         more LDAP entries are found the function returns the number of found
         more LDAP entries are found the function returns the number of found
         entries which evaluates to TRUE in the &kamailio; configuration script.
         entries which evaluates to TRUE in the &kamailio; configuration script.
         It returns <varname>-1</varname> (<varname>FALSE</varname>) in case no
         It returns <varname>-1</varname> (<varname>FALSE</varname>) in case no
@@ -577,9 +608,16 @@ ldap_result("telephoneNumber/$avp(s:tel_number)");
         <varname>regex_subst</varname> parameter allows to further define what
         <varname>regex_subst</varname> parameter allows to further define what
         part of an attribute value should be stored as AVP.</para>
         part of an attribute value should be stored as AVP.</para>
 
 
-		<para>
-			An AVP can either be of type string or integer. As default, <varname>ldap_result</varname> stores LDAP attribute values as AVP of type string. The optional <varname>avp_type</varname> parameter can be used to explicitly specify the type of the AVP. It can be either <varname>str</varname> for string, or <varname>int</varname> for integer. If <varname>avp_type</varname> is specified as <varname>int</varname> then <varname>ldap_result</varname> tries to convert the LDAP attribute values to integer. In this case, the values are only stored as AVP if the conversion to integer is succesfull. 
-		</para>
+	<para>
+	An AVP can either be of type string or integer. As default, 
+	<varname>ldap_result</varname> stores LDAP attribute values as AVP of type string.
+	The optional <varname>avp_type</varname> parameter can be used to explicitly specify
+	the type of the AVP. It can be either <varname>str</varname> for string, or
+	<varname>int</varname> for integer. If <varname>avp_type</varname> is specified as
+	<varname>int</varname> then <varname>ldap_result</varname> tries to convert the LDAP
+	attribute values to integer. In this case, the values are only stored as AVP if the
+	conversion to integer is succesfull. 
+	</para>
 		
 		
         <variablelist>
         <variablelist>
           <title>Function Parameters:</title>
           <title>Function Parameters:</title>
@@ -604,13 +642,15 @@ ldap_result("telephoneNumber/$avp(s:tel_number)");
             </listitem>
             </listitem>
           </varlistentry>
           </varlistentry>
 		  
 		  
-		  <varlistentry>
+	  <varlistentry>
             <term>avp_type</term>
             <term>avp_type</term>
 
 
             <listitem>
             <listitem>
               <para>
               <para>
-				Opional specification of destination AVP type, either <varname>str</varname> or <varname>int</varname>. If this parameter is not specified then the LDAP attribute values are stored as AVP of type string.
-			  </para>
+		Opional specification of destination AVP type, either <varname>str</varname>
+		or <varname>int</varname>. If this parameter is not specified then the LDAP
+		attribute values are stored as AVP of type string.
+	      </para>
             </listitem>
             </listitem>
           </varlistentry>
           </varlistentry>
 
 
@@ -634,8 +674,10 @@ ldap_result("telephoneNumber/$avp(s:tel_number)");
 
 
             <listitem>
             <listitem>
               <para>
               <para>
-				LDAP attribute <varname>ldap_attr_name</varname> found in LDAP result set and <varname>n</varname> LDAP attribute values stored in <varname>avp_spec</varname>
-			  </para>
+		LDAP attribute <varname>ldap_attr_name</varname> found in LDAP result
+		set and <varname>n</varname> LDAP attribute values stored in
+		<varname>avp_spec</varname>
+	      </para>
             </listitem>
             </listitem>
           </varlistentry>
           </varlistentry>
 
 
@@ -691,7 +733,7 @@ if (!ldap_result("SIPIdentityServiceLevel/$avp(s:service_level)"))
 # save SIP URI domain in $avp(i:10)
 # save SIP URI domain in $avp(i:10)
 ldap_result("SIPIdentitySIPURI/$avp(i:10)", "/^[^@]+@(.+)$/\1/");
 ldap_result("SIPIdentitySIPURI/$avp(i:10)", "/^[^@]+@(.+)$/\1/");
 ...
 ...
-			</programlisting>
+		</programlisting>
         </example>
         </example>
       </section>
       </section>
 
 
@@ -700,8 +742,8 @@ ldap_result("SIPIdentitySIPURI/$avp(i:10)", "/^[^@]+@(.+)$/\1/");
         regex_subst])</title>
         regex_subst])</title>
 
 
         <para>This function compares <varname>ldap_attr_name</varname>'s value
         <para>This function compares <varname>ldap_attr_name</varname>'s value
-        with <varname>string_to_match</varname> for equality. It accesses the LDAP result set
-        fetched by the last <varname>ldap_search</varname> call. The
+        with <varname>string_to_match</varname> for equality. It accesses the
+	LDAP result set fetched by the last <varname>ldap_search</varname> call. The
         optional <varname>regex_subst</varname> parameter allows to further
         optional <varname>regex_subst</varname> parameter allows to further
         define what part of the attribute value should be used for the
         define what part of the attribute value should be used for the
         equality match. If <varname>ldap_attr_name</varname> is multi valued,
         equality match. If <varname>ldap_attr_name</varname> is multi valued,
@@ -1013,7 +1055,7 @@ if (ldap_search(
      "ldap://h350/ou=commObjects,dc=example,dc=com??sub?($avp(s:name_esc))")) 
      "ldap://h350/ou=commObjects,dc=example,dc=com??sub?($avp(s:name_esc))")) 
     { ... }
     { ... }
 ...
 ...
-			</programlisting>
+	</programlisting>
         </example>
         </example>
       </section>
       </section>
     </section>
     </section>
@@ -1025,11 +1067,15 @@ if (ldap_search(
         <title>Compiling the Module</title>
         <title>Compiling the Module</title>
 
 
         <para>
         <para>
-			OpenLDAP library (libldap) and header files (libldap-dev) v2.1 or greater (this module was tested with v2.1.3 and v2.3.32) are required for compiling the LDAP module. The OpenLDAP source is available at <ulink url="http://www.openldap.org/">http://www.openldap.org/</ulink>.
-		</para>
-		<para>
-			The OpenLDAP library is available pre-compiled for most UNIX/Linux flavors. On Debian/Ubuntu, the following packages must be installed: <programlisting># apt-get install libldap2 libldap2-dev</programlisting>.
-		</para>
+	OpenLDAP library (libldap) and header files (libldap-dev) v2.1 or greater (this module was
+	tested with v2.1.3 and v2.3.32) are required for compiling the LDAP module. The OpenLDAP
+	source is available at <ulink url="http://www.openldap.org/">http://www.openldap.org/</ulink>.
+	Note that TLS support needs to be added a compile time for the libraries.
+	</para>
+	<para>
+	The OpenLDAP library is available pre-compiled for most UNIX/Linux flavors. On Debian/Ubuntu,
+	the following packages must be installed: <programlisting># apt-get install libldap2 libldap2-dev</programlisting>.
+	</para>
       </section>
       </section>
     </section>
     </section>
   </chapter>
   </chapter>

+ 46 - 18
modules_k/ldap/doc/ldap_devel.xml

@@ -14,10 +14,17 @@
 	<section>
 	<section>
 		<title>Overview</title>
 		<title>Overview</title>
 		<para>
 		<para>
-			The LDAP module API can be used by other &kamailio; modules to implement LDAP search functionality. This frees the module implementer from having to care about LDAP connection management and configuration. 
+		The LDAP module API can be used by other &kamailio; modules to implement
+		LDAP search functionality. This frees the module implementer from having
+		to care about LDAP connection management and configuration. 
 		</para>
 		</para>
 		<para>
 		<para>
-			In order to use this API, a module has to load the API using the <varname>load_ldap_api</varname> function which returns a pointer to a <varname>ldap_api</varname> structure. This structure includes pointers to the API functions described below. The LDAP module source file <varname>api.h</varname> includes all declarations needed to load the API, it has to be included in the file that loads the API. Loading the API is typically done inside a module's <varname>mod_init</varname> call as the following example shows:			
+		In order to use this API, a module has to load the API using the <varname>load_ldap_api</varname>
+		function which returns a pointer to a <varname>ldap_api</varname> structure. This structure
+		includes pointers to the API functions described below. The LDAP module source file
+		<varname>api.h</varname> includes all declarations needed to load the API, it has to
+		be included in the file that use the API. Loading the API is typically done inside a
+		module's <varname>mod_init</varname> call as the following example shows:			
 			<example>
 			<example>
 				<title>Example code fragment to load LDAP module API</title>
 				<title>Example code fragment to load LDAP module API</title>
 				<programlisting><![CDATA[
 				<programlisting><![CDATA[
@@ -91,7 +98,8 @@ typedef int (*ldap_params_search_t)(int* _ld_result_count,
 					<term>int* _ld_result_count</term>
 					<term>int* _ld_result_count</term>
 					<listitem>
 					<listitem>
 						<para>
 						<para>
-							The function stores the number of returned LDAP entries in <varname>_ld_result_count</varname>. 
+						The function stores the number of returned LDAP entries
+						in <varname>_ld_result_count</varname>. 
 						</para>
 						</para>
 					</listitem>
 					</listitem>
 				</varlistentry>
 				</varlistentry>
@@ -99,7 +107,8 @@ typedef int (*ldap_params_search_t)(int* _ld_result_count,
 					<term>char* _lds_name</term>
 					<term>char* _lds_name</term>
 					<listitem>
 					<listitem>
 						<para>
 						<para>
-							LDAP session name as configured in the LDAP module configuration file.
+						LDAP session name as configured in the LDAP
+						module configuration file.
 						</para>
 						</para>
 					</listitem>
 					</listitem>
 				</varlistentry>
 				</varlistentry>
@@ -115,7 +124,9 @@ typedef int (*ldap_params_search_t)(int* _ld_result_count,
 					<term>int _scope</term>
 					<term>int _scope</term>
 					<listitem>
 					<listitem>
 						<para>
 						<para>
-							LDAP search scope, one of <varname>LDAP_SCOPE_ONELEVEL</varname>, <varname>LDAP_SCOPE_BASE</varname>, or <varname>LDAP_SCOPE_SUBTREE</varname>, as defined in OpenLDAP's <varname>ldap.h</varname>.
+						LDAP search scope, one of <varname>LDAP_SCOPE_ONELEVEL</varname>,
+						<varname>LDAP_SCOPE_BASE</varname>, or <varname>LDAP_SCOPE_SUBTREE</varname>,
+						as defined in OpenLDAP's <varname>ldap.h</varname>.
 						</para>
 						</para>
 					</listitem>
 					</listitem>
 				</varlistentry>
 				</varlistentry>
@@ -123,7 +134,8 @@ typedef int (*ldap_params_search_t)(int* _ld_result_count,
 					<term>char** _attrs</term>
 					<term>char** _attrs</term>
 					<listitem>
 					<listitem>
 						<para>
 						<para>
-							A null-terminated  array  of attribute types to return from entries. If empty (<varname>NULL</varname>), all attribute types are returned.
+						A null-terminated  array  of attribute types to return from entries.
+						If empty (<varname>NULL</varname>), all attribute types are returned.
 						</para>
 						</para>
 					</listitem>
 					</listitem>
 				</varlistentry>
 				</varlistentry>
@@ -131,7 +143,9 @@ typedef int (*ldap_params_search_t)(int* _ld_result_count,
 					<term>char* _filter</term>
 					<term>char* _filter</term>
 					<listitem>
 					<listitem>
 						<para>
 						<para>
-							LDAP search filter string according to RFC 4515. <varname>printf</varname> patterns in this string do get replaced with the function arguments' values following the <varname>_filter</varname> argument.
+						LDAP search filter string according to RFC 4515. 
+						<varname>printf</varname> patterns in this string do get replaced with
+						the function arguments' values following the <varname>_filter</varname> argument.
 						</para>
 						</para>
 					</listitem>
 					</listitem>
 				</varlistentry>
 				</varlistentry>
@@ -151,7 +165,7 @@ typedef int (*ldap_params_search_t)(int* _ld_result_count,
 					<term>0</term>
 					<term>0</term>
 					<listitem>
 					<listitem>
 						<para>
 						<para>
-							Success, <varname>_ld_result_count</varname> includes the number of LDAP entries found.
+						Success, <varname>_ld_result_count</varname> includes the number of LDAP entries found.
 						</para>
 						</para>
 					</listitem>
 					</listitem>
 				</varlistentry>
 				</varlistentry>
@@ -211,10 +225,14 @@ typedef int (*ldap_url_search_t)(char* _ldap_url,
 		<section>
 		<section>
 			<title>ldap_result_attr_vals</title>
 			<title>ldap_result_attr_vals</title>
 			<para>
 			<para>
-				Retrieve the value(s) of a returned LDAP attribute. The function accesses the LDAP result returned by the last call of <varname>ldap_params_search</varname> or <varname>ldap_url_search</varname>. The <varname>berval</varname> structure is defined in OpenLDAP's <varname>ldap.h</varname>, which has to be included.
+				Retrieve the value(s) of a returned LDAP attribute. The function accesses
+				the LDAP result returned by the last call of <varname>ldap_params_search</varname>
+				or <varname>ldap_url_search</varname>. The <varname>berval</varname> structure is
+				defined in OpenLDAP's <varname>ldap.h</varname>, which has to be included.
 			</para>
 			</para>
 			<para>
 			<para>
-				This function allocates memory to store the LDAP attribute value(s). This memory has to freed with the function <varname>ldap_value_free_len</varname> (see next section).
+				This function allocates memory to store the LDAP attribute value(s). This memory
+				has to freed with the function <varname>ldap_value_free_len</varname> (see next section).
 			</para>
 			</para>
 			<programlisting><![CDATA[
 			<programlisting><![CDATA[
 typedef int (*ldap_result_attr_vals_t)(str* _attr_name,
 typedef int (*ldap_result_attr_vals_t)(str* _attr_name,
@@ -277,7 +295,9 @@ typedef struct berval {
 		<section>
 		<section>
 			<title>ldap_value_free_len</title>
 			<title>ldap_value_free_len</title>
 			<para>
 			<para>
-				Function used to free memory allocated by <varname>ldap_result_attr_vals</varname>. The <varname>berval</varname> structure is defined in OpenLDAP's <varname>ldap.h</varname>, which has to be included.
+				Function used to free memory allocated by <varname>ldap_result_attr_vals</varname>.
+				The <varname>berval</varname> structure is defined in OpenLDAP's 
+				<varname>ldap.h</varname>, which has to be included.
 			</para>
 			</para>
 			<programlisting><![CDATA[
 			<programlisting><![CDATA[
 typedef void (*ldap_value_free_len_t)(struct berval **_vals);
 typedef void (*ldap_value_free_len_t)(struct berval **_vals);
@@ -294,7 +314,7 @@ typedef struct berval {
 					<term>struct berval **_vals</term>
 					<term>struct berval **_vals</term>
 					<listitem>
 					<listitem>
 						<para>
 						<para>
-							<varname>berval</varname> array returned by <varname>ldap_result_attr_vals</varname>.
+						<varname>berval</varname> array returned by <varname>ldap_result_attr_vals</varname>.
 						</para>
 						</para>
 					</listitem>
 					</listitem>
 				</varlistentry>
 				</varlistentry>
@@ -316,7 +336,8 @@ typedef int (*ldap_result_next_t)();
 					<term>-1</term>
 					<term>-1</term>
 					<listitem>
 					<listitem>
 						<para>
 						<para>
-							No LDAP result found, probably because <varname>ldap_params_search</varname> or <varname>ldap_url_search</varname> was not called.
+						No LDAP result found, probably because <varname>ldap_params_search</varname>
+						or <varname>ldap_url_search</varname> was not called.
 						</para>
 						</para>
 					</listitem>
 					</listitem>
 				</varlistentry>
 				</varlistentry>
@@ -440,7 +461,10 @@ typedef int (*ldap_rfc4515_escape_t)(str *sin, str *sout, int url_encode);
 		<section>
 		<section>
 			<title>get_ldap_handle</title>
 			<title>get_ldap_handle</title>
 			<para>
 			<para>
-				Returns the OpenLDAP LDAP handle for a specific LDAP session. This allows a module implementor to use the OpenLDAP API functions directly, instead of using the API functions exported by the &kamailio; LDAP module. The <varname>LDAP</varname> structure is defined in OpenLDAP's <varname>ldap.h</varname>, which has to be included.
+				Returns the OpenLDAP LDAP handle for a specific LDAP session. This allows a module
+				implementor to use the OpenLDAP API functions directly, instead of using the API
+				functions exported by the &kamailio; LDAP module. The <varname>LDAP</varname> structure
+				is defined in OpenLDAP's <varname>ldap.h</varname>, which has to be included.
 			</para>
 			</para>
 			<programlisting><![CDATA[
 			<programlisting><![CDATA[
 typedef int (*get_ldap_handle_t)(char* _lds_name, LDAP** _ldap_handle);
 typedef int (*get_ldap_handle_t)(char* _lds_name, LDAP** _ldap_handle);
@@ -452,7 +476,7 @@ typedef int (*get_ldap_handle_t)(char* _lds_name, LDAP** _ldap_handle);
 					<term>char* _lds_name</term>
 					<term>char* _lds_name</term>
 					<listitem>
 					<listitem>
 						<para>
 						<para>
-							LDAP session name as specified in the LDAP module configuration file.
+						LDAP session name as specified in the LDAP module configuration file.
 						</para>
 						</para>
 					</listitem>
 					</listitem>
 				</varlistentry>
 				</varlistentry>
@@ -460,7 +484,7 @@ typedef int (*get_ldap_handle_t)(char* _lds_name, LDAP** _ldap_handle);
 					<term>LDAP** _ldap_handle</term>
 					<term>LDAP** _ldap_handle</term>
 					<listitem>
 					<listitem>
 						<para>
 						<para>
-							OpenLDAP LDAP handle returned by this function.
+						OpenLDAP LDAP handle returned by this function.
 						</para>
 						</para>
 					</listitem>
 					</listitem>
 				</varlistentry>
 				</varlistentry>
@@ -489,7 +513,10 @@ typedef int (*get_ldap_handle_t)(char* _lds_name, LDAP** _ldap_handle);
 		<section>
 		<section>
 			<title>get_last_ldap_result</title>
 			<title>get_last_ldap_result</title>
 			<para>
 			<para>
-				Returns the OpenLDAP LDAP handle and OpenLDAP result handle of the last LDAP search operation. These handles can be used as input for OpenLDAP LDAP result API functions. <varname>LDAP</varname> and <varname>LDAPMessage</varname> structures are defined in OpenLDAP's <varname>ldap.h</varname>, which has to be included.
+				Returns the OpenLDAP LDAP handle and OpenLDAP result handle of the last LDAP search 
+				operation. These handles can be used as input for OpenLDAP LDAP result API functions.
+				<varname>LDAP</varname> and <varname>LDAPMessage</varname> structures are defined in 
+				OpenLDAP's <varname>ldap.h</varname>, which has to be included.
 			</para> 
 			</para> 
 			<programlisting><![CDATA[
 			<programlisting><![CDATA[
 typedef void (*get_last_ldap_result_t)
 typedef void (*get_last_ldap_result_t)
@@ -520,7 +547,8 @@ typedef void (*get_last_ldap_result_t)
 	<section>
 	<section>
 		<title>Example Usage</title>
 		<title>Example Usage</title>
 		<para>
 		<para>
-			The following example shows how this API can be used to perform an LDAP search operation. It is assumed that the API is loaded and available through the <varname>ldap_api</varname> pointer.
+			The following example shows how this API can be used to perform an LDAP search operation.
+			It is assumed that the API is loaded and available through the <varname>ldap_api</varname> pointer.
 		</para>
 		</para>
 		<programlisting><![CDATA[
 		<programlisting><![CDATA[
 ...
 ...

+ 1 - 1
modules_k/ldap/etc/ldap.cfg

@@ -1,5 +1,5 @@
 # 
 # 
-# Kamailio LDAP module example configuration
+# SIP-router LDAP module example configuration
 #
 #
 
 
 # LDAP session "sipaccounts":
 # LDAP session "sipaccounts":