Skip to content Skip to sidebar Skip to footer

How To Get Outgoing Call Duration With Twilio Client API In Android?

I have developed Twilio SDK in my Android application. For outgoing and incoming it is worked well. But when i try to set the timer for call duration, i am unable to get the notifi

Solution 1:

I'm not sure if you still need help with this or not, or I get exactly your issue.

What I'm doing is keeping the timestamp of when the call was started (incoming/outgoing) in any of the clients. Then in my activity/fragment, since I have my own callbacks for the Twilio events, as soon as I know there's a call going on, I use Chronometer which is like a TextView that automatically sets things as soon as you set a base time and start it.

  1. get timestamp of when that call started
  2. Chronometer.setBase(timestamp);
  3. Chonometer.start();

So it shows the duration. Remember to have your own Twilio manager class to hold that value for you so if you leave your activity and come back, the duration will be displayed correctly.

Good luck


Post a Comment for "How To Get Outgoing Call Duration With Twilio Client API In Android?"