Пример #1
0
<!-- transfer_action.php -->

<?php 
require 'vendor/autoload.php';
use Plivo\RestAPI;
$digit = $_REQUEST['Digits'];
$call_uuid = $_REQUEST['CallUUID'];
$auth_id = "Your AUTH_ID";
$auth_token = "Your AUTH_TOKEN";
error_log($digit);
error_log($call_uuid);
$p = new RestAPI($auth_id, $auth_token);
if ($digit == "1") {
    $params = array('call_uuid' => $call_uuid, 'aleg_url' => 'https://example.com/connect', 'aleg_method' => 'GET');
    $resp = $p->transfer_call($params);
    print_r($resp);
} else {
    print "WrongInput";
}
/*
Sample Output
<Response>
    <GetDigits action="https://example.com/transfer_action.php" method="GET" numDigits="1" redirect="false" retries="1" timeout="7">
        <Speak>Press 1 to transfer this call</Speak>
    </GetDigits>
    <Wait length="10" />
</Response>

Call UUID is : e66aa1a0-9587-11e4-9d37-c15e0b562efe 
Digit pressed is : 1