Exemplo n.º 1
0
 /**
  * Function that implements the SOAP call to see the address book of User Logon SOAP service. The address book has an internal part
  * that is a list of available extensions, and an external part that resides in SQLITE database managed by Elastix. If an
  * error exists a SOAP fault is thrown
  *
  * @param mixed    $request:
  *                      addressBookType {internal, external}
  *                      offset (optional): positiveInteger
  *                      limit (optional): positiveInteger
  * @return mixed   Array with the information of the contact list (address book).
  */
 public function listAddressBook($request)
 {
     $return = parent::listAddressBook($request->addressBookType, $request->offset, $request->limit);
     if (!$return) {
         $eMSG = parent::getError();
         $this->objSOAPServer->fault($eMSG['fc'], $eMSG['fm'], $eMSG['cn'], $eMSG['fd'], 'fault');
     }
     return $return;
 }
Exemplo n.º 2
0
 function HTTP_GET()
 {
     $pCore_AddressBook = new core_AddressBook();
     $json = new paloSantoJSON();
     $result = $pCore_AddressBook->listAddressBook($this->_addressBookType, NULL, NULL, $this->_idNumero);
     if (!is_array($result)) {
         $error = $pCore_AddressBook->getError();
         if ($error["fc"] == "DBERROR") {
             header("HTTP/1.1 500 Internal Server Error");
         } else {
             header("HTTP/1.1 400 Bad Request");
         }
         $json->set_status("ERROR");
         $json->set_error($error);
         return $json->createJSON();
     }
     if (count($result['extension']) <= 0) {
         header("HTTP/1.1 404 Not Found");
         $json->set_status("ERROR");
         $json->set_error('No contact was found');
         return $json->createJSON();
     }
     $tupla = $result['extension'][0];
     $tupla['url'] = $this->requestURL();
     $json = new Services_JSON();
     return $json->encode($tupla);
 }