I have an application which relies on a dedicated Lync client sitting on a server to manage ad-hoc MeetNow rooms.
Lync automatically closes the conversation after 15 minutes of inactivity. I found a blog describing a way to surreptitiously keep the conversation alive by sending a "cancel transfer" message, but that solution uses UCMA and I only have the 2013 Lync Client SDK available.
The way it's done there is (basically):
var contentType = new System.Net.Mime.ContentType("text/x-msmsgsinvite");
var s = @"Application-Name: File Transfer\r\nInvitation-Command: CANCEL\r\nInvitation-Cookie: 12345\r\n");
byte[] htmlBytes = Encoding.UTF8.GetBytes(s);
Flow.BeginSendInstantMessage(contentType, htmlBytes, EndSendInstantMessage, Flow);
But, again, this is using UCMA. The Lync Client SDK doesn't work exactly the same.
I need to use a Modality of the Conversation to send a message, and I can't set the content type to text/x-msmsgsinvite
because it uses InstantMessageContentType
, an Enum
where the only content types available are: Invalid, PlainText, Html, RichText, Gif, Ink, Unknown
.
Attempts I've made using the 2013 Client SDK:
(first, I make sure the Modality.State
is connected - it is).
I tried sending an empty message - Received an exception saying that the
Value does not fall within the expected range
. I may be misunderstanding this, but I took it to mean that an empty string does not a message make.I tried sending just a random message with content type set to
Invalid
- Received an exception with the messageUnknown InstantMessageContentType. Type is Invalid
. (wasn't actually expecting this one to succeed)I tried sending a message with content type set to
Html
, where the message contained a<div>
withstyle="display: none;"
- this manages to keep the conversation alive, but, of course, this displays an empty message from the Applicative User
I would very much like to avoid sending an actual message that displays in the MeetNow room (even if all it shows is the Applicative User's name).
Any ideas?