title: Twilio browser call incoming connection status
body: <p>In a browser to browser call, when Bob doesn't answer Alice's call, Alice receives no answer and disconnect from Bob, but Bob never knows Alice disconnected.</p>
  
  <p>How does Bob know that Alice disconnected?</p>
  
  <p>Alice:</p>
  
  <pre><code>var connection;
  
  Twilio.Device.setup(token);
  Twilio.Device.connect(onConnect);
  Twilio.Device.disconnect(onDisconnect);
  
  function onConnect(conn) {
    connection = conn;
    console.log("onConnect: " + connection.status()); //onConnect: open
  };
  
  function onDisconnect() {
    connection.disconnect();
    console.log("onDisconnect: " + connection.status()); //onDisconnect: closed
  }
  
  $('.close').one("click", function() {
    Twilio.Device.disconnectAll();
  });
  
  $(document).ready(function () {
    Twilio.Device.connect({
      agent: 'bob'
    });
  });
  </code></pre>
  
  <p>Bob: </p>
  
  <pre><code>  var connection;
  
    Twilio.Device.setup(token);
    Twilio.Device.incoming(onIncoming);
    Twilio.Device.disconnect(onDisconnect);
  
    function onIncoming(conn) {
      connection = conn;
      console.log("onIncoming: " + connection.status()); //onIncoming: pending
    }
  
    //never arrives here when caller disconnect
    function onDisconnect() {
      console.log("onDisconnect: " + connection.status());
    }
  </code></pre>