[Working!] Cisco XML Directory with LDAP lookup to iCloud

I’ve decided to get the directories features on my phones working properly. Ideally what I would like is to have all the contacts on my iPhone fully synced and able to be looked up from my desk phone (Cisco 9971).

I think I will need to use a middleware service like Memotoo to interrogate the iCloud contacts database as I don’t think this is otherwise possible to access iCloud from a non-Apple device. Anyone used them?

There are some php and perl scripts floating out on the net like this PHP-based one or this perl based one, that I think I should be able to suitably modify in order for the phone to connect to the Memotoo LDAP database

Has anyone else done anything like this recently? If so any hints, tips or advice would be most appreciated.

Many thanks

I spent a few hours this evening getting this all working - I followed the example posted up at croesnet.eu blog.

There is a bit of a cheat involved as this particular solution utilises some of the pre-existing XML scripts in a trixbox installation. Luckily I had an old trixbox lying around so simply copied the contents of /var/www/html/xmlservices directory over to the FPBX box. Remember to chmod and chown the files:

cd /var/www/html
chown -R asterisk:asterisk xmlservices
chmod -R 777 xmlservices

Note the new files [strong]ldapSearchDirectory.php[/strong] and [strong]result.php[/strong] should be written to /var/www/html/xmlservices and the [strong]ldapsearchDirectory_ciscoxml4.tpl[/strong] should go in the /var/www/html/xmlservices/templates directory. Remember to edit the LDAP entries in results.php - in the case of using an Memotoo account line 28 should read:

$ds=ldap_connect("ldap.memotoo.com"); 

and line 35 should be:

$myldap="dc=[url=https://www.memotoo.com/index.php?rub=infoAnnuaireLdap]your_specific_dc_code_from_memotoo[/url]"; 

It’s also possible to restrict search within OU/groups by including “ou=xxxxxx” in the $myldap setting above, where xxxxx is the name of the particular group.

Also one needs to install the php-ldap package using yum, then restart the web services

yum install php-ldap

I signed up for a Memotoo account (£12 per year) so that my iPhone/ICloud contacts are always synced to the LDAP directory. Memotoo can handle Gmail and a wide variety of other sources too.