Finally
I learn a little the code, and I add code at the top of card_content.php
//get custom property for the current user
$cps = CustomProperties::getAllCustomPropertiesByObjectType('Users', $co_type);
foreach($cps as $customProp){
//a custom property ext assigned to user and containing phone extension
if ($customProp->getName() == "ext") {
$cpv = CustomPropertyValues::getCustomPropertyValue(1, $customProp->getId());
$myext = $cpv->getValue();
}
}
I have modified the display of the phone number in the card :
<div><span><?php echo lang('wphone') ?>:</span> <?php echo clean($contact->getWPhoneNumber()).'<A href=./asterisk/originate.php?phone='.clean($contact->getWPhoneNumber()).'&ext='.$myext.'> Appeler</A>';?></div><?php } ?>
When the link is clicked the php script originate.php is called and call the contact phone.
I use phpagi to originate the call.
Next step, add a webservice for the contact list, so the asterisk server could query the contact list when call arrived instead of my current ldap directory.
Bye