Search code examples
c#.net-4.0sipucma2.0lync-server-2010

UCMA: Check custom SIP headers on receiver side for custom sender information


I'm using the CallEstablishOptions object on my message establishment side, to initiate a InstantMessageCall with addition custom headers.

CallEstablishOptions callOptions = new CallEstablishOptions();
callOptions.Headers.Add(new SignalingHeader("X-MyApp-UserId", userId));

I want to use it to pass additional information about the sender to the receiver (information that is not stored on the contact itself). The question is now, can i retrieve that information again on the receiver side. I checked the CallReceivedEventArgs<InstantMessagingCall> argument that I get when a InstantMessagingCall comes in, but this does not seem to support it. Any thing I missed here? Is it even possible to do it like that? I'm not that familiar to SIP itself, to know whether or not custom headers even work like that.

Any other ideas on how to send custom data along with the instant message? While typing this, i thought about defining a custom mimetype, add a mimepart with that type to every message i send, and add the additional information there?


Solution

  • to answer to myself (again): the header idea did not work out, however the additional mime part did. Sending formatted text with UCMA 2.0 describes how to send a multipart/alternative message. so, instead of sending a plaintext message along with a htmltext message, i send plaintext with some application/x-myapp-metadata contenttype, and add additional data there.

    in UCMA 3.0, there is actually a context channel that you use to send such meta information, since UCMA 3.ß API only runs on 64bit maschines, but I have to support 32 bit machines as well.

    I hope this answer will help others as well.