Im working with Lync client SDk 2013. I am trying to write a simple desktop application to determine when a call is Ringing, Answered, and Disconnected. I testing my application using Lync Desk phone (polycom phones). When i call my Lync phone, i get a "Notified" event, and when That call is answered, i get a "Disconnected" event.
privatestaticLyncClient _client;privatestaticvoidMain(){ _client =LyncClient.GetClient(); _client.ConversationManager.ConversationAdded+=ConversationManager_ConversationAdded; _client.ConversationManager.ConversationRemoved+=ConversationManager_ConversationRemoved;Console.ReadLine();}staticvoidConversationManager_ConversationAdded(object sender,ConversationManagerEventArgs e){ e.Conversation.Modalities[ModalityTypes.AudioVideo].ModalityStateChanged+=Program_ModalityStateChanged;}staticvoidProgram_ModalityStateChanged(object sender,ModalityStateChangedEventArgs e){Console.WriteLine("Modality state changed "+String.Format("{0} => {1}", e.OldState, e.NewState));}staticvoidConversationManager_ConversationRemoved(object sender,ConversationManagerEventArgs e){//....some code.}
output from this code is
Modality state changed Disconnected => Notified
Modality state changed Notified=> Disconnected
I did come across few nice articles, but those don't seem to help me.http://blog.thoughtstuff.co.uk/2013/01/tracking-lync-conversations-in-code/
http://msdn.microsoft.com/en-us/library/office/hh345194(v=office.14).aspx
Is there any way to determine when the call is answered and disconnected?
Thanks