Ejemplo n.º 1
0
 public function testLeadExists()
 {
     $_POST['ClientPhone'] = "+380991133231";
     $_POST['ClientEmail'] = "*****@*****.**";
     $_POST['ClientName'] = "NEW";
     $Lead = new LeadModel($this->config);
     $this->assertEquals(false, $Lead->LeadExists());
     $_POST['ClientPhone'] = "380-111-111111";
     $_POST['ClientEmail'] = "*****@*****.**";
     $_POST['ClientName'] = "Old";
     $Lead = new LeadModel($this->config);
     $this->assertEquals(true, $Lead->LeadExists());
 }
Ejemplo n.º 2
0
function cretate_conference($LeadID)
{
    global $google;
    global $twilio;
    global $DBconfig;
    $Lead = new LeadModel(array('google' => $google, 'twilio' => $twilio, 'DBconfig' => $DBconfig), $LeadID);
    $Lead->SetNextCallOffset("never", $LeadID);
    header("content-type: text/xml");
    echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
    ?>
    <Response>
        <Dial><?php 
    echo $Lead->UserData['Phone'];
    ?>
</Dial>
            <Say>The call failed or the remote party hung up. Goodbye.</Say>
        </Response>
    <?php 
    exit;
}
Ejemplo n.º 3
0
<?php

include_once '../../core/init.php';
$Lead = new LeadModel(array('google' => $google, 'twilio' => $twilio, 'DBconfig' => $DBconfig));
if ($Lead->Complete()) {
    if (!$Lead->Save()) {
        PageModel::Error($Lead->error);
    } else {
        PageModel::Success($Lead);
    }
} else {
    PageModel::Error("Incomplete");
}
Ejemplo n.º 4
0
<?php

require dirname(__FILE__) . '/../../../core/init.php';
if (!isset($_REQUEST['lead_id'])) {
    create_error_voice();
}
$LeadID = $_REQUEST['lead_id'];
$Lead = new LeadModel(array('google' => $google, 'twilio' => $twilio, 'DBconfig' => $DBconfig), $LeadID);
$Lead->CompleteLead();
function create_error_voice()
{
    header("content-type: text/xml");
    echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
    ?>
    <Response>
        <Say>
            Sorry.
            Something is wrong with service. 
            We will call You as soon as possible.
        </Say>
    </Response>
    <?php 
    exit;
}