Sail and LDAP

From SME Server
Jump to navigationJump to search

SAIL and local LDAP address book lookup

Description

  • 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 and the asterisk-devel in order to compile app_ldap-2
yum install gcc asterisk-devel

Installation

  • 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
wget http://www.mezzo.net/asterisk/app_ldap-2.0rc1.tgz  
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:

https://myserver/phpldapadmin

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:

[cidname]
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
Span: EXTERNAL
Clutser: default

Code of the app:

exten=>s,1,LDAPget(MYCALLERID=cidname/${CALLERIDNUM})
exten=>s,2,GoTo(7000,1)
exten->s,102,GoTo(7000,1)
exten=>7000,1,NoOp(${MYCALLERID})
exten=>7000,2,Set(CALLERID(name)=${MYCALLERID})
exten=>7000,3,agi(selintra,Alias,SIP/5001 SIP/5002 SIP/5003,${EXTEN})
exten=>7000,4,Hangup

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 http://forums.contribs.org/index.php?topic=36533.0

App_ldap can be get here: http://www.mezzo.net/asterisk/app_ldap.html

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