Module API Docs


I recently discovered this thread ( 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 … onfig_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:


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. Long story short, I need pointers to proper Asterisk module programming. I can’t find anything in the online documentation.