Home > asterisk, linux, open source, voip > asterisk 1.2 with realtime ldap driver

asterisk 1.2 with realtime ldap driver

I have created an auto install script based on http://www.cahilig.org/install-asterisk-12-auto-install-script-centos-4-and-centos-5 to install Asterisk 1.2 with ldap realtime driver support (modified original script to enable realtime ldap support).

This script should work almost with any(Redhat, Centos, Mandrake, Debian, Slackware) Linux distro

Before running this script you must install following packages.

For Centos, Redhat:

yum install openldap-devel gcc kernel-devel bison openssl-devel libtermcap-devel ncurses-devel

For Debian, Ubuntu:

apt-get install libldap2-dev build-essential linux-headers-`uname -r` libncurses5-dev libssl-dev

You can download the script from here, simply run the script to start installation process.

download Asterisk schema for OpenLdap here

Installer and installation process is not tested, if you find any problem please let me know.

#Asterisk Download page
#Asterisk Package
#Asterisk Folder
if [ -f /etc/redhat-release ] ; then
elif [ -f /etc/debian_version ] ; then
elif [ -f /etc/SUSE-release ] ; then
elif [ -f /etc/mandrake-release ] ; then
elif [ -f /etc/slackware-release ] ; then
elif [ -f /etc/gentoo-release ] ; then

echo "Downloading and extracting zaptel and asterisk source"
cd /usr/local/src/
if [ ! -e $ZAPPACKAGE ]; then
  wget $ZAPTEL
if [ ! -e $ASTPACKAGE ]; then
  wget $ASTERISK
if [ ! -e $ASTADDONSPACKAGE ]; then
tar -zvxf $ZAPPACKAGE
tar -zvxf $ASTPACKAGE

echo "Installing zaptel"
make clean
make install
cd ..

echo "Installing asterisk"
echo "Downloading patches"
patch -p0<resmkfile.patch
patch -p0<config.c.patch
echo "Downloading Realtime Ldap driver"
cd res
wget $RTLDAP
patch -p0<res_config_ldap.c.patch
cd ../configs
wget http://mustafa.pk.googlepages.com/extconfig.conf.sample
wget http://mustafa.pk.googlepages.com/res_ldap.conf.sample
cd ..
make clean
make install
make samples
cp contrib/init.d/rc.$DISTRO.asterisk /etc/init.d/asterisk
cd ..

echo "Installing asterisk-addons"
make clean
make install

echo "Loading ztdummy driver"
modprobe zaptel
modprobe ztdummy

echo "adding rules to /etc/rc.local"

echo "modprobe zaptel
modprobe ztdummy
" >> /etc/rc.local

echo "Downloading open source g729 codec"
cd /usr/lib/asterisk/modules/
wget http://asterisk.hosting.lv/bin12/codec_g729-ast12-gcc4-glibc-pentium4.so

echo "Running Asterisk"
/etc/init.d/asterisk start

echo "***********************************************************************"
echo "*             INSTALLATION SUCCESSFUL                                 *"
echo "***********************************************************************"
echo "* You can test if Asterisk installed successfully using               *"
echo "* asterisk -ncrvvv and start configuring your dial plan               *"
echo "***********************************************************************"

  1. Syed Bilal Masaud
    December 31, 2008 at 2:52 pm

    Thanks for this effort , it really minimize my work for asterisk installation

    Thanks again


  2. January 6, 2009 at 12:47 am

    i had succesfully installed asterisk and openldap with real time ldap driver using this tutorial.

    now, i want insert some user to the openldap database based on a howto from redhatmagazine.this tutorial is based on fedora directory project, but i think i can using it.

    and i got this following error:

    [root@dgkvoip ~]# ldapadd -x -D "cn=manager,dc=dgkvoip,dc=net" -W -f /root/user.ldif
    Enter LDAP Password:
    adding new entry "cn=user1,ou=sippeers,dc=dgkvoip,dc=net"
    ldap_add: Internal (implementation specific) error (80)
    additional info: no structuralObjectClass operational attribute

    this is my slapd.conf and user.ldif

    is there any clue for me?

  3. January 6, 2009 at 1:09 am

    sorry, i forgot to mention.

    i put asterisk.schema to the /etc/openldap/schema.

  4. cyrenity
    January 10, 2009 at 5:56 am

    dudi: you are missing a structural objectClass in your ldif file, try something like this:

    dn: cn=user1,ou=sippeers,dc=dgkvoip,dc=net
    objectClass: AsteriskSIPUser
    objectClass: inetOrgPerson
    objectClass: top
    cn: user1
    AstAccountCallerID: 2001
    AstAccountHost: dynamic
    AstAccountRealmedPassword: {MD5}d0fb963ff976f9c37fc81fe03c21ea7b
    AstAccountContext: default
    AstAccountType: friend

  5. January 13, 2009 at 4:23 am

    #5: cyrenity: thanks a lot. it works for me :).

    the next scenario is trying to integrating between zimbra account and asterisk.

  6. Mario
    December 28, 2009 at 4:13 pm


    I would like to know what else should I do to configure LDAP as database of Asterisk?, I mean, I ran the script you wrote here and I hadn’t errors, it run perfect,then I copied the schema and I included in slapd.conf, but I don’t know what else must I do. Could you help me please?

    Thanks in forward

  7. Huong Trinh
    June 13, 2010 at 8:46 am

    I got an error…..Realtime mapping for ‘sippees’ found to engine ‘ldap’, but the engine is not availuable
    plz help me…. my deadline is coming…….

  8. May 7, 2013 at 5:49 pm

    Everything is very open with a really clear description of the issues.
    It was definitely informative. Your site is useful.
    Many thanks for sharing!

  9. January 26, 2014 at 6:22 am

    Hey I know this is off topic but I was wondering if
    you knew of any widgets I could add to my blog that automatically tweet my newest twitter updates.
    I’ve been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like this.
    Please let me know if you run into anything.
    I truly enjoy reading your blog and I look forward
    to your new updates.

  10. July 2, 2014 at 3:27 am

    That’s the filler work with or are metal roof already familiar with what to expect.
    Low slope roofs are not the case, you can drive by the National Roofing Contractors Association for
    a roof style. Videos show police backing up and after the
    seals have been avoided.

  11. July 2, 2014 at 12:10 pm

    If potential take a look at the car locksmith final bill.
    This service is re-keying of locks. I am some sort of
    folks might pick out, needing car locksmith a lock. Any item that is definitely
    a plus. They needs to be determined by! In addition to their satisfaction from the crowd.
    These online directories which also carry all sorts of locks
    you have to return for more information on this article I attempt to show basic
    correct bike locking technique.

  1. December 28, 2008 at 5:23 pm
  2. February 2, 2009 at 7:42 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: