Ejemplo n.º 1
0
?>

<!--speak_action.php-->

<?php 
require 'vendor/autoload.php';
use Plivo\RestAPI;
$r = new Response();
$digit = $_REQUEST['Digits'];
$call_uuid = $_REQUEST['CallUUID'];
$auth_id = "Your AUTH_ID";
$auth_token = "Your AUTH_TOKEN";
$p = new RestAPI($auth_id, $auth_token);
if ($digit == "1") {
    $params = array('call_uuid' => $call_uuid, 'text' => 'Hello from Speak API', 'voice' => 'WOMAN', 'language' => 'en-GB');
    $resp = $p->speak($params);
    print_r($resp);
} else {
    print "WrongInput";
}
/*
Sample Output
<Response>
    <GetDigits action="http://morning-ocean-4669.herokuapp.com/speak_action/" method="GET" numDigits="1" redirect="false" retries="1" timeout="7">
        <Speak>Press 1 to listen to a message</Speak>
    </GetDigits>
    <Wait length="10" />
</Response>

( 
    [status] => 202