2

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.

svick
  • 236,525
  • 50
  • 385
  • 514
  • You would stand a better chance of getting an answer if you share with us what you've tried so far. e.g. have you looked at the samples in the SDK? – Paul Nearney Aug 12 '14 at 12:23
  • yes, I have tried to retrieve message with **InstantMessageReceived** event. But I want to fetch old IM message or History. – Ramashanker Tripathi Aug 13 '14 at 10:39

1 Answers1

0

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);
                };
Paul Hodgson
  • 939
  • 8
  • 15