Sail and LDAP

From SME Server
Jump to navigationJump to search

SAIL and local LDAP address book lookup


  • This is a small howto for enabling LDAP lookup of incoming CID for your external calls.
  • Yes, it will show NAMES on your IP phones if it matches name/number from your LDAP.
  • These mods are NOT supported by Sail at the moment.
  • This article may contain big inaccuracies, you're more than welcome to improve and correct it
  • I can't be held responsible for any malfunction/damage to your system after these modifications.
  • Note: you need gcc,asterisk-devel and phpldap-devel in order to compile app_ldap-2
yum install gcc asterisk-devel phpldap-devel


  • Download and install phpldapadmin following instructions found here: phpldapadmin
  • Download and install app_ldap-2.0rc1
mkdir -p /usr/src/app_ldap2
cd /usr/src/app_ldap2
tar zvxf app_ldap-2.0rc1.tgz 
make install
  • Note: you need gcc in order to compile app_ldap-2

Then open your browser and login to sme phpldapadmin page with admin credentials

For example:


Now expand the base DN which should be DC=mydomain,DC=myTLD and select "Create a new entry here"

Then, choose "Address Book Entry (inetOrgPerson)" and fill in the details for adding your first contact. I usually fill in Name, Surname and Work phone fields.

Edit ldap.conf into /etc/asterisk/

I edited this file in place as no template fragments seems to exist at this time. Add these lines:

host = localhost
version = 3
base = dc=mydomain,dc=mytld
convert = UTF-8, ISO-8859-1

edit mydomain and mytld to match your settings (for example: dc=contribs,dc=org)

Create a custom app into Sail

Create a new app in SAIL PBX -> Custom apps

Unique context name: your_app_name
Description: your_description
Clutser: default

Code of the app:

exten=>7000,3,agi(selintra,Alias,SIP/5001 SIP/5002 SIP/5003,${EXTEN})

Where 7000 is an alias for ringing 5001, 5002 and 5003.

Please use values matching your current setup.

  • Now edit inbound routes in your trunklines, select the custom app you created, et voilà!

Additional informations

Thanks to Selintra Team that made this possible with realtime answers on forum. Related topic is

App_ldap can be get here:

Tested software versions

  • SMEserver v7.1.3
  • selintra-sail-2.1.15-483
  • smeserver-asterisk-1.4.1-8
  • smeserver-asterisk-zappri-MPP-1.4.0-5

  • New Test
  • Asterisk 1.4.17
  • Sail 2.2.1