title: Get twilio call status at client side javascript
body: <p>I am working twilio client JavaScript. I successfully placed a voice call to specific number but i want to know whether or not call is cancelled, unanswered and other status</p>
  <pre><code>if(Twilio) {
              Twilio.Device.setup(token);
              Twilio.Device.ready((device:any) =&gt; {
                  console.log('Twilio.Device Ready!');
              });
          
              Twilio.Device.error((error:any) =&gt; {
                  console.log('Twilio.Device Error: ' + error.message);
                // setShowInCallMenu(!showInCallMenu);
                  setIsCallConnected(false);
              });
          
              Twilio.Device.connect((conn:any) =&gt; {
                  console.log('Successfully established call!');
                  setIsCallConnected(true);
                  setStartTimestamp(moment());
                  handleRecording(true);
                 
              });
              Twilio.Device.disconnect((conn:any) =&gt; {
                  console.log('Call ended.');
                  setIsCallConnected(false);
                  handleRecording(false);
                 //toggleCaller()
                  onNativeCallback(
                      {
                          'code':4001,
                          'message':'Call Ended'
                      } 
                  );
              });
          }
  </code></pre>
  <p>webhook doesn't solve this problem all. I need the status of the call. another way would be make a separate call to callSid endpoint and get information about call but in that case it wont gave details like whether call is not answered or cancelled</p>