将 Microsoft Office Communicator 2007 集成到 ASP.NET 页面中

发布于 2024-09-28 06:16:05 字数 162 浏览 4 评论 0原文

我正在为我公司的 Intranet 使用 ASP.NET 和 C# 构建一个网站。那么是否可以将 Microsoft Office Communicator 2007 集成到 ASP.NET Page 中。即该网站应该能够提供所有联系人的当前状态(可用、忙碌、离线),并且当用户单击用户名时,应该打开聊天窗口。

I am working on a website build using ASP.NET and C# for my company's intranet.So is it possible to integrate the Microsoft Office Communicator 2007 in ASP.NET Page. i.e. the site should be able to provide the current status(avalible, busy , offline) of all contacts and when a user clicks on the username, the chat window should open.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

っ〆星空下的拥抱 2024-10-05 06:16:05

假设客户端计算机正在运行 Communicator、Office 和 IE,到目前为止最简单的方法是使用 NameCtrl - 下面的示例应给出基本概念。这也将为您带来最划算的功能。将鼠标悬停在“您的联系人”文本上即可看到弹出的角色菜单。

对于现实世界的解决方案,您只需要实现一个根据返回的在线状态而变化的图像(即与每个用户名一起显示的在线气泡),以及图像的 sip uri 集合,以确保您可以将传入的状态更改映射到相关图像。

值得记住的是,另一个答案中提到的 Ajax/CWA 解决方案很可能无法与 Lync Server 一起使用(我相信 Communicator Web Access 已不再存在),因此如果您的公司升级到 Lync,则需要更改解决方案。我已经测试了下面的解决方案,它适用于 Lync Server RC。

<script>

var sipUri = "[email protected]";

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>

Assuming the client machine is running Communicator, Office and IE, by far the simplest way is to use the NameCtrl in client-side script - the example below should gives the basic concepts. This will also give you the most bang-for-buck in terms of functionality. Hover over the "Your Contact" text to see the persona menu pop up.

For a real world solution, you'd just need to implement an image that changes depending on the presence state that gets returned (i.e. a presence bubble to display alongside each users name), and a collection of sip uris to images, to ensure you can map an incoming status change to the relevant image.

It's worth bearing in mind that the Ajax/CWA solution mentioned in the other answer will most likely not work with Lync Server (I believe Communicator Web Access is no more) so you'd need to change the solution if your company upgrades to Lync. I've tested the solution below, and it works with the Lync Server RC.

<script>

var sipUri = "[email protected]";

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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文