Author Topic: Initiate a call from contact card (Asterisk server)  (Read 3654 times)

newtek

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
Initiate a call from contact card (Asterisk server)
« on: October 11, 2010, 02:56:32 pm »
Good morning

I would like to integrate asterisk callback into the contact page.
But I would like to get the username Id in Php.

How to start

Thank you

Best regards,

Sylvain
« Last Edit: October 20, 2010, 01:55:46 pm by newtek »

newtek

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
Re: Asterisk Callback
« Reply #1 on: October 15, 2010, 08:04:43 am »
Finally

I learn a little the code, and I add code at the top of card_content.php

Code: [Select]
//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 :
Code: [Select]
      <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