Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list all available registered clients?

Tags:

twilio

Using the twilio javascript client I can register a client like that:

capability.AllowClientIncoming("jenny");

Now let's say I have a number of people opening their browser and registering: "jenny", "benny", "teddy", "smitty"...

Is there a way I can list all the registered clients? Either with the twilio.js library or the REST API?

like image 819
Max Favilli Avatar asked Oct 24 '25 23:10

Max Favilli


1 Answers

Twilio Evangelist here.

So you can use the Twilio.Device.presence() handler for this. It will be called once for each other client user, so you can create a list from that. If the state of any of the other client agents changes, the handler is called again.

Twilio.Device.presence(function (presenceEvent) {
  console.log(presenceEvent.from + " available: " + presenceEvent.available;
});

There is a page to describe this feature on the Twilio Blog too. Lots more information on the Twilio Docs page.

like image 192
xmjw Avatar answered Oct 26 '25 19:10

xmjw