Archive

Posts Tagged ‘edirectory’

asterisk realtime with ldap — got it working :)

November 28, 2008 4 comments

When we decided to write an asterisk module for Zivios, we went in several debates either we should keep asterisk’s configurations in plain config files or get benefit of asterisk realtime ldap driver.

if you don’t know much about Zivios’s architecture, check out Zivios Architecture page. In short Zivios keeps all of its configurations(Users/Groups/Config files) in OpenLdap as far as there is a possibility to use Ldap as config back-end.

Finally we decided to test asterisk realtime ldap driver, in first attempt everything worked fine, I was able to retrieve sip/iax peers from ldap tree,store registry updates in ldap, also created few dialplan extensions in ldap and it worked as expected. then all the hell broke loose when i added a pattern (say _5XX) in ldap and asterisk couldn’t find it in ldap, I tried to debug the realtime ldap driver, but nothing helped. lastly I decided to look into the realtime ldap driver’s C code(my C knowledge is worst), put several debug messages all over the file, recompiled and came out with the conclusion that there is something wrong with a function called *realtime_multi_ldap, posted bug report to digium with my logs (Faraz Khan posted a bounty as well, check it out), but all in vain, it felt like digium and nobody else doesn’t give a damn about realtime ldap driver, i decided to forget the realtime thing and keep configuration in plain text file, wrote some handy(helper) perl scripts to add/edit and delete configurations(users/routes/queues/ivrs). Zivios’s web interface communicates with these scripts using a special XML-RPC agent (called emsmagent) running on asterisk box. emsmagent executes these perl scripts and returns output to Zivios.

Last month browsing through digium’s bug tracker I found this *realtime_multi_ldap patch, I decided to give it a try, was not expecting it would work, but interestingly it worked and now I can use patterns in ldap exten entry and it really works :).

I have written a custom ldap schema for realtime ldap, You can also check original schema posted and contributed by suretec (guy who fixed the ldap driver) here. I will soon post a how-to on “setting up asterisk realtime ldap”. I am also going to port Zivios Asterisk module from plain text files to openldap backend soon (much busy in some other interesting projects these days :D)

let me know if you need any help in asterisk and realtime ldap driver setup.

Advertisements