wrtc.onOnlineList() is an event function called when list of all users connected to IXNX server is received.
You can use this event to display list of all users you can call directly.
The online list contains all users currently connected to the IXNX unit you are connected to, thus users you can call directly, without connecting through SIP. It has basic status information of if user is in a call or not, but not full presence functionality.
List of online users has changed.
The list is updated and wrtc.onOnlineList() is called every time someone connects to or disconnects from IXNX unit, or starts or ends a call.
Workgroups are used to limit the amount of users reported by onOnlineList(). Systems with thousands of users would otherwise be overwhelmed by reporting all users' states all the time. Systems not using workgroups should turn online list reporting off if exceeding 50 users.
Only users that are members in the same workgroups as you are reported. Eg if user is member of workgroups "foo" and "bar" all other users in those groups are listed, but not users who are members of other workgroups.
User would then get an online list there all users of workgroup foo is listed in list.workgroups["foo"].users, all users of workgroup bar is listed in list.workgroups["bar"].users, and all public users not member of any workgroups listed in list.users
Public users not member of any workgroups are always listed for all other users, regardless of their workgroups.
wrtc.onOnlineList(list)
Ignored.
An online list can look like:
{workgroups:[foo: {users: [{name:"adam@company.com", name_dn:"Adam", state:"OK"}, {name:"bertil@company.com", name_dn:"Bertil", state:"busy"}]},
bar: {users: [{name:"cesar@company.com", name_dn:"Cesar", state:"OK"}, {name:"david@company.com", name_dn:"David", state:"buOK"}]} ],
users: [{name:"erik@company.com", name_dn:"Erik", state:"OK"}, {name:"filip@company.com", name_dn:"Filip", state:"buOK"}] }
The code to progress through the list can look like:
wrtc.onOnlineList = function(list) {
// public users:
if (list.users)
list.users.forEach(function(user) {display(user.name, user.name_dn, user.state)});
// workgroup users:
if (list.workgroups) {
for (var wg in list.workgroups) {
print("Workgroup: " + wg);
list.workgroups[wg].users.forEach(function(user) {display(user.name, user.name_dn, user.state)});
}
}
}