You wish to implement a custom webpart for SharePoint that integrates with OCS(Lync) to display user information such as presence
But you have faced that presence/pawn information look incorrect. Email adress are different. Like real firstname.lastname@example.org shown instead of real email address of email@example.com .
So this is a bydesign issue. Let explain how it is working:
in SharePoint hive C:\program files\common files\microsoft shared\web server extentions\14\TEMPLATE\Layouts\<your LCID code>\INIT.JS
If you examine inside that code you will find that we are using an Office ActiveX control named NameCtrl . At the background the assembly of C:\Program Files\Microsoft Office\Office14\Name.dll which is loaded by browsers when you install office.
This ActiveX has responsible for communication and gather “Presence” information.
“Users must have Office 2010, Office 2007, or Microsoft Office 2003 with the latest service pack installed to view extended presence information on a SharePoint Server page.
To display the presence indicator and its associated contact card (in Office 2010) or menu (in Office 2007 and Office 2003), SharePoint uses the Microsoft ActiveX control name.dll. The ActiveX control makes calls directly to the Microsoft Lync 2010 API, and then Lync makes MAPI or Exchange calls to supply the requested information.” http://technet.microsoft.com/en-us/library/gg398806.aspx
Presence is enabled in SharePoint by default; there are no configuration steps for the SharePoint administrator to perform. Each SharePoint page includes Microsoft JScript® code, which enables presence for that site. JScript uses name.dll to call the Lync API and pull presence for users names who appear on the site. JScript uses the users’ SIP URI to pull presence for names that are listed on the site. The following JScript code is an example of presence being pulled for a user named Bob Kelly, whose SIP URI is firstname.lastname@example.org. The SIP URI is added by using variables to the JScript when the script is loaded and presence is being pulled.
<a href=’jscript:;’ onclick=’IMNImageOnClick(event);return false;’ class=’ms-imnlink’><img name=’imnmark’ class=’ms-imnImg’ title=” border=’0′ height=’12′ width=’12′ src=’/_layouts/images/blank.gif’ alt=’No presence information’ sip=’email@example.com’ id=’imn_74,type=smtp’/></a><a onclick=”GoToLink(this);return false;” </a>
Please Check Resource Kit Book: SharePoint Integration
it is not only bordered by SharePoint. You can easely develop a small ASP.Net application and can able to show Presence information.
Look for belowed code.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TestIM._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
var sipUri = "firstname.lastname@example.org";
var nameCtrl = new ActiveXObject('Name.NameCtrl.1');
nameCtrl.OnStatusChange = onStatusChange;
function onStatusChange(name, status, id)
alert(name + ", " + status + ", " + id);
nameCtrl.ShowOOUI(sipUri, 0, 15, 15);
<form id="form1" runat="server">
<span onmouseover="ShowOOUI()" onmouseout="HideOOUI()" style="border-style:solid">Here is the contact info</span>
Also within the blog mentioned in the issue description http://blogs.msdn.com/b/uksharepoint/archive/2010/05/07/office-communicator-integration-presence-in-a-custom-webpart-for-sharepoint-2010.aspx
“The key piece of information to make the presence work is the user’s SIP Address which is basically their IM address (This is not always the same as email address). When a users is either added to a site in SharePoint or has their profile imported, the SIP Address will be drawn from Active Directory which is where OCS stores it and placed into the SIP address field in either the user’s profile which will in turn synchronise down to the site’s local ‘User Information’ page.”
The problem is if your SIP address and default email address are different that you will see sip address on presence information by design:
So you can do:
1. To be sure for preventing other problems by Installing latest office pathces. For Today it is SP1 for Office 2010 + the hotfix 2553112 2553112 Description of the Office 2010 hotfix package (name-x-none.msp): August 30, 2011 http://support.microsoft.com/kb/2553112/EN-US
2. If a user’s SIP proxy address and the user’s default e-mail address are different the presence information cannot be shown.Make sure the user’s SIP proxy address and the user’s default e-mail address are the same.Make them same.