title: Need twilio response while call is in-progress
body: <p>I am giving a call facilty in my app using TWILIO. I am using javascript and php to accomplish this. I am using the followinmg code and my call is working properly But I want to show call duration on the page while call is in progress. I am unable to get the record/details of the call. can you please help me . Thanks in advance :</p>
  
  <pre><code> &lt;?php
   include 'Services/Twilio/Capability .php';
   // put your Twilio API credentials here
   $accountSid = 'AC';
   $authToken = 'ce';
  // put your Twilio Application Sid here
  $appSid = 'AP';
  $capability = new Services_Twilio_Capability($accountSid, $authToken);
  $capability-&gt;allowClientOutgoing($appSid);
  $capability-&gt;allowClientIncoming('Harry');
  $token = $capability-&gt;generateToken();
  ?&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Hello Client&lt;/title&gt;
  &lt;script type="text/javascript"
  src="//static.twilio.com/libs/twiliojs/1.1/twilio.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"
  src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"&gt;
  &lt;/script&gt;
  &lt;link href="http://static0.twilio.com/packages/quickstart/client.css"
  type="text/css" rel="stylesheet" /&gt;
  &lt;script type="text/javascript"&gt;
  Twilio.Device.setup("&lt;?php echo $token; ?&gt;");
  Twilio.Device.ready(function (device) {
  $("#log").text("Ready");
  });
  Twilio.Device.error(function (error) {
  $("#log").text("Error: " + error.message);
  });
  Twilio.Device.connect(function (conn) {
  $("#log").text("Successfully established call");
  });
  Twilio.Device.disconnect(function (conn) {
  $("#log").text("Call ended");       
  Twilio.Device.parameters();
  });
  Twilio.Device.incoming(function (conn) {
  $("#log").text("Incoming connection from " + conn.parameters.From);
  // accept the incoming connection and start two-way audio
  conn.accept();
  });  
  function call() { 
  // get the phone number to connect the call to
  params = {"PhoneNumber": $("#number").val()};
  Twilio.Device.connect(params);
  }
  function hangup() {
  Twilio.Device.disconnectAll();
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;button class="call" onclick="call();"&gt;
  Call
  &lt;/button&gt;
  &lt;button class="hangup" onclick="hangup();"&gt;
  Hangup
  &lt;/button&gt;
  &lt;input type="text" id="number" name="number"
  placeholder="Enter a phone number to call"/&gt;
  &lt;div id="log"&gt;Loading pigeons...&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>