How to retrieve IM message from lync client 2013 communication

核能气质少年 提交于 2019-12-07 23:46:38

问题


I am using lync 2013 sdk and i need to create a task with conversation IM message on the end of call.

I want some method as - conversation.getIMmessage() etc.

how can i implement that.


回答1:


So assuming you are using the Lync Client SDK you are going to need to add an event handler for IM received to the IM modality of each participant in a conversation. This is best considered in reverse order:-

Set up an event handler for participant being added to a conversation:-

Conversation.ParticipantAdded += Conversation_ParticipantAdded;

In that event handler get the IM Modality for that participant, with something like:-

var imModality = Conversation.Participants.Single(p => p.Contact.Uri.Equals(newParticipantSIP, StringComparison.CurrentCultureIgnoreCase)).Modalities[ModalityTypes.InstantMessage] as InstantMessageModality;

And then add a IM received event handler to the modality:-

imModality.InstantMessageReceived += (sender, e) =>
                {
                    DoStuff(e.Text);
                };


来源:https://stackoverflow.com/questions/25263573/how-to-retrieve-im-message-from-lync-client-2013-communication

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!