[asterisk-users] Real-time LDAP config

Richi Plana richip at richip.dhs.org
Sun Oct 1 01:39:38 MST 2006


Hi,

I recently discovered this thread
(http://bugs.digium.com/view.php?id=5768) about a real-time LDAP config
module for Asterisk and I downloaded the branch from SVN using the
following svn parameters (as suggested in the aforementioned thread):

$ svn co http://svn.digium.com/svn/asterisk/team/group/res_config_ldap
asterisk_with_ldap

Unfortunately, I'm having troubles compiling res/res_config_ldap.c.
First of all, it seems to want to use deprecated OpenLDAP API calls (I'm
using openldap-2.3.19 installed with Fedora Core 5. I've managed to
patch res_config_ldap.c and transition it to the non-deprecated
equivalent functions. This has proven to be quite frustrating and feels
like a shot-in-the-dark given that I can't find documentation to the new
OpenLDAP API. In the end, I couldn't find the equivalent OpenLDAP
ldap_bind*() functions so I just defined the C macro LDAP_DEPRECATED to
use the old functions.

My problems didn't end there, though. Apparently there's been some
changes in the Asterisk module API (even though this branch had been cut
specifically for the LDAP module. Go figure). I had to remove
"LOCAL_USER_DECL;" from the top of the source code and replace:

STD_MOD(MOD_1, reload, NULL, NULL);

with

AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "LDAP
Configuration",
                .load = load_module,
                .unload = unload_module,
                );

The source now compiles, but there are warnings of unusued functions
(reload(), desription() and key()).

I admit that I've never done any Asterisk module programming and am
basing all that I did from what I could find in other modules
(res_config_odbc.c) and snippets of stuff on the Internet.

If anyone has successfully gotten this LDAP module to work, please give
me a pointer in the right direction. The module I have compiles but am
afraid to even use it since I'm not sure what I have right now.
--

Richi Plana



More information about the asterisk-users mailing list