예제 #1
0
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
require_once "service/SimplePdoLeadConnectService.php";
require_once "entity/Inquiry.php";
require_once "entity/Event.php";
require_once "functions.php";
$sid = $_GET['sid'];
$live = $_GET['live'];
$phone = $_GET['phone'];
$name = $_GET['name'];
$inquiry_key = $_GET['inquiry-key'];
$vendor_id = $_GET['vendor-id'];
$params = "phone={$phone}&amp;vendor-id={$vendor_id}&amp;inquiry-key={$inquiry_key}&amp;sid={$sid}&amp;live={$live}";
$service = new SimplePdoLeadConnectService();
$vendor = $service->loadVendor($vendor_id);
$account = $service->loadAccount($vendor->account_id);
$inquiry = $service->loadInquiry($inquiry_key);
$events = $service->loadEvents($inquiry->id);
?>

<Response>
    <?php 
if (count($events) > 0) {
    $vendor_events = groupEventsByVendor($events);
    $call_in_process = detectCallInProcess($vendor_events);
    if ($call_in_process == 1) {
        if ($live == "true") {
            ?>
                <Say>Hello. Someone just called from <?php 
            echo $account->name;
            ?>
, but another vendor has already connected to the caller.</Say>
예제 #2
0
<?php

header("content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
require_once "service/SimplePdoLeadConnectService.php";
require_once "entity/Event.php";
require_once "functions.php";
$service = new SimplePdoLeadConnectService();
$inquiry = $service->loadInquiry($_GET['inquiry-key']);
saveEvent($_POST['DialCallStatus'], $_GET['vendor-id'], $inquiry->id);
$events = $service->loadEvents($inquiry->id);
$vendor_events = groupEventsByVendor($events);
initiateCallbacks($vendor_events);
?>
<Response>
    <Hangup />
</Response>