<?
    ini_set
('display_errors''1');

    
$callingParty "";

    if (isset(
$_POST['callingParty'])) {
    
$callingParty $_POST['callingParty'];
    }

    
$calledParty "";

    if (isset(
$_POST['calledParty'])) {
    
$calledParty $_POST['calledParty'];
    }

    
$timeout 0;

    if (!empty(
$callingParty) && !empty($calledParty)) {

    require_once(
dirname(__FILE__) . '/web21c.php');

    
$applicationName "myApplication";
    
$environment "sandbox";

    
$web21c = new Web21c($applicationName$environment);
    
$session $web21c->SessionThirdPartyCall();

    
$r $session->makeCall($callingParty$calledParty$timeout);

    print 
"call: http://web21c.whatfettle.com/calls/".urlencode($r->callId);
    exit(
0);
    }
?>

<html>
  <head>
    <title>Make Phone Call</title>
    <style type="text/css" media="screen">@import url(default.css);</style>
  </head>
  <body>
    <h2>Make Phone Call</h2>
    <form method="POST" action="<? echo $_SERVER['REQUEST_URI']  ?>">
    <label for="callingParty">callingParty:</label> 
    <input type="text" id="callingParty" name="callingParty" value="<? echo htmlentities($callingParty?>"/> 
    <br/>
    <label for="calledParty">calledParty:</label> 
    <input type="text" id="calledParty" name="calledParty" value="<? echo htmlentities($calledParty?>"/> 
    <br/>
    <input id="submit" type="submit" value="makeCall"/>
    </form>
  </body>
</html>