Add MS Office Communicator presence indicator to JSP

I want to add an MS Office Communicator presence indicator to my Java application (jsp).

+5
source share
1 answer

If you are guided by the Windows platform, the easiest way is to do everything on the client side. While clients are running IE, Office 2003 or later, and Communicator 2007 or later, you can use the ActiveX NameCtrl object that is distributed with Office.

The following code should get started:

<script>

var sipUri = "your.contact@your.domain.com";

var nameCtrl = new ActiveXObject('Name.NameCtrl.1');
if (nameCtrl.PresenceEnabled)
{
  nameCtrl.OnStatusChange = onStatusChange;
  nameCtrl.GetStatus(sipUri, "1");
}


function onStatusChange(name, status, id)
{
  // This function is fired when the contacts presence status changes.
  // In a real world solution, you would want to update an image to reflect the users presence
  alert(name + ", " + status + ", " + id);
}

function ShowOOUI()
{
  nameCtrl.ShowOOUI(sipUri, 0, 15, 15);
}

function HideOOUI()
{
  nameCtrl.HideOOUI();
}

</script>

<span onmouseover="ShowOOUI()" onmouseout="HideOOUI()" style="border-style:solid">Your Contact</span>

, , (.. , ), sip uris , .

+7

All Articles