Example #1
0
 /**
  * @inheritdoc
  */
 public function call($number_to_call, $caller)
 {
     try {
         $this->getInformations($caller);
         $this->soap->telephonyClick2CallDo($this->nic_handle, $this->password, $this->calling_external, $number_to_call, $this->calling_internal);
     } catch (\InvalidArgumentException $e) {
         $this->error = $e->getMessage();
         return false;
     } catch (\SoapFault $e) {
         $this->error = $e->getMessage();
         return false;
     }
     return true;
 }
Example #2
0
    header("Location: /login.php");
    exit;
}
$User->getInfos();
if (isset($_GET['ctc'])) {
    if (empty($User->prefs->ctc_ovh_login)) {
        exit;
    }
    $num = removeSpace($_GET['num']);
    $id_client = $_GET['id'];
    echo "Calling {$num} ...";
    logmessage(_("Call contact: ") . " {$num}", $id_client);
    try {
        ini_set('default_socket_timeout', 60);
        $soap = new SoapClient('https://www.ovh.com/soapi/soapi-re-1.3.wsdl');
        $soap->telephonyClick2CallDo($User->prefs->ctc_ovh_login, $User->prefs->ctc_ovh_pass, $User->prefs->ctc_ovh_num, $num, $User->prefs->ctc_ovh_num);
    } catch (SoapFault $fault) {
        echo $fault;
    }
    exit;
}
// Create new client
if (isset($_GET['action']) && $_GET['action'] == '_new') {
    $client_name = 'Nouvelle Entreprise_' . time();
    mysql_query("INSERT INTO webfinance_clients (nom,date_created) VALUES('{$client_name}', now())") or die(mysql_error());
    $_GET['id'] = mysql_insert_id();
    // Create Mantis project
    $mantis_project = array('name' => $client_name, 'view_state' => array('id' => 50));
    $mantis = new WebfinanceMantis();
    $mantis->createProject($_GET['id'], $mantis_project);
    // Create Toggl client