Browser Phone ยป Presence

Twilio Presence

OpenVBX contains hooks for monitoring Presence events on Twilio Client.

Presence events fire each time a user connects, disconnects, or toggles their online status in their browser.

OpenVBX.presence

Bind an event listener and callback function to OpenVBX.presence to receive Client Presence events on your page.

Parameters

Your callback function must take 2 parameters

Name Type Description
client Object The current event object. This object will have 2 members:
  • from: The client ID that triggered the event. In the case of OpenVBX this is the user's system ID in OpenVbX
  • available: a boolean value of `true` or `false`
onlineClients Array The current list of online client IDs.

Returns

void

Usage

jQuery(function($) {
  $(OpenVBX.presence).bind('presence', function(client, onlineClients) {
    // ... your code here
  });
});